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. 

Parents
  • 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]
    

  • Hi Hakon. 

    Yes, this is really weird. I'm using a connection like the one in the picture with the board (I don't have the 10-pin version). With a connection like mine, does your custom board start right after programming?

    Thanks.

  • Hi,

     

    Could you try the following?

    If you issue "nrfjprog --debugreset" and the board runs as expected afterwards; then it is due to the reset procedure during programming.

     

    Kind regards,

    Håkon

  • Thank you Hakon for continuing to help me.
    After entering the command "nrfjprog --debugreset" in the terminal, my board started up without a power reset.

    Is there any way to make this command the default after re-flashing my board? Or do I always have to enter it manually? 

  • Hi,

     

    "west flash" does a pin reset by default:

    ...
    [ #################### ]   0.000s | Verifying image - Verify successful
    [ #################### ]   4.452s | Verify file - Done verifying                                                       
    Applying pin reset.
    -- runners.nrfjprog: Board with serial number 1050749332 flashed successfully.

     

    If you route the "RESET" signal to the reset pin of your custom board, you should be able to flash and run as expected.

     

    Kind regards,

    Håkon

  • Yeah, it worked. Thank you so much again for your help.

    This topic can be closed.

Reply Children
No Data
Related