Home/Support/Support Forum/Flash memory info about XBee 3 Zigbee 3 RF Module and some help

Flash memory info about XBee 3 Zigbee 3 RF Module and some help

0 votes
Hey, everyone!

Well i am a newbie so please forgive my ignorance regarding the following questions:
1) from the file manager i am able to see the file system in my XBee 3 Zigbee 3 RF Module. Well, all i see is the /flash directory and inside it there lays
my custom example.py file i uploaded, along with the lib folder which seems to be empty.
So, where is the boot.py file?
My undestanding is that boot.py is the file that takes over the moment the board is powered on...is it a hidden file and where is it hidden?
are there other files i should see inside root directory or inside flash directory?

2) as mentioned in the question title, i am interested in memory aspects. In detail, my intention is to save various data received from a sensor (using the i2c bus) in the
flash memory. For that reason, i want to know for sure the exact capacity of the memory that is available.
In Digi's site i have found only this info regarding the memory:
1 MB / 128 KB RAM (32 KB are available for MicroPython) BUT somewhere (can't remember where now) i saw that the flash memory is split in half, with one half used for OTA firmware updates and the other half is used for the file system..Well 32KB shoud also be occupied for Micropython envirnonment...
So what is the actual memory size available?

I also tried the uos.statvfs() function/command (after importing uos module) and the result i got is the tuple: (2048, 128, 3056, 2448, 2448, 0, 0, 0, 0, 64),
but i am not sure how is that related (i warned you all, i am a complete noob), if at all is related.

3) Lastly, any help about where/what to start reading (i.e documentation or links) in order to start writing to the flash, would be more than welcomed...

Thank you in advance for any help in any of the aforementioned questions!!!!
asked Sep 28, 2020 in XBee3 ZigBee by manos New to the Community (4 points)

Please log in or register to answer this question.

1 Answer

0 votes
Perhaps you can provide a link to the Example you are working with and mention what product you have and what firmware version you are working with. This information will help everyone understand where your questions are coming from.
answered Sep 28, 2020 by mvut Veteran of the Digi Community (14,297 points)
Well, first of all thank you for your answer!

The product i have is an XBee 3 Zigbee 3 RF Module
(specs in here:
https://www.digi.com/products/embedded-systems/digi-xbee/rf-modules/2-4-ghz-rf-modules/xbee3-zigbee-3#specifications
)
with a SMT development board. The firmware version is 1008.
There is no specific example i am trying to run, just a custom problem (as already described: an adc transmits data via i2c protocol to the xbee. Those data shall be saved in flash memory).

Let me help you though with some progress/observations i have made...and please, if you know, correct me or assure me:)

Regarding #1, the question remains: Should there be a boot.py file visible in the file system? is it a hidden file?

Regarding the "question" #2(let's call it a question, although it seems more like a confused guy's guess...):
Through XCTU file manager i can "see" that there is available about 382KB of memory in total..
Well, that's my flash memory. Which makes sense if what i said in my previous post is right.
I refer to the fact that from the 1MB of flash mem available, half is used for OTA firmware updates and that the rest (excluding some overhead there) shall be available for usage.
By the way do you know if there is any MicroPython's module function that could show me the size of the flash? (i mean alternatively to using XCTU's file manager)

Now, the 32KB of memory occupied for the MicroPython environment, i think that that might be part from the RAM memory, right?
As i found out in Digi's MicroPython programming guide, XBee allocates 32KB of RAM for the heap and 4KB of RAM in the stack. Does that mean that there are 36KB of RAM, in total, allocated by MicroPython and that's all in terms of RAM memory? So i guess the specs referred to that...

Now, regarding the uos.statvfs function, the name indicates me that it should return the free blocks of flash memory, since the virtual file manager should "reside" in the flash memory (right?).
But this doesn't really seem to be the case...I mean, if i am not mistaken blocks are 16bits and by multiplying 2048(# of free blocks) to 16bits we get about 4KB...So i am not pretty sure about what to think here..Any ideas?

Hopefully, i didn't confuse you more and i made my questions a little bit clearer...
Thank you again for your help and i hope you could shed some light in here...
As far as I am aware of, there is no need for a boot.py file. So no, I would not expect there to be one.
You can issue some of the ATFS commands in Micro Python. This way you can see the memory size.
Hey again,

regarding the ATFS command...Can you give me some help?
I have imported xbee module and tried use xbee.atcmd() but it seems that those file system commands are not valid for the MP environment...This is also claimed in the User Guide ("To access the file system, enter Command mode and use the following commands. All commands
block the AT command processor until completed and only work from Command mode; they are not
valid for API mode or MicroPython's xbee.atcmd() method")

How do you suggest to do it?
Thank you for you responses!

Oh good to know...Although I am pretty sure that all the documentation I have read, said the opposite...
Anyway, how is then working? When powered on, does the firmware set up the MicroPython environment and the latter takes over?
It appears that the FS commands are not supported by Micro Python mode. https://www.digi.com/resources/documentation/Digidocs/90001539/#containers/cont_at_cmd_file_system.htm%3FTocPath%3DAT%2520commands%7CFile%2520System%2520commands%7C_____0

The Micro Python environment is already there. It is accessible via enabling it in the firmware.  When enabled, the main.py file is the one that will be run on boot if that function is enabled.
...