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

Program nrf52840 dongle failed

Hi Nordic team

I have successfully programmed my PCA10056 for example light-switch and they running well. Right now I wang program my PCA10059 for a server of example light-switch. But it failed, although I can programmed PCA10059 by  a blink example for PCA10059.

The server code of light-switch example have been modified to match the PCA10059  (account to the way from here) and set up my Segger Embedded Stuido like here. the project have been built successfully.

When I program my pca10059, I get error below.Actually, I do not know if the PCA10059 have been programmed successfully.After the programming ,The PCA10059 disconnect with PC and do not do anything untill it be reset again and go a state which  red led flash.  It is quite clear that the server code do not running.

Is there some one can help me to solute them.

Thanks,

B,Rs,

Di-sheng

Parents
  • Hello Di-sheng,

     

    When I program my pca10059, I get error below.Actually, I do not know if the PCA10059 have been programmed successfully

     The messages you get there saying that you it can't find the device will come unless the application uses the USB peripheral on the nRF52840 dongle.

    I don't know what your application does, or how it controls the LEDs, but remember that one of the application LEDs is the red one. Are you sure your application doesn't turn that on?

    What sort of light switch example do you refer to? Does it use the softdevice (and did you remember to program the softdevice?), or is it the Zigbee light switch?

    There are many possibilities for why you don't see any advertisements (if BLE). Perhaps the application crashes before it starts advertising? Do you use UART in your application? If so, have you grounded the RX pin?

  • Hi Edvin

    I just had a question. I was able to successfully program the BLINKY example for DONGLE and it worked fine, but I couldn't successfully get the server code for the light-switch example to run on DONGLE. Is this because the blinky example does not require a soft device and the server program does?

    If the answer is yes. I have few question below.

    1. After a project be built in Segger Embedded Stuido, the soft device, Whether the soft device has been added to HEX? Because when I program code to PCA10056 , it do not need a extra soft device's hex. So I think the soft device's hex have been add to the hex of project. Is it ture or not.

    2. I want program a HEX file of project which need soft device and be built in SES to Dongle by Programmer tools, whether a soft device's hex need.

    3. If I need add a soft device with project's hex ,when I program the dongle by Programmer tools, if I need merge them by mergehex tools or I just add the soft device's hex and project's hex to Programmer tools?

    Thanks,

    Dison 

  • If you usually use Segger Embedded Studio to program your DKs, the Softdevice is automatically added. If you go to your project settings in SES -> Debug -> Loader, you can see that it links the softdevice under "Additional Load File[0]".

    If you program using nRF Connect for Desktop -> Programmer, it doesn't automatically add the softdevice. 

    1: I think that answers question 1.

    2: Yes. You need to manually add the softdevice if your application requires it. And if it is an example from the Mesh SDK, it does indeed require the softdevice.

    3: Well, it is possible to merge the two hexfiles using the mergehex tool (part of nrfjprog / nRF Command Line Tools. command: "mergehex -m file1.hex file2.hex -o mergedhex.hex".

    Alternatively, just drag and drop the softdevice from the SDK into nRF programmer, together with your application file, and it will program both the application and the softdevice.

    The softdevice is located in: SDK16\components\softdevice\s140\hex\s140_nrf52_7.0.1_softdevice.hex (use the SDK that you use together with the mesh SDK to get the compatible softdevice version).

    Best regards,

    Edvin

Reply
  • If you usually use Segger Embedded Studio to program your DKs, the Softdevice is automatically added. If you go to your project settings in SES -> Debug -> Loader, you can see that it links the softdevice under "Additional Load File[0]".

    If you program using nRF Connect for Desktop -> Programmer, it doesn't automatically add the softdevice. 

    1: I think that answers question 1.

    2: Yes. You need to manually add the softdevice if your application requires it. And if it is an example from the Mesh SDK, it does indeed require the softdevice.

    3: Well, it is possible to merge the two hexfiles using the mergehex tool (part of nrfjprog / nRF Command Line Tools. command: "mergehex -m file1.hex file2.hex -o mergedhex.hex".

    Alternatively, just drag and drop the softdevice from the SDK into nRF programmer, together with your application file, and it will program both the application and the softdevice.

    The softdevice is located in: SDK16\components\softdevice\s140\hex\s140_nrf52_7.0.1_softdevice.hex (use the SDK that you use together with the mesh SDK to get the compatible softdevice version).

    Best regards,

    Edvin

Children
  • Hi Edvin

    Thanks for your reply, It is very good for me.

    From your reply, I have some understanding, you can see if it is right.

    1. There are no soft devices code in the hex file generated by SES for the building of the project

    2. The addition of soft devices is a simple merge. The address of the soft device is an absolute address, so SES will replace the calling address of the soft device in the project with some absolute addresses for the building of the project.

    However, my situation today when I merge the hex file for the application project and hex for the soft device did not seem to support my understanding.

    Below is the problem I encountered when attempting to add soft devices.

    1. Use mergehex command to merge the "s140_nrf52_7.0.1_softdevice.hex" and "light_switch_server_nrf52840_xxAA_s140_7.0.1.hex" which is modified for PCA10059.

    The result showed me they are conflict.

    2. Use Programmer to add 2 hex files for flashing chips

    The result is same. The black bar shows that the two hex files do overlap.

    I have a few questions below about this outcome.

    Q1: Since SES did not add soft devices to the project building (because the soft device is added after project building), how did the project be compiled and linked?

    Q2: Why can SES add hex of soft equipment to hex of the project without conflict, and write it correctly to PCA10056? But I use SES of the same environment (in SES, I have made corresponding changes to the project Settings, see the last reply) and hex of the project building has conflict with the soft  device.

    Q3: What should I do to resolve this conflict?

    Q4: When I used the bluetooth Mesh, I found two soft device files, one in the nRF5_SDK_16.0.0 (nRF5_SDK_16.0.0_98a08e2.zip\components\softdevice\s140) and the other in the nRF5_SDK_for_Mesh_v4.0.0_src(nrf5_SDK_for_Mesh_v4.0.0_src.zip\bin\softdevice), are they the same?

    Thanks,

    B,Rs

    Di-sheng

     

  • A1. The softdevice is a precompiled binary, so it doesn't need to be linked to the application. It is the header files for the softdevice that you have included in your application that tells the application what to do with calls to the softdevice (SVCALL).

    A2. You probably have something wrong in your flash settings in your application for the nRF52840 dongle. Please compare the flash settings for pca10056 and 10059:

    A3. See A2.

    A4. Good point, I didn't realize that the Mesh SDK contained so many versions of the softdevice. You would want to use the same version as you use in the pca10056 application, which looks like it is 7.0.1 version of S140. Use the same version in your pca10059 project (when you program using nRF Connect->Programmer.

  • Hi Edvin

    It works.

    For this reason, as you remind me, I should not blindly follow the Dongle tutorial to modify " Linker-->Section Placement Macros ". When I change it back, every thing works.

    Thanks,

    B.Rs,

    Di-sheng

Related