Hello keil Team,
I am working on an nRF52833 project using nRF5 SDK 17.1.0 with Secure DFU Bootloader.
Environment:
After flashing, OTA DFU is not working and device advertising is also not starting.
I am not getting any logs, so I checked the CPU registers using:
nrfjprog --readregsWhy is this happening? In Segger I am not facing any problem, but in Keil I am getting issues while doing OTA. Please give me the solution.
nrfjprog --readregs
nrfutil settings generate --family NRF52 --application ble_app_bond.hex --application-version 1 --bootloader-version 1 --bl-settings-version 2 bl_settings.hex
Note: Generating a DFU settings page with backup page included.This is only required for bootloaders from nRF5 SDK 15.1 and newer.If you want to skip backup page generation, use --no-backup option.
Generated Bootloader DFU settings .hex file and stored it in: bl_settings.hex
Bootloader DFU Settings:* File: bl_settings.hex* Family: nRF52* Start Address: 0x0007F000* CRC: 0x300FC910* Settings Version: 0x00000002 (2)* App Version: 0x00000001 (1)* Bootloader Version: 0x00000001 (1)* Bank Layout: 0x00000000* Current Bank: 0x00000000* Application Size: 0x00015190 (86416 bytes)* Application CRC: 0xB814089E* Bank0 Bank Code: 0x00000001* Softdevice Size: 0x00000000 (0 bytes)* Boot Validation CRC: 0x369542E3* SD Boot Validation Type: 0x00000000 (0)* App Boot Validation Type: 0x00000001 (1)
C:\Users\admin>mergehex --merge s140_nrf52_7.2.0_softdevice.hex nrf52833_xxaa_s140.hex ble_app_bond.hex bl_settings.hex --output final_dongle.hexParsing input files.Merging file "s140_nrf52_7.2.0_softdevice.hex" into output.Merging file "nrf52833_xxaa_s140.hex" into output.Merging file "ble_app_bond.hex" into output.Merging file "bl_settings.hex" into output.Storing merged file.
C:\Users\admin>nrfjprog --eraseallErasing user available code and UICR flash areas.Applying system reset.
C:\Users\admin>nrfjprog --program final_dongle.hex --verify[ #################### ] 3.404s | Program file - Done programming[ #################### ] 3.338s | Verify file - Done verifying
C:\Users\admin>nrfjprog --readregsR0: 0x00000004R1: 0x61000006R2: 0x00027000R3: 0x0002721FR4: 0x20004F18R5: 0x20004F24R6: 0x00000000R7: 0x20004F18R8: 0x00000000R9: 0x00000002R10: 0x00000000R11: 0x00000000R12: 0x00000000SP: 0x20005330LR: 0xFFFFFFF9PC: 0x0002721ExPSR: 0x21000003MSP: 0x20005330PSP: 0x00000000RAZ: 0x00000000CFBP: 0x00000001APSR: 0x20000000EPSR: 0x01000000IPSR: 0x00000003
C:\Users\admin>nrfjprog --memrd 0x10001014 --n 40x10001014: FFFFFFFF |....|
I checked on Google and found that UICR writing is not happening, and because of that the SVCI function is crashing. Why does this issue occur, and what is the solution for it?
Please share the .sct (scatter) file for both the application and bootloader.
.sct
APPLICATION-
; *************************************************************; *** Scatter-Loading Description File generated by uVision ***; *************************************************************
LR_IROM1 0x00027000 0x00059000 { ; load region size_regionER_IROM1 0x00027000 0x00059000 { ; load address = execution address*.o (RESET, +First)*(InRoot$$Sections).ANY (+RO).ANY (+XO)}RW_IRAM1 0x20003D20 0x0001C2E0 { ; RW data.ANY (+RW +ZI)}}
BOOTLOADER -
LR_IROM1 0x00073000 0x00080000 { ; load region size_regionER_IROM1 0x00073000 0x00080000 { ; load address = execution address*.o (RESET, +First)*(InRoot$$Sections).ANY (log_const_data).ANY (log_dynamic_data).ANY (log_filter_data).ANY (sdh_ble_observers).ANY (sdh_req_observers).ANY (sdh_soc_observers).ANY (sdh_stack_observers).ANY (sdh_state_observers).ANY (svc_data).ANY (+RO).ANY (+XO)}RW_IRAM1 0x20002AE8 0x0001D518 { ; RW data.ANY (+RW +ZI)}}
I manually write the bootloader address in the UICR register, but then a stack pointer error occurred.