when I coding this,
I can not package my OTA files
it shows
So where can I find the problem?
PLEASE HELP ME
when I coding this,
I can not package my OTA files
it shows
So where can I find the problem?
PLEASE HELP ME
Hello,
Based on the error you get I suspect 'm_current_calendar' is placed directly in RAM at 0x2000FFF0 instead of being placed in FLASH and initialized to RAM by the CPU on startup. The problem with that is that you can't have data mapped to RAM in a DFU image.
Please try to not initialize the variable and see if you get the same error.
ie. change "static volatile calendar_t m_current_calendar __attribute__((at(0x2000FFF0))) = {{2017, 1, 1}, {7, 0, 0, 0}};" to "static volatile calendar_t m_current_calendar __attribute__((at(0x2000FFF0))); / *Zero-initialized */"
Thanks! So where should I place it?
I need to prevent the reset problem. So my thought is to placed directly in RAM
What is the reset problem? It's not clear to me why you need the variable to be placed at a fixed address.
Our product has a problem, the device will randomly reset, after resetting the time goes to zero, but we can't solve it now, so we use this 'm_current_calendar', when the product reset, the data and time will not effect
Thanks for the clarification. So you probably want to place the variable in a non-initialized section then. This will prevent the variable from being zero-initialized by the startup code. You may take a look at how this is done for the dfu_ble_svc.c::m_peer_data variable in the bootloader from SDK 11. Here's also a relevant stack overflow post about this subject: https://stackoverflow.com/questions/19771829/how-do-you-prevent-mdk-arm-keil-from-initializing-a-variable