Hello!
I want merge and write via SWD full firmware, including: main firmware, bootloader, settings page.
When I start debug, all data correctly writed, but main firmware not start, bootloader thinks that firmware broken. After that, I update firmware via phone, and main firmware start working.
I use:
- nrf52832 in nrf52810 mode;
- nRF5_SDK_15.3.0_59ac345;
- s112_nrf52_6.1.1_softdevice;
examples:
- ble_app_buttonless_dfu for pca10040e
- secure_bootloader pca10040e_ble
Bond mode disabled, all settings default
IDE: SES.
For generation firmwares zip and settings hex, I use next commands:
nrfutil pkg generate --hw-version 52 --sd-req 0xB8 --application-version-string 0.5.02 --application Output\Release\Exe\ble_app_buttonless_dfu_pca10040e_s112.hex --key-file PrivateKey.pem Firmware.zip nrfutil pkg generate --hw-version 52 --sd-req 0xB8 --bootloader-version 2 --bootloader secure_bootloader_ble_s112_pca10040e.hex --key-file PrivateKey.pem Bootloader.zip nrfutil settings generate --family NRF52810 --application Output\Release\Exe\ble_app_buttonless_dfu_pca10040e_s112.hex --application-version-string 0.5.02 --bootloader-version 3 --bl-settings-version 2 BlDfuSettings.hex mergehex -m BlDfuSettings.hex secure_bootloader_ble_s112_pca10040e.hex -o bootloader.hex
I uploaded the entire flash memory to a file for both cases and compared them. Several differences were found:
Search for differences 1. C:\Temp2\1test.bin: 196 608 bytes 2. C:\Temp2\2test.bin: 196 608 bytes Offsets: hexadec. 26000: FF DE 26001: FF C0 26002: FF AD 26003: FF DE 26005: FF 01 26006: FF 1E 26007: FF F1 27000: FF DE 27001: FF C0 27002: FF AD 27003: FF DE 27004: FF FE 27005: FF 01 27006: FF 1E 27007: FF F1 15 difference(s) found.
These addresses do not apply to the loader, the softlibrary, or the firmware hex file.
After that, I found out that the ble_app_buttonless_dfu is recording at these addresses. What is this?
And interestingly enough, if you do not run the firmware for execution (only run to start of main() ), the addresses above will not be recorded, you can press the reset many times, and the controller will reach quite correctly to the main.
In this case, if you unload the flash memory, it will completely coincide with the one loaded via the emulator.
I don’t understand why, immediately after writing the flash memory through an emulator, there is not run to main??
The biggest problem is that I can not start the program for debugging. And if I turn on the bond mode, the bootloader is not visible in the list of devices, because it is not bond with anyone.