This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Light_bulb example for 52840 Dongle

Please guide what changes are to be done for the Light bulb example to be run in 52840 Dongle?

I am using VS Code and built the Build Configuration using the Dongle configuration that was available.  Since the compilation gave this error, I updated the PWM Driver to the one mentioned in the DTS file. 

/* Use onboard led4 to act as a light bulb.
 * The app.overlay file has this at node label "pwm_led3" in /pwmleds.
 */
#define PWM_DK_LED4_NODE                DT_NODELABEL(blue_pwm_led)

It build fine and generates the .hex file.  However, after loading the hex file in the Dongle using the Programmer V2.0.0 the DFU loading is fine but upon completion it gives the below

12:29:13.049
Uploading image through SDFU: 99%
12:29:13.271
Uploading image through SDFU: 100%
12:29:13.421
All dfu images have been written to the target device
12:29:16.444
Failed to write: Timeout while waiting for device EF30A289B89F to be attached and enumerated

The dongle is not corrupted as I again again reset the same and reinstall. I have also loaded my earlier dongle firmware and it runs fine.  So the Dongle is fine.  Just need to check why is the above error after successful write?

  • Hi

    This is the expected behavior when flashing firmware onto an nRF52840 Dongle. After the DFU is completed, the board will reset and start running the application, which means the bootloader stops running and thus won't be detected correctly by the nRFConnect Programmer app until you put it back into bootloader mode (by pressing the side mounted button).

    Best regards,

    Simon

  • okay but the co-ordinator does not register with respect to this dongle any announcements, nor does wireshark register any messages.

    Also, can you please confirm whether the code change done for the PWM is the correct one for the dongle, or are there some other changes to be done in the overlay file?

  • Hi

    What light bulb example are you using exactly, the one for Bluetooth Mesh, Thread, or Zigbee? What SDK are you using, seems to be the nRFConnect SDK, but what version? You can check out our nRF52840 Dongle overview here for more information. You need to use switch the board configuration to use nrf52840dongle_nrf52840 instead of nrf52840DK_nrf52840.

    What pin have you set the PWM_DK_LED_4_NODE to use? I don't see a problem doing it like this as long as you refer to an available pin on the nRF52840 Dongle.

    Best regards,

    Simon

  • What light bulb example are you using exactly, the one for Bluetooth Mesh, Thread, or Zigbee?

    I am using the nrfConnect SDK 1.7.1.  It is the Light_bulb ZIgbee Example in VS Code.  I did use the build configuration of nrf52840dongle_nrf52840. It initially did not compile since the sample is for the DK board and it refers to the PWM drivers from the DK board. Hence, I had to change the following code.  It was initially using the pwm_led3 and I changed to the blue_pwm_led which is available in the .dts file.

    #define PWM_DK_LED4_NODE                DT_NODELABEL(blue_pwm_led)
    So the flashing was fine. But the dongle does not seem to emit any signals.  I also have the DK board, is there a way to debug the dongle with the DK board without needing the Jlink cable?
    Update: Actually I tried all other zigbee examples from SDK 1.7.1 and all flash well but none do reporting. I have tried with multiple dongle.  So there must be something on the zephyr's setting that should be changed?
  • Hi

    Yes, it's possible to flash the Dongle using a DK and the SWDIO and SWDCLK pins on the Dongle. You'll need to solder on some pin headers on SWDIO, SWDCLK, VDD and GND in order to be to connect the DK like the image below to the Dongle (custom board in the image):

    You can also check out our Dongle Programming tutorial for more information on how to connect it to DKs or other debuggers. Although the tutorial is for the nRF5 SDK the connection method is the same. 

    Just to make sure, the light_bulb example builds successfully when you use the nRF52840dongle_nrf52840 build configuration, right?

    Can you try building and flashing the example to the Dongle using the method described here with West and nrfutil?

    Best regards,

    Simon

Related