MicroPython Memory Management Tips with the XBee 3

The available memory allocated for MicroPython can be found on the product's specification page: https://www.digi.com/products/embedded-systems/digi-xbee/rf-modules/2-4-ghz-rf-modules/xbee3-zigbee-3#specifications

There are some things you can do to use the memory space more efficiently : 

* Compile the application using the os.compile() function to create a .mpy file.  Your .py file will be compiled to a smaller .mpy file format.  If you are having issues, you can install the mpy-cross function to your PC so you can use and see syntax errors. 

* When possible, you should write your code into smaller modules and cross-compile them on a PC, uploading to the XBee device and then using os.bundle() to freeze/embed them into the flash where they can run in-place, with minimal heap usage.

To see more about these functions, please go to these links in the MicroPython Guide:


Last updated: Sep 08, 2020

Filed Under

RFRF Dev kits

Recently Viewed

No recently viewed articles

Did you find this article helpful?