Tailoring the Micropython when using the zephyr port

Showroom for MicroPython related hardware projects.
Target audience: Users wanting to show off their project!
Post Reply
whoami2
Posts: 1
Joined: Thu May 10, 2018 3:06 am

Tailoring the Micropython when using the zephyr port

Post by whoami2 » Fri May 11, 2018 3:09 am

I'm a novice at Micropython.I have tried to use the port of MicroPython to Zephyr RTOS,and the size of the file after compiled is about 165kb flash and 40kb sram.
But the region size of the mcu I am using is 64kb'flash and 8kb's sram.So i want to do some tailoring of Micropython and I was wondering if this is possible?
I have used the "Minimal build" which is a way offered by the official, the size of the ".bin" file is 130kb flash and 25kb sram which is still too large to use on my board.
Is there any one who could offer me some advice and I'll feel so grateful for this. :)

jickster
Posts: 534
Joined: Thu Sep 07, 2017 8:57 pm

Tailoring the Micropython when using the zephyr port

Post by jickster » Sat May 12, 2018 12:22 am

whoami2 wrote:I'm a novice at Micropython.I have tried to use the port of MicroPython to Zephyr RTOS,and the size of the file after compiled is about 165kb flash and 40kb sram.
But the region size of the mcu I am using is 64kb'flash and 8kb's sram.So i want to do some tailoring of Micropython and I was wondering if this is possible?
I have used the "Minimal build" which is a way offered by the official, the size of the ".bin" file is 130kb flash and 25kb sram which is still too large to use on my board.
Is there any one who could offer me some advice and I'll feel so grateful for this. :)
How did you deduce how much RAM it takes from the .bin file?

There are three components to RAM usage (that I can think of): size of heap, amount of stack used, global state of micropython.

The heap is specified by you when you initialize micropython and it’s usually dynamic ie allocated at runtime so it’s not possible to look in the .bin to count much is used. You could allocate it as a global array and only then it would show up as “ram used” in the .bin.

The amount of stack used by the runtime depends on the .py script it executes. You can specify a stack size limit and the runtime will throw an exception when it hits it.

That leaves the global state: that’s the ONLY type of RAM usage you can deduce from your .bin file.


I believe you’ve misanalyzed your .bin file.

Post Reply