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

Adapting the blinky example from the nRF52840 DK to the nRF52840 dongle

I tried to follow this guide:

https://devzone.nordicsemi.com/tutorials/b/getting-started/posts/nrf52840-dongle-programming-tutorial?CommentId=fd959c7d-2374-443a-8af7-b4d4f0d35228

To prove the concept of adapting SDK examples from the nRF52840 DK to the nRF52840 dongle.

I am using SEGGER EmStudio 4.12 and I tried either using a nRF52840 DK with a Tag.Connect.com cable assembly connected to the Debug out of this board or the nRFConnect Programmer to program the nRF52840 Dongle.

So, if I understood correctly, we can open the blinky project example of the SDK for the nRF52840 DK located at

SDK_dir/examples/peripheral/blinky/pca10056/mbr/ses/blinky_pca10056_mbr.emProject

Modify some definitions on this project and then program the nRF52840 Dongle, and have the same result as if we opened the project for the Dongle, located at

SDK_dir/examples/peripheral/blinky/pca10059/mbr/ses/blinky_pca10059_mbr.emProject

So these are the fields I modified of the blinky_pca10056_mbr.emProject

c_preprocessor_definitions="BOARD_PCA10059;BSP_DEFINES_ONLY;CONFIG_GPIO_AS_PINRESET;FLOAT_ABI_HARD;INITIALIZE_USER_SECTIONS;NO_VTOR_CONFIG;NRF52840_XXAA;"

linker_section_placement_macros="FLASH_PH_START=0x0;FLASH_PH_SIZE=0x100000;RAM_PH_START=0x20000000;RAM_PH_SIZE=0x40000;FLASH_START=0x1000;FLASH_SIZE=0xdf000;RAM_START=0x20000008;RAM_SIZE=0x3fff8"

The only fields I had to modify were BOARD_PCA10056 to BOARD_PCA10059 and FLASH_SIZE=0xff000 to FLASH_SIZE=0xdf000.

Then I tried to build and run the program on the Dongle but the board just freezes and doesn't do anything. Segger says download successful and nRFConnect says DFU for Application completed successfully!

If I use the blinky project example designed for the dongle it works and I can change the frequency of the LED switching.

What am I missing? Thanks

Parents Reply
  • So, I've successfully connected a J-Link pro debugger to the dongle, programmed it with the blink project example intended for this board and was able to add a breakpoint and stop/go over it normally.

    When I made the modifications to the blink project for the PLA10056 that were recommended in the guide, the board was also programmed successfully and I could debug it normally, but the LEDs didn't light up as they should, instead they were turned off always.

    I put a breakpoint in the line that switched the LEDs on and off inside the for loop and that breakpoint was reached consecutively as expected. So now I suspect that somehow the LEDs are not mapped correctly when switching board definitions in the c_preprocessor_definitions of the PLA10056 project.

    Ideas?

Children
Related