Can't flash custom board via nRF52840DK in VS Code

Good Day.

I have two identical custom boards that I want to flash the Blinky example into.

The strange thing is that both boards are flashed without problems (writes that the flash was successful) via VS Code, but on one board the LED blinks and on the other board it doesn't (the pin is constantly 1.4V). But when I flash both boards in Segger Embedded Studio, both work without problems and the LEDs blink.

It means that the circuit is correct (all pins are in order) and the programmer is in good working order.

But then what could be the problem?

Perhaps someone has encountered a similar problem?

Thanks. 

  • Hi,

     

    Q1: Have you tried entering debug mode and see where it's stuck?

    Q2: Could this be a problem with the external LF clk?

    Can you try to set "CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y" and see if the other board boots up as expected?

     

    Kind regards,

    Håkon

  • Thank you Hakon for your response. My board won't enter debug mode. Here is the output from the debug console.

    JLinkGDBServerCL: SEGGER J-Link GDB Server V7.88a Command Line Version
    JLinkGDBServerCL: 
    JLinkGDBServerCL: JLinkARM.dll V7.88a (DLL compiled May  3 2023 14:37:59)
    JLinkGDBServerCL: 
    JLinkGDBServerCL: -----GDB Server start settings-----
    JLinkGDBServerCL: GDBInit file:                  none
    JLinkGDBServerCL: GDB Server Listening port:     52792
    JLinkGDBServerCL: SWO raw output listening port: 2332
    JLinkGDBServerCL: Terminal I/O port:             2333
    JLinkGDBServerCL: Accept remote connection:      localhost only
    JLinkGDBServerCL: Generate logfile:              off
    JLinkGDBServerCL: Verify download:               off
    JLinkGDBServerCL: Init regs on start:            off
    JLinkGDBServerCL: Silent mode:                   on
    JLinkGDBServerCL: Single run mode:               on
    JLinkGDBServerCL: Target connection timeout:     0 ms
    JLinkGDBServerCL: ------J-Link related settings------
    JLinkGDBServerCL: J-Link Host interface:         USB
    JLinkGDBServerCL: J-Link script:                 none
    JLinkGDBServerCL: J-Link settings file:          none
    JLinkGDBServerCL: ------Target related settings------
    JLinkGDBServerCL: Target device:                 nRF52840_xxAA
    JLinkGDBServerCL: Target device parameters:      none
    JLinkGDBServerCL: Target interface:              SWD
    JLinkGDBServerCL: Target interface speed:        12000kHz
    JLinkGDBServerCL: Target endian:                 little
    JLinkGDBServerCL: 
    =thread-group-added,id="i1"
    =cmd-param-changed,param="pagination",value="off"
    z_arm_reset () at C:/nordicsemi/v2.2.0/zephyr/arch/arm/core/aarch32/cortex_m\reset.S:73
    73	    movs.n r0, #0
    [New Remote target]
    

  • But after adding CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
    my board worked.

    What does it mean?

    Do I have a 32 kHz crystal soldered on my board that doesn't work?

  • Hi,

     

    backstreet.devisor said:
    Do I have a 32 kHz crystal soldered on my board that doesn't work?

    Effectively; yes.

     

    It is either loaded incorrectly or similar, making it not resonate properly.

    Check for shorts on the lines in question and do a visual inspection to see if anything is out-of-the-ordinary.

     

    Kind regards,

    Håkon

  • Thank you for your help. Yes, the crystal failed. I replaced it and everything worked properly.

    Can you please tell me, Hakon, how to make it start immediately after downloading the firmware to my custom board via nrf52840DK? Because now when I download the firmware via VS Code I have to power off and on and only then my board starts working. And when I load the program in SES my board starts immediately without rebooting.

Related