Rodata, BSS, Text, Heap Memory

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
latent
Posts: 1
Joined: Mon Nov 30, 2020 3:04 am

Rodata, BSS, Text, Heap Memory

Post by latent » Mon Nov 30, 2020 3:11 am

Hello,

I am new to the board so I hope this is the right spot to place this topic.

I am working with the Wemos D1 Mini and Micropython and need to read the Rodata, BSS, and Text in memory.

I have tried using the Micropython internal libraries like gc.collect() and micropython.mem_info() and while this does provides useful info, it does not give me the exact values for the RoData, BSS, Text which I need. I have even tried uPyCraft and WebREPL but these did not provide the info unless I missed something.

Is there a way to get this info - any tool, api or micropython command?

Thanks in advance for any advice.

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: Rodata, BSS, Text, Heap Memory

Post by jimmo » Sun Jan 10, 2021 11:19 pm

latent wrote:
Mon Nov 30, 2020 3:11 am
it does not give me the exact values for the RoData, BSS, Text which I need
I'm not quite sure what you're trying to do, but if you want to be able to access memory, the machine.mem8 (and mem16, mem32) API might be useful.

However, you still have to know where the .rodata, .bss and .text segments are mapped (but you can look at firmware.map or firmware.elf from the build).

Post Reply