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

Porting exemples with Softdevice from PCA10056 to PCA10059

Hello


I notice that exemples with Softdevice (nRF5_SDK_for_Thread_and_Zigbee_v4.0.0_dc7186b) works fine for a PCA10056 but not on a PCA10059.

When I had tried to make this exemples works for a PCA10059 (following the instructions given here "https://devzone.nordicsemi.com/nordic/short-range-guides/b/getting-started/posts/nrf52840-dongle-programming-tutorial
" - replace BOARD_PCA10056 to BOARD_PCA10059 in preprocessor definitions), it never worked: once the device programmed (with nRF Connect), nothing happened (the dongle is not detected once plugged into a COM port (if I push on reset button it is detected but it stays in boot mode) )

Jørgen Holmefjord  confirmed me that there are a problem... This was his reply (ticket at devzone.nordicsemi.com/.../porting-ble_thread_dyn_mtd_coap_cli-from-pca10056-to-pca10059):
"I did a test with the latest SDK version, by changing BOARDS_PCA10056 to BOARDS_PCA10059, but I'm not able to run it on the dongle. It seems to run fine on the nRF52840 DK however. I think this is related to the lack of a UART port on the dongle, and/or GPIO config for LEDs and button(s). I will try to make a working version of the application for the dongle."

This is a very serious problem for my project: could you look at it?


Thank you very much

Parents
  • I also noticed that the softdevice overwrites the mbr ...

        

    Is it normal that the mbr is overwrited ?

  • MBR is already included in the SoftDevice, so you can remove the mbr .hex file if you use the softdevice.

    I couldn't use your first link. Can you please double check that it is the correct link?
    https://devzone.nordicsemi.com/nordic/short-range-guides/b/getting-started/posts/nrf52840-dongle

    As Jørgen said in your other ticket, you should change to the latest version of the Thread and Zigbee SDK.

    What example did you try to port to the dongle? Depending on what example it is, there may be a few issues:

    If it uses UART, as Jørgen said, the UART pins are not connected to anything, which may cause an application error.

    The reason it is not detected after you program it is probably because it doesn't use the USB. The main difference between the dongle and the DK is that the dongle doesn't have a programmer. It only has the USB peripheral (which would be equivalent to the USB contact on the long side of the DK, if you have seen one). So if your application doesn't actively use the USB peripheral on the nRF (which many examples does not), then it will not be detected after you program your custom application to it.

    As Jørgen said, I really suggest you get hold of a DK. The Dongle is really not intended for application development. It is really difficult to use it for this, as it doesn't have a programmer/debugger, and no log output, so you will be working blind. No form of feedback.

    Trust me, it is difficult enough for most people to develop using a Development Kit, which has these feedback possibilities.

  • Hello Edvin

    Thank you for your reply.


    I updated the link.

    I am now on the latest version of the Thread and Zigbee SDK (nRF5_SDK_for_Thread_and_Zigbee_v4.0.0_dc7186b) but I still have the same problem (like Jørgen ).

    I tested with several examples but the one that interests me especially is "ble_thread_dyn_mtd_coap_cli".

    Yes you have right : it's not detected because I don't use USB... So I would like to test using USB and disabling UART. But how to add USB ? (I compared the "thread_cli_ftd_usb_pca10056" and "thread_cli_ftd_uart_pca10056" examples to find how to use the USB but I think I forgot something because my dongle is still not detected)
    Here is what I did:
    - I excluded from build the uart files.
    - I added these files (and their headers): app_usbd.c, app_usbd_cdc_acm.c, app_usbd_core.c, app_usbdserial_num.c, app_usbd_string_desc.c, libopenthread-nrf52840-softdevice-sdk-usb.a, nrfx_systick.c, nrfx_usbd.c, nrf_drv_power.c, nrfx_power.c
    - In processor definissions, I added : USBD_POWER_DETECTION=1
    - And in the sdk_config file, I have enabled : NRFX_POWER_ENABLED, NRFX_USBD_ENABLED, POWER_ENABLED, USBD_ENABLED, APP_USBD_ENABLED, APP_USBD_CONFIG_EVENT_QUEUE_ENABLE, APP_USBD_STRING_ID_MANUFACTURER, APP_USBD_CDC_ACM_ENABLED


    In reality, I have 3 DK boards and 20 dongles. My application was completely developed on the DK but I would like to incorporate it into the dongles to simulate a Thread network and use my features (I don't need the UART on the dongles). So that's why I need to be able to operate the dongle with my app.

  • Please be aware of that even if the nRF Programmer application doesn't detect the device, it doesn't mean that the application is not running.

    You should try to run the application on your DK to see that it is behaving the way that you want it to. Please note that when doing this, you should look for all the USB data using the other USB port on the DK. This is the USB that is connected to the computer on the Dongle. This way you can debug the application to see whats going on, which you can't do on the dongle without attaching an external debugger.

    Did you try to include the libopenthread-nrf52840-sdk-usb.lib instead of the libopenthread-nrf52840-sdk.lib?

Reply
  • Please be aware of that even if the nRF Programmer application doesn't detect the device, it doesn't mean that the application is not running.

    You should try to run the application on your DK to see that it is behaving the way that you want it to. Please note that when doing this, you should look for all the USB data using the other USB port on the DK. This is the USB that is connected to the computer on the Dongle. This way you can debug the application to see whats going on, which you can't do on the dongle without attaching an external debugger.

    Did you try to include the libopenthread-nrf52840-sdk-usb.lib instead of the libopenthread-nrf52840-sdk.lib?

Children
  • Hi Edvin

    Yes, I included the libopenthread-nrf52840-sdk-usb.lib instead of the libopenthread-nrf52840-sdk.lib but I still have the problem.

    In reality, I wonder if there is not a problem of linker...

    I said that because it works correctly on a DK unless I use the bootloader (and I have the same problem on the dongle (probably) who also uses a bootloader). The problem I'm having is a HardFault after calling the "otInstanceInitSingle()" function in the "thread_init" function.

    For my tests, I programmed the pca10056 with the bootloader coming from the example "secure_bootloader_uart_mbr_pca10056_debug" and with the softdevice (s140_nrf52_7.0.1_softdevice.hex) and the "ble_thread_dyn_mtd_coap_cli_pca10056_S140" exemple.

    I noticed that in the flash_placement.xml file I have ("ble_thread_dyn_mtd_coap_cli_pca10056_S140" exemple):

      <MemorySegment name="ot_flash_data" start="0xfc000" size="0x4000">
        <ProgramSection alignment="4" keep="Yes" load="Yes" name=".ot_flash_data" address_symbol="__start_ot_flash_data" end_symbol="__stop_ot_flash_data" start = "0xfc000" size="0x4000" />
      </MemorySegment>


    This "start_ot_flash_data" address is 0xFC000. 
    But the range address of bootloader is 0xE4000 - 0xFE000 : is not that a problem?

    I tested by changing the "start_ot_flash_data" address to 0xF4000 but I still have the same problem…
    Do you think I need to change something else?

  • Perhaps the file doesn't take the bootloader into account. 0xF4000 and 0xFC000 are both inside the bootloader area.

    Perhaps you can try to move it outside the bootloader area? Assuming it needs 0x4000 bytes, try putting it in 0xE0000. Does that change the behavior? If not, I'll look into how the flash management is done in OT. I would be surprised if the SDK examples doesn't check for a bootloader.

    All the dongle projects (pca10059) in the SDK should do, perhaps you can compare how it is done there?

    The start address of the application is also something to consider. Normally you need to leave space for the MBR when you port examples to the dongle, but when you use the softdevice, the MBR is included there, so I don't think that is something you need to worry about in that particular project.

    BR,

    Edvin

  • I don't know why I wrote 0xFC000 for the start address...

    If I write 0xE0000 for the "start_ot_flash_data" address, it's works.

    Thank you very much.

Related