makerdiary / nrf52840-mdk-usb-dongle

An open-source, small and low-cost USB Dongle that supports Bluetooth 5.4, Bluetooth mesh, Thread, Zigbee, 802.15.4, ANT and 2.4 GHz proprietary protocols
https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/
Apache License 2.0
301 stars 79 forks source link

Flash memory map base address query #101

Open adamfowleruk opened 4 days ago

adamfowleruk commented 4 days ago

Hello,

I have an application making use of the Zephyr Flash Map storage functions:-

https://docs.zephyrproject.org/latest/services/storage/flash_map/flash_map.html#flash-map

I use this as-is successfully with Nordic's own nRF52840 dongles. This uses a base address for the storage_partition of 0x7A0000.

When using the MDK dongles - with either the old 0.2 or new 0.7 UF2 bootloader, the flash configuration file I'm merging into my app file appears not to be being read.

Your flash layout diagram on this page doesn't mention where any storage_partition as per the DTS file would be located:-

https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/programming/uf2boot/#flash-memory-layout

Could you please give me a pointer as to how your device (programmed using Nordic SDK) would layout the storage_partition so I can set a correct base address for my configuration data?

Thank you in advance.

Regards,

Adam.

adamfowleruk commented 4 days ago

Wouldn't you know it - just after I ask a question I figure it out!

For others' reference - the final base address can be found in the ./build/zephyr/dephyr.dts file by searching for 'storage partition'. E.g.:-

storage_partition: partition@cc000 {
    label = "storage";
    reg = < 0xcc000 0x4000 >;
};

So for this board the base address for flash storage is 0xcc000. (The Nordic nRF52840 dongle board for reference is 0x7A000).