This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

some problems about Integrating 2 application firmwares on 51822

Hi, For providing OTA function , I add dfu service into my own application APP1. and create another application App2 to copy the new firmware(named APP3) and cover the flash area, where APP1 is burned. the new firmware is received, saved and verified by APP1, maybe this is confusing. there are some details:

Address start/end size name usage 0x3C800-0x3E800 8K APP2 earse APP1's flash area, cover APP1 using APP3's content 0x28400-0x3C800 81K APP3 a new firmware is stored here, waiting for being burned 0x14000-0x28400 81K APP1 include some gatt services and DFU service. Accept new firmware and stored into area APP3. 0x00000-0x14000 80K softdevice ble protocol stack

So the normal process is like this: when APP1 received new firmware, it will stored to flash area(start from 0x28400), then jump to run APP2(started from 0x3C800). APP2 will copy content(located in 0x28400-0x3c800) into flash area(0x14000-0x28400), then jump to 0x14000. the intent is implementing firmware update over the air.

Problem 1: test on my product , sometimes it will succeed,most time it will fail. test on nrfgo motherboard always fail. take the motherboard for example, I see app1 output logs that new firmware is received, stored and vertified. But no any log from app2. for my product, sometimes it will succeed to advertise(a device name that is set by new firmware), sometimes it has no action and advertise the new device name after reconnecting lithium battery. and sometimes it still advertise the old device name after reconnect battery, that means fail.

Problem 2: is it permitted to do like this?

bootloader_app_start (0x00014000); bootloader_app_start(0x0003C800); void bootloader_app_start(uint32_t app_addr) { // If the applications CRC has been checked and passed, the magic number will be written and we // can start the application safely. interrupts_disable();

uint32_t err_code = sd_softdevice_forward_to_application();
APP_ERROR_CHECK(err_code);

//bootloader_util_app_start(CODE_REGION_1_START);
bootloader_util_app_start(app_addr);

}

and I have made a test, if app1: printf("A"); bootloader_app_start(0x0003C800); app2: printf("B"), bootloader_app_start(0x00014000); output is "ABABAB..." .

Did I miss something like set/clear register, or calling softdevice's funcion?

Related