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

nRF51822 mbed - Use mbed on a nrf51822 breakout board

Hi all, I'm designing my own breakout board for nrf51822 and want to use the mbed platform for it. I was able to make the board work with a very simple, blinking-LED program. However, i run into some issues while using the Heart Rate example in mbed.

  • First of all, when i flashed the combined hex file into the chip using Ulink2 debugger. The program wouldn't run at all. The prog would stop right at the beginning (address 0x0). I think it's supposed to start at address 0x14000 according to the scatter-loading file included in the project file.

  • Then, i tried to download the softdevice seperately at address 0x0, then downloaded the application hex code into another region (starting from 0x14000). This approach actually works 'partially' :(. The prog would run and halt at sd_softdevice_enable() function, which is used to set up LFCLK source and enable soft device. It throws an Hard_fault exception. Checking the LFCLK souce, it's already initialized and started.

I have no idea what is going wrong here. Should the way i used to flash the chip have anything to do with this? Besides, how can i use the combined hex file? i couldn't make it work by just downloading this hex file into the chip.

Parents
  • So, i did more research and found out that the softdevice may need to write to UICR register to define the code region 0 as well as it's firmware version (register CLENR0 and FWID). These 2 registers are in address 0x10001000 and 0x10001010. When i tried to flash the Softdevice seperately using the Ulink2 debugger, i got these messages:

    No Algorithm found for: 10001000H - 10001013H Partial Erase Done (areas with no algorithms skipped!)

    I extended the address range for flash algorithm so i could cover this aforementioned range as well. But i coulnd't get it to work. The flash process failed. I found on Nordic uicr_config document that i'd need a dedicate target driver to write to this UICR register. This driver comes with nrfjprog.exe cmd line tool. The problem is this driver only works with Segger debugger. Is there any other driver out there that works with Ulink 2 debugger? Or any other approach? Any help would be appreciated. Thanks

    Hoang

Reply
  • So, i did more research and found out that the softdevice may need to write to UICR register to define the code region 0 as well as it's firmware version (register CLENR0 and FWID). These 2 registers are in address 0x10001000 and 0x10001010. When i tried to flash the Softdevice seperately using the Ulink2 debugger, i got these messages:

    No Algorithm found for: 10001000H - 10001013H Partial Erase Done (areas with no algorithms skipped!)

    I extended the address range for flash algorithm so i could cover this aforementioned range as well. But i coulnd't get it to work. The flash process failed. I found on Nordic uicr_config document that i'd need a dedicate target driver to write to this UICR register. This driver comes with nrfjprog.exe cmd line tool. The problem is this driver only works with Segger debugger. Is there any other driver out there that works with Ulink 2 debugger? Or any other approach? Any help would be appreciated. Thanks

    Hoang

Children
No Data
Related