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

Working on dfu bootloader with ULINKplus, would not got to main() , stuck in WFE-B instruction

Hi

I am working with S130, sdk12.3 NRF51422_xxac

I have been successfully testing bootloader DFU example (secure_dfu_secure_dfu_ble_s130_pca10028) on the NRF51 dongle, Programming with J-LINK

however, to program my costume HW I am using arm ULINKplus,

I have used Ulink plus for application development without any issue, 

Problem is When I try to replicate the steps for bootloader from NRF 51 dongle + J-LINK, to my hardware

that is : full erase, program softdevice, program bootloader 

the software never reaches main() , but stuck on  WFE, B instruction cycle

again,, this did not happen with the NRF51 - J-LINK

I am following the exact same steps

I have succeeded implementing the same applications of both PCBs, I don't understand why the bootloader should be any different,

I have looked into the memory window to see the softdevice programmed, the app area erased, the bootloader area programmed

any insight would be much appreciated, 

Thanks !

Parents
  • on this thread https://devzone.nordicsemi.com/f/nordic-q-a/26300/how-to-use-nrfjprog-to-write-uicr-bootloaderaddr

     writes, that 

    in the 

    Nrf_bootloader_info.c, this synatx  :

    uint32_t m_uicr_bootloader_start_address __attribute__((at(NRF_UICR_BOOTLOADER_START_ADDRESS))) = BOOTLOADER_START_ADDR

    "ensures that the linker script will write the bootloader start address to the UICR register"

    I would appreciate some guiding on how to debug the linker script

  • Hi,

    I am not sure how you could debug the linker script, but you can check the result by for instance looking at the bootloader map file (search for 0x10001014 which is NRF_UICR_BOOTLOADER_START_ADDRESS) or hex file to see if it is included. I assume thins is OK though, and that the problem is with the configuration of the programmer.

    It might be that even if it is included in the .hex file your programmer does not know that the UICR is normal flash, and therefore does not know how to program it. Then you have to configure the programmer accordingly as suggested in this post that you linked to. This post describes how it can be done for the ULINKplus.

  • Thanks for your response Einar

    regarding the UICR Algorithm and the https://devzone.nordicsemi.com/f/nordic-q-a/9336/ulink-uicr-programming/34472#34472 thread

    It refers nrf52xxx_uicr.flm which I have found,

    HOWEVER I am using NR51

    Cant seem to find nrf51xxx_uicr.flm, on my installation folder or the web

    what can I do ? 

    also the keil - add flash programming algorithm doesn't allow browsing , if I would like to try nr52 algorithm.

    as for memory Map of the image  ...

    Im not sure if that's ok but that's what I found :

    Load Region LR$$.ARM.__AT_0x10001014 (Base: 0x10001014, Size: 0x00000004, Max: 0x00000004, ABSOLUTE)

    Execution Region ER$$.ARM.__AT_0x10001014 (Exec base: 0x10001014, Load base: 0x10001014, Size: 0x00000004, Max: 0x00000004, ABSOLUTE, UNINIT)

    Exec Addr Load Addr Size Type Attr Idx E Section Name Object

    0x10001014 0x10001014 0x00000004 Data RW 967 .ARM.__AT_0x10001014 nrf_bootloader_info.o

    Image Symbol Table ..

    m_uicr_bootloader_start_address          0x10001014   Data           4  nrf_bootloader_info.o(.ARM.__AT_0x10001014)

    .ARM.__AT_0x10001014                     0x10001014   Section        4  nrf_bootloader_info.o(.ARM.__AT_0x10001014)

  • Hi,

    You should find the nrf51xxx.flm where you have the DeviceFamily pack. (In my case it is located under C:\Keil_v5\ARM\Pack\NordicSemiconductor\nRF_DeviceFamilyPack\8.17.0\Flash\).

  • Hi Einar,

    I have managed to add nrf52xxx_uicr.flm as an algorithm ("Because both nrf51 and nrf52 have same NVMC interface and have same UICR config, I think this algorithm must be the same for nRF51. After you add this, you should be able to flash normally from Keil. Worth a try :)"  

    That did not seem to work :

    so is the solution to modify and create a new .flm file ? (another option that was suggested in the link)

    are there any more guides regarding how to do that ?

    Thanks !

  • update - managed to created the flash project based on that link and program the device, 

    I do get the 0x10001014 programmed as should be :) 

    However, I am still unable to get to main() during debug

    the system reaches SystemIinit() , than seems to reset to back to the 0x00006B0 address

    and than it resets at BX R3 , as R3 is 0x003AD25

    It seems that directing the program to addr 0x003AD25 (bx r3) brings that device to Hardfault

    any suggestions ?

    Thanks !

Reply
  • update - managed to created the flash project based on that link and program the device, 

    I do get the 0x10001014 programmed as should be :) 

    However, I am still unable to get to main() during debug

    the system reaches SystemIinit() , than seems to reset to back to the 0x00006B0 address

    and than it resets at BX R3 , as R3 is 0x003AD25

    It seems that directing the program to addr 0x003AD25 (bx r3) brings that device to Hardfault

    any suggestions ?

    Thanks !

Children
No Data
Related