Just for my clarification to use END_OF_FLASH and have it be correct I need to add a -1? This is that zero is 1 for our counting, This tripped me up a few times when dividing memory up for something else if I have the right.The Pico SDK pulls in the appropriate board definition file where it is effectively defined, such as for Pico W -
https://github.com/raspberrypi/pico-sdk ... co_w.h#L71
Code: Select all
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (2 * 1024 * 1024)
#endif
Then
Code: Select all
#define END_OF_FLASH (0x10000000 + (PICO_FLASH_SIZE_BYTES))
That's not absolutely correct, has an 'off by one error', but follows the, IMO dubious, Pico SDK semantics that 'BYTE_AFTER_END_OF' is 'END_OF'.
Thanks. That does indeed say it's using the last two sectors of Flash which is what MicroPython also uses for file system.Yes I have that https://www.raspberrypi.com/documentati ... e7f6bdfb6d
I really don't know if that means MicroPython on a Pico W is broken or has found some way to avoid the conflict. I couldn't even figure out how to print whatever value 'pico_flash_bank_instance()' has within the MicroPython firmware. I don't know what would provoke such a write so can't check if it is corrupting the file system or not.
I'm going to say "not my problem" and ignore it. But, yes, for you, not using the last two sectors of Flash should be okay.
It does say it's the default way it work so there must be some way to change it but this would be a stumbling block of anyone not aware of it. so maybe the advice would be to use the END_OF_FLASH - 8k and maybe that 1 to get the alignment right?
Statistics: Posted by DarkElvenAngel — Sat Dec 30, 2023 2:07 am