I also want to use the FlashMemory.h functions on a BW16 module.
I am concerned about how FLASH_MEMORY_APP_BASE works.
I can see it is set to 0x0010 0000, but referring to the datasheet for the RTL882XD, that address is marked as “RSVD”, persumably meaning ‘reserved’.
According to the same datasheet (and indeed the addresses in which programs are stored), the flash memory seems to start at 0x0800 0000
How, then is 0x0010 0000 a ‘safe’ address to use?
Also, is there a way of preserving the information in this block through a firmware update? I guess I could use a custom updater which reads the data then writes it back - perhaps somebody has done this already? It must be a common reqirement (e.g. to retain IP address, network SSID etc)
you should also refer to chapter 9 of AN0400 Application note, which provides the default flash layout.
Flash memory indeed starts at address 0x0800_0000, FLASH_MEMORY_APP_BASE is used more like an offset, with the code internally adding in the starting flash address.
Chapter 9 shows that using an offset of 0x0010_0000 places the data in the User Data section of flash memory. You can also choose to change the code and shift this to the end of the flash memory region.
Thankyou - I thought I’d ‘fully digested’ AN400, but I’d missed that very useful table!
And so far as I can see, the standard erase functions in upload_image_tool_windows.exe appears to leave 0x0810_0000 un-touched, which solves the problem of retention.