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?

  • 1. okay will try the pin connection - so this setup will allow me the debug the image flashed on the dongle?

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

    2. Yes, the the example builds fine and generates a merged.hex which can also be flashed.  In fact i tested with only change of that PWM led and nothing else.  Can you test from your side as well?  Are there any additional setting to be done? This is not a problem with Zephyr as the blinky code runs fine on the dongle, so it must be zigbee

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

    3. I could run via command prompt, but when I run the VS Code, the same commands are executed. How will this be different?  Please do check on the #2 and let us know if there are any additional settings to be changed KConfig maybe for flashing onto dongle?

  • 1. Yes, if you connect the Dongle as the custom board to the DK as shown in the image in my previous reply (and the Dongle operates at 3V) you should be able to debug the Dongle using the DK. If it runs at a lower voltage, our DK is not capable of debugging it and you'll need a compatible J-Link device.

    2. After double checking with one of my colleagues it seems like the Zigbee examples for the nRF52840 Dongle is not officially supported, check out Marte's suggestion for how to add Dongle support to an example not already supporting it here.

    3. This was more a suggestion if you for some reason weren't able to build the project correctly in VS code, as I imagined that could be the case, but it seems that's not it.

    Best regards,

    Simon

  • Yes, if you connect the Dongle as the custom board to the DK as shown in the image in my previous reply (and the Dongle operates at 3V) you should be able to debug the Dongle using the DK

    Well, I made all the connections properly and after this connections, the dongle is no longer operating. I guess the voltage is not 1.8v and hence no longer booting up? Can you double check the suggestion about the connectivity you gave above.  To all who are following this thread, DO NOT do the connection as suggested earlier, at least until this is clarified

    es, 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):

    The Marte's suggestion actually worked. so the dongle (another dongle, not the one from above) is sending the data to zigbee2mqtt now.  However, only the first time. I removed the dongle and connected again to usb - the LED still flash (indicating it is working) but it is no longer sending the data again.  The dongle is still flash-able repeatedly, so it is still working  :-)

    Any suggestions?

  • Hi

    Can you show me a picture of how the Dongle is connected to your DK? Does it no longer work at all when you power it again? What might have happened is that the UICR has been erased for some reason, and you need to do as Einar explains in the Dongle Programming tutorial

    After the other Dongle has been flashed successfully and reset, does the LED blink as it should when transmitting data to the Zigbee2MQTT device? How do you determine that it doesn't send data anymore?

    Best regards,

    Simon

  • After the other Dongle has been flashed successfully and reset, does the LED blink as it should when transmitting data to the Zigbee2MQTT device? How do you determine that it doesn't send data anymore?

    There is no LED blinking.  Also I verified through the sniffer.  It is strange that I have 3 dongle, all sent a device announcement to zigbee2mqtt the first time it was flashed and by making small tweak like change of just a manf name and flashing it back does not send the message. Yes, I also re-flashed the same hex that was working earlier and it still does not annouce to zigbee 2mqtt.

    Is there a "blank" zigbee code available for the dongle, which does nothing but just send a general attributes to check whats wrong?

Related