Steps to program nRF52840 Dongle with Mesh Serial Example

I have

Hardware:
nRF52840 DK - 1
nRF52840 Dongle - 1

Software:
nRF5 SDK Mesh - v5.0.0
nRF5 SDK - v17.0.2


I want to program Mesh Serial example on nRF52840 Dongle.When I try to cocnvert the program for PCA10059 chipset , it gives me an error
as UART pins are not defined.
Then I defined the UART pins for PCA10059 in pca10059.h file as follows:

#define RX_PIN_NUMBER  13
#define TX_PIN_NUMBER  15
#define CTS_PIN_NUMBER 17
#define RTS_PIN_NUMBER 21
#define HWFC           true


After defining and flashing the program to the Dongle using DK , I did'nt get any output.Then, I try to connect that Dongle using my DK , SWD pins
, it won't detect it.In nRF Connect for Desktop , it shows only the J-Link is connected and gives the following error:

12:49:44.939	Unsupported device. The detected device could not be recognized as neither JLink device nor Nordic USB device.
12:49:46.946	Target device closed
12:49:54.784	Unsupported device. The detected device could not be recognized as neither JLink device nor Nordic USB device.


I think I damaged the chip , by flashing that program.Can you tell me , what is wrong in these steps?
If you know any other methods to flash Mesh Serial program to Dongle, please explain..

Thankyou.

-Vicky

Parents
  • Hi,

    There are some pitfalls and caveats when working with the Dongle, in particular if programming it using a programmer such as the one on a DK. Please have a look at the Using an external debugger sections of our nRF52840 Dongle Programming Tutorial.

    Most importantly, VDD configuration is cruical for being able to program the Dongle using a DK. See Recover after an accidental UICR erase (in the same tutorial.)

    Regards,
    Terje

  • Hi,
    I have modified my Dongle to work with External power supply by cutting SB2 and soldering SB1.As the new versions of SDK have
    REGOUT0 set for 3V for PCA10059 boards, I don't have to change it manually.The below code explains that.

    Code location : C:\Nordic_Semi\nRF5_SDK_17.0.2_d674dde\components\boards\boards.c

    #if defined(BOARD_PCA10059)
    /**
     * Function for configuring UICR_REGOUT0 register
     * to set GPIO output voltage to 3.0V.
     */
    static void gpio_output_voltage_setup(void)
    {
        // Configure UICR_REGOUT0 register only if it is set to default value.
        if ((NRF_UICR->REGOUT0 & UICR_REGOUT0_VOUT_Msk) ==
            (UICR_REGOUT0_VOUT_DEFAULT << UICR_REGOUT0_VOUT_Pos))
        {
            NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Wen;
            while (NRF_NVMC->READY == NVMC_READY_READY_Busy){}
    
            NRF_UICR->REGOUT0 = (NRF_UICR->REGOUT0 & ~((uint32_t)UICR_REGOUT0_VOUT_Msk)) |
                                (UICR_REGOUT0_VOUT_3V0 << UICR_REGOUT0_VOUT_Pos);
    
            NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Ren;
            while (NRF_NVMC->READY == NVMC_READY_READY_Busy){}
    
            // System reset is needed to update UICR registers.
            NVIC_SystemReset();
        }
    }
    #endif

    After following the above steps also, I won't be able to program my Dongle using my DK through SWD.I don't know what will be the problem.

    My Questions:
    1)Is my board permanently gets damaged?
    2)In the definition of UART pins for PCA10059

    #define RTS_PIN_NUMBER 21 // Mistakekenly defined PIN 21 instead of PIN 21


    But, PIN 21 is not given as an GPIO pin for Dongle board.PIN 20 is the GPIO pin.I mistakenly changed the PIN 20 to PIN 21.
    Does, this crashed my Dongle?
    3)I have another Dongle which works perfectly.If I try to configure UART pins for that Dongle, which PINs I have to use
    to make the board work perfectly without any defect?

    Please reply as soon as possible.
    Thankyou.

    -Vicky

Reply
  • Hi,
    I have modified my Dongle to work with External power supply by cutting SB2 and soldering SB1.As the new versions of SDK have
    REGOUT0 set for 3V for PCA10059 boards, I don't have to change it manually.The below code explains that.

    Code location : C:\Nordic_Semi\nRF5_SDK_17.0.2_d674dde\components\boards\boards.c

    #if defined(BOARD_PCA10059)
    /**
     * Function for configuring UICR_REGOUT0 register
     * to set GPIO output voltage to 3.0V.
     */
    static void gpio_output_voltage_setup(void)
    {
        // Configure UICR_REGOUT0 register only if it is set to default value.
        if ((NRF_UICR->REGOUT0 & UICR_REGOUT0_VOUT_Msk) ==
            (UICR_REGOUT0_VOUT_DEFAULT << UICR_REGOUT0_VOUT_Pos))
        {
            NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Wen;
            while (NRF_NVMC->READY == NVMC_READY_READY_Busy){}
    
            NRF_UICR->REGOUT0 = (NRF_UICR->REGOUT0 & ~((uint32_t)UICR_REGOUT0_VOUT_Msk)) |
                                (UICR_REGOUT0_VOUT_3V0 << UICR_REGOUT0_VOUT_Pos);
    
            NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Ren;
            while (NRF_NVMC->READY == NVMC_READY_READY_Busy){}
    
            // System reset is needed to update UICR registers.
            NVIC_SystemReset();
        }
    }
    #endif

    After following the above steps also, I won't be able to program my Dongle using my DK through SWD.I don't know what will be the problem.

    My Questions:
    1)Is my board permanently gets damaged?
    2)In the definition of UART pins for PCA10059

    #define RTS_PIN_NUMBER 21 // Mistakekenly defined PIN 21 instead of PIN 21


    But, PIN 21 is not given as an GPIO pin for Dongle board.PIN 20 is the GPIO pin.I mistakenly changed the PIN 20 to PIN 21.
    Does, this crashed my Dongle?
    3)I have another Dongle which works perfectly.If I try to configure UART pins for that Dongle, which PINs I have to use
    to make the board work perfectly without any defect?

    Please reply as soon as possible.
    Thankyou.

    -Vicky

Children
  • Hi,

    I am sorry for the delay.

    Vicky7797 said:
    1)Is my board permanently gets damaged?

    It may be permanently damaged if both SB1 and SB2 are connected at the same time, and the board is powered. That is, if you solder SB1 without cutting SB2 and then power the board. I am not a hardware expert, but my understanding is you would get currents where you do not want currents and those currents will damage the hardware.

    Vicky7797 said:
    But, PIN 21 is not given as an GPIO pin for Dongle board.PIN 20 is the GPIO pin.I mistakenly changed the PIN 20 to PIN 21.
    Does, this crashed my Dongle?

    UART on the nRF52840 Dongle requires that you connect to the pins configured for UART, in order to communicate. UART does not get bridged through USB on the nRF52840 Dongle, as there is no interface MCU or other USB to UART bridge. Configuring the wrong GPIO pins as UART pins does not damage the Dongle, but the application may not work. Programming the Dongle with an application with the correct UART pin configurations should work. You should then be able to use the UART with the new pin configuration.

    Vicky7797 said:
    3)I have another Dongle which works perfectly.If I try to configure UART pins for that Dongle, which PINs I have to use
    to make the board work perfectly without any defect?

    It depends on which pins you want to use for the UART communication / how you connect to the pads on the Dongle. If you configure the same pins in the application as you connect to and the signal is not driven outside the VSS to VDD range, then it should work. Connecting higher voltage levels than VDD to GPIO pins could potentially damage the device.

    Regards,
    Terje

Related