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?

Parents
  • Hi again

    Okay, I think what's causing this is that the Zigbee network data is stored in the flash memory of the nRF52840 by default, and since the Dongle doesn't have the opportunity to erase the flash (since the bootloader is needed to program application onto it), this network data is left in the memory and will cause problems when flashing new Zigbee applications onto the Dongle. So I think the application you flash onto the Dongle the first time is working as intended, but the Dongle not really being designed as a development tool is hindering you.

    You can try flashing the attached .hex file onto the Dongles before flashing a new Zigbee application onto them. It should erase everything between MBR and the bootloader addresses and start the standard blinky application once it's done (so don't disconnect the Dongle until it starts blinking). After that you should be able to flash the Zigbee application you want again onto your Dongle(s).

    clear_flash.hex

    If you are to do development I would strongly recommend using an nRF52840 DK instead, which is much better for flashing application code multiple times and debugging, since it has its own on board programmer/debugger.

    By the way, are you using a DK to recover the Dongle you're not able to get working, or are you using some other debugging device to try and recover it?

    Best regards,

    Simon

  • Great!  This clear_flash.hex is working!  After flashing this, I reflash my code and they show up in Z2M fine now.  I guess everytime I need to flash new image, I should clear with clear_flash.hex.   Is there a "merged" .hex I can create or the source code / configuration for this clear_flash so that I can include in my application?

    I do the development using DK. However, even for writing a image second time in dongle, it was a problem. Thankfully this is resolved. You might want to consider putting this in the standard dongle programming documentation. I believe that documentation still refers to SEGGER platform, one is needed for VSCode as well, especially since VSCode can be lauched via the standard nrfConnect program

    On the dongle that was "corrupted", I haven't tried recovering it.  I shall re-try the connections again and see if it solves. However, have also order the Jlink for easier debugging in future.

    Thanks.  will revert in case there are more issues with dongle

  • Hi again

    Unfortunately merging this .hex won't do much good I'm afraid, as we can't make sure that the erase will occur before starting the Zigbee transmissions. I can't give you the source code either, as writing to the wrong address will erase the bootloader as well, and the Dongle will be even tougher to recover. 

    We're working on updates to blog posts and tutorials continuously and we will probably make an updated version of the Dongle programming tutorial as well at some point, although the general idea stays the same for VS code as well.

    Best regards,

    Simon

Reply
  • Hi again

    Unfortunately merging this .hex won't do much good I'm afraid, as we can't make sure that the erase will occur before starting the Zigbee transmissions. I can't give you the source code either, as writing to the wrong address will erase the bootloader as well, and the Dongle will be even tougher to recover. 

    We're working on updates to blog posts and tutorials continuously and we will probably make an updated version of the Dongle programming tutorial as well at some point, although the general idea stays the same for VS code as well.

    Best regards,

    Simon

Children
No Data
Related