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

How do I program a nRF52840 Dongle with the thread CoAP example?

Hello,

I'm trying to program a nRF52840 Dongle with the thread MTD client example by using nRF Connect but I get an error 
saying I need to add a SoftDevice. I thought the thread examples didn't need a SoftDevice and when I try to add one 
it just overlaps the example's hex file.

Is it even possible to use the thread examples with the nRF52840 Dongle?

Thanks in advance,

Timo Jansen

  • Hello Timo, 

    You need to update the linker configuration so that the application does not overlap with the pre-programmed bootloader and MBR. If you are unsure how to do this, let me know what toolchain you use and I'll update the answer with instructions. 

  • Hello! Vidar, Berg i would love instructions.

    I have the latest version of nRF Connect and Segger with Thread&ZigBee 2.0 library and J-link.. The example for thread works just fine on 10056, but with 100059 i get the same error message and Timo Jansen on nRF Connect.


    I can compile the thread example for nRF DK with segger too, but for the dongle Segger gives "No j-link support" error".

    Thanks in advance.

  • Hello,

    The dongles do not have an OB segger so needs to be programmed through USB DFU using nrfutil or the programmer app in nrfconnect.

    I did a quick test with the cli example (nRF5_SDK_for_Thread_and_Zigbee_2.0.0_29775ac\examples\thread\cli\usb\). Below are the changes I made. Same approach should work for the other examples as well. 

    --- C:/vidar/workspace/nRF5_SDK_for_Thread_and_Zigbee_2.0.0_29775ac/examples/thread/cli/usb/pca10056/blank/flash_placement.xml	Sun Sep 23 18:48:47 2018
    +++ C:/vidar/workspace/nRF5_SDK_for_Thread_and_Zigbee_2.0.0_29775ac/examples/thread/cli/usb/pca10056/blank/ses/flash_placement.xml	Mon Oct  1 13:40:35 2018
    @@ -38,2 +38,2 @@
    -  <MemorySegment name="ot_flash_data" start="0x000fc000" size="0x4000">
    -    <ProgramSection alignment="4" keep="Yes" load="No" name=".ot_flash_data" address_symbol="__start_ot_flash_data" end_symbol="__stop_ot_flash_data" start = "0x000fc000" size="0x4000" />
    +  <MemorySegment name="ot_flash_data" start="0x000dc000" size="0x4000">
    +    <ProgramSection alignment="4" keep="Yes" load="No" name=".ot_flash_data" address_symbol="__start_ot_flash_data" end_symbol="__stop_ot_flash_data" start = "0x000dc000" size="0x4000" />
    

    --- C:/vidar/workspace/nRF5_SDK_for_Thread_and_Zigbee_2.0.0_29775ac/examples/thread/cli/usb/pca10056/blank/thread_cli_usb_pca10056.emProject	Sun Sep 23 18:48:47 2018
    +++ C:/vidar/workspace/nRF5_SDK_for_Thread_and_Zigbee_2.0.0_29775ac/examples/thread/cli/usb/pca10056/blank/ses/thread_cli_usb_pca10056.emProject	Mon Oct  1 13:39:25 2018
    @@ -29,2 +29,2 @@
    -      linker_section_placement_macros="FLASH_PH_START=0x0;FLASH_PH_SIZE=0x100000;RAM_PH_START=0x20000000;RAM_PH_SIZE=0x40000;FLASH_START=0x0;FLASH_SIZE=0xfc000;RAM_START=0x20000000;RAM_SIZE=0x40000"
    -      linker_section_placements_segments="FLASH RX 0x0 0x100000;RAM RWX 0x20000000 0x40000;ot_flash_data RX 0x000fc000 0x4000"
    +      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=0xdb000;RAM_START=0x20000008;RAM_SIZE=0x3FFF8"
    +      linker_section_placements_segments="FLASH RX 0x0 0x100000;RAM RWX 0x20000000 0x40000;ot_flash_data RX 0x000dc000 0x4000"
    
     

    CLI example with modified linker settings:

    thread_cli_usb_pca10056.hex

  • I made the changes to the files in the project you mentioned, changed the preprocessor definition from BOARD_PCA10056 to BOARD_PCA10059 rebuilt the project and then flashed it to the dongle. For some reason it does not work. I tried the hex file you included and it works fine. Is there any other change to the project I missed? I checked the flash layout for both files and I saw that for the App section, yours goes from 0x1000 to 0x47598 and the one I got goes from 0x1000 to 0x475B0

  • Please try the \nRF5_SDK_for_Thread_and_Zigbee_2.0.0_29775ac\examples\thread\cli\usb_bootloader example without modifying anything (ie you can change the board define but is not necessary) . The usb_bootloader variant is configured to run with the pre-programmed bootloader. I was not aware of this when I wrote the previous reply. 

    mrc74 said:
    I checked the flash layout for both files and I saw that for the App section, yours goes from 0x1000 to 0x47598 and the one I got goes from 0x1000 to 0x475B0

     We are probably using  different version compiler versions, or optimization settings. I don't think the minor size difference is related to the issue. 

Related