nRF52833 Secure DFU Bootloader Issue with Keil uVision 5 and ARM Compiler 6

Hello Nordic Team,

I am working on an nRF52833 project using nRF5 SDK 17.1.0 with Secure DFU Bootloader.

Environment:

  • MCU: nRF52833
  • SDK: nRF5 SDK 17.1.0
  • SoftDevice: S140 7.2.0
  • IDE: Keil uVision 5
  • Compiler: ARM Compiler 6.24 (ARMCLANG)

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 --readregs

Why 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.

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.hex
Parsing 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 --eraseall
Erasing 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 --readregs
R0: 0x00000004
R1: 0x61000006
R2: 0x00027000
R3: 0x0002721F
R4: 0x20004F18
R5: 0x20004F24
R6: 0x00000000
R7: 0x20004F18
R8: 0x00000000
R9: 0x00000002
R10: 0x00000000
R11: 0x00000000
R12: 0x00000000
SP: 0x20005330
LR: 0xFFFFFFF9
PC: 0x0002721E
xPSR: 0x21000003
MSP: 0x20005330
PSP: 0x00000000
RAZ: 0x00000000
CFBP: 0x00000001
APSR: 0x20000000
EPSR: 0x01000000
IPSR: 0x00000003


C:\Users\admin>nrfjprog --memrd 0x10001014 --n 4
0x10001014: 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.

APPLICATION-

; *************************************************************
; *** Scatter-Loading Description File generated by uVision ***
; *************************************************************

LR_IROM1 0x00027000 0x00059000 { ; load region size_region
ER_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_region
ER_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)
}
}

Parents
  • Hello,

    The register readout show that a fault exception was raised. The likely reason for this is that you are using the ARM Clang compiler which is not compatible with this SDK. Please use ARM Compiler 5 and try again. This compiler is available in MDK-ARM version 5.25 

    (https://docs.nordicsemi.com/bundle/sdk_nrf5_v17.1.0/page/index.html)

    Best regards,

    Vidar

  • Hello Vidar, actually I want to use ARM Compiler 6, but I am facing an issue.
    When I manually write the UICR and then read the register, the value is read correctly, but I still get an error and BLE advertising does not start.

    C:\Users\admin>nrfjprog --memwr 0x10001014 --val 0x73000
    Parsing parameters.
    Writing.

    C:\Users\admin>nrfjprog --reset
    Applying system reset.
    Run.

    C:\Users\admin>nrfjprog --readregs
    R0: 0x0007321D
    R1: 0x00073215
    R2: 0x20000000
    R3: 0x00000417
    R4: 0x00000FFC
    R5: 0x0007E080
    R6: 0x10001000
    R7: 0x0007E000
    R8: 0x00000000
    R9: 0x00000000
    R10: 0x00000000
    R11: 0x00000000
    R12: 0x00000000
    SP: 0x00073214
    LR: 0x000004EF
    PC: 0x0007321C
    xPSR: 0x01000000
    MSP: 0x00073214
    PSP: 0x00000000
    RAZ: 0x00000000
    CFBP: 0x00000000
    APSR: 0x00000000
    EPSR: 0x01000000
    IPSR: 0x00000000

Reply
  • Hello Vidar, actually I want to use ARM Compiler 6, but I am facing an issue.
    When I manually write the UICR and then read the register, the value is read correctly, but I still get an error and BLE advertising does not start.

    C:\Users\admin>nrfjprog --memwr 0x10001014 --val 0x73000
    Parsing parameters.
    Writing.

    C:\Users\admin>nrfjprog --reset
    Applying system reset.
    Run.

    C:\Users\admin>nrfjprog --readregs
    R0: 0x0007321D
    R1: 0x00073215
    R2: 0x20000000
    R3: 0x00000417
    R4: 0x00000FFC
    R5: 0x0007E080
    R6: 0x10001000
    R7: 0x0007E000
    R8: 0x00000000
    R9: 0x00000000
    R10: 0x00000000
    R11: 0x00000000
    R12: 0x00000000
    SP: 0x00073214
    LR: 0x000004EF
    PC: 0x0007321C
    xPSR: 0x01000000
    MSP: 0x00073214
    PSP: 0x00000000
    RAZ: 0x00000000
    CFBP: 0x00000000
    APSR: 0x00000000
    EPSR: 0x01000000
    IPSR: 0x00000000

Children
Related