Is there any way to change the linker script to create a code section for placing a block with default device settings at the compiler time and read them by flash api.
Or another way to initialize the custom settings section used by the flash api at compile time? ?
I have no experience on modifying linker scripts. However, maybe you can use some macro definitions on code if you have custom settings needed that can be controlled at compile time.
I am not familiar on the low level management of memory spaces of RAK3172 RUI3 implementation. I can try to support you by asking the R&D team. The way I understand it, you want to configure the USERCFG space.
However, linker script modification is not what we advise our customers but use the APIs we developed under RUI3 whenever possible.
Yes, modification of linker script is last method i prefer to use. But its only one way to place var`s at specific address of flash.
This needed to make struct with settings been initialized after flashing device
After that i can use flash api of RUI3 to save and load config.
Device settings are load after boot.
If settings are not placed there at the time of programming the validation mechanism will generate a message that they are corrupted, because checksums do not match.
To fix these is necessary to add the operation to write them at the production stage (it’s not a necessary extra job).
But if they placed at offset of user settings (MCU_USER_DATA_NVM_ADDR 0x08037800 ) i can use api to manupulate them.