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

Trying to convert my NRF52840 DK project to run on the NRF52840 Dongle

Win10 + Segger embedded studio

I can get the pca10059 blinky example to work. (C:\nRF5_SDK_15.3.0_59ac345\examples\peripheral\blinky ) 

I use the NRF connect Programmer app to upload the hex file. 

I decided to convert my existing project to run on the dongle by following the instructions on this page https://devzone.nordicsemi.com/nordic/short-range-guides/b/getting-started/posts/nrf52840-dongle-programming-tutorial . I also commenting out my code and pasted the blinky code just to get something recognisable.

I upload hex files for my application and I also needed to upload the hex file for the soft device (C:\nRF5_SDK_15.3.0_59ac345\components\softdevice\s140\hex\s140_nrf52_6.1.1_softdevice.hex)

It doesn't work.

When I add the hex for the soft device I see this

LEFT side

Red is the bootloader, hover text says address range E0000 - FE0000

Lime green is Blinky app and hover text says address range 1000 - 171C

Orange is MBR 0-1000 (4096 size)

RIGHT side

blue is soft device NRF52 s140 6.1.1 0x1000 - 0x25DE8

Orange is "MBR or Application" and shows 0x0-0xB00

When I add the release mode hex file from building the project I see

I add the softdevice first and then the application hex.

I started looking for differences between the stuff in C:\nRF5_SDK_15.3.0_59ac345\examples\peripheral\blinky and my project.

I notice that FLASH_SIZE is different in the emProject files.

C:\nRF5_SDK_15.3.0_59ac345\examples\peripheral\blinky\pca10059\mbr\ses\blinky_pca10059_mbr.emProject

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=0xff000;RAM_START=0x20000008;RAM_SIZE=0x3fff8"

Values in my project (from dongle programming tutorial.)

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"

When I change my project to use FLASH_SIZE = FF000

I see this

Different, but still not right.

I also see  debug_additional_load_file="../../../../../../components/softdevice/mbr/nrf52840/hex/mbr_nrf52_2.4.1_mbr.hex" in the blinky example but 

debug_additional_load_file="../../../../../../components/softdevice/s140/hex/s140_nrf52_6.1.1_softdevice.hex" in my project. 

I cant see how to add the MBR.hex to my project. It looks like this.

The other file that seems relevant is flash_placement.xml and I see a host of differences but mostly just extra sections in my project for ble things 

I'm a bit stuck. Any help is appreciated. 

-Jason

Parents
  • It's a classic mistake when staring out with Nordic, and you've almost solved it already.
    The examples in "sdk/examples/peripheral" are not set up to use the SoftDevice, whereas the examples in "sdk/examples/ble_*" are.

    The SoftDevice is placed at the bottom of flash and forwards interrupts to the applications vector table, often placed at 0x26000, on top of the SoftDevice. You will also need to set the start address and size of the application's RAM as the SoftDevice has a dedicated space at the bottom of RAM. 

    If you copy the ble_app_blinky example from "sdk/examples/ble_peripheral/" and swap out the main.c file and necessary libraries with the blinky example from "sdk/example/peripheral/" you should be able to run the blinky example with SoftDevice flashed, as the ble examples have everything set up already. 

  • I've just found this guide which looks like what I needed. I had the wrong RAM_START 0x20001628

    https://devzone.nordicsemi.com/nordic/short-range-guides/b/getting-started/posts/adjustment-of-ram-and-flash-memory

    And when I tried to run my changes I noticed that the Programmer app was marked as having an upgrade available. Which I installed. But now it says "The app only supports NRF connect 3.2.0 which does not match your currently installed version"

    oops.. I guess if I wait a few mins then this update will appear as well? Maybe I should make dinner

    thanks for your help

Reply Children
No Data
Related