Errors while flashing a custom nrf52840 board

Dear Team DevZone,

We are facing some problems while flashing our protoypes ( custom board whit nRF52840 chip ),

We are using nRF Connect for Desktop v4.1.1, The Toolchain Manager v1.2.4 and nRF connect SDK 2.2.0 to generate our Hex files (that works in DK). 

We are using Programmer (v3.0.8) to flash the custom board ( nRF52840 xxAA REV2 ) whit a ( nRF52840DK xxAA REV3) as a JLINK ( V7.80c ).

We use the Tag-Connect ( TC2030-CTX ) a 10pins to 6pins connector. 

The reset pin P0.18 in our chip is not connected. We look to disable it in the software also, can we do it whit the register PSELRESET(0x200)?.

While flashing any of our test programs we face two problems (sometimes the jlink recognize the customboard but does not communicate properly ) : 

First : Unsupported device. The detected device could not be recognized as neither JLink device nor Nordic USB device.

Second : [error] [SeggerBackend] - 10 second timeout elapsed, no time left to wait for debug port to power up.

We are locked at this point, so that we open this ticket.

Thank you in advance,

Kinds regards.

  • Hi

    The easiest way to use the reset pin as a GPIO is to set the CONFIG_GPIO_AS_PINRESET = n in your project configuration file. If you have left it floating and it is programmed as a reset pin it might be hard to get it programmed.

    In general, the correct setup when programming custom boards with an nRF5x DK is to connect it to P20 as shown in the image below:

     

    Best regards,

    Simon

  • Hi Simon thank you for your fast reply,

    We followed the setup but unfortunatly it fail again whit the same errors. the problem is not about the setup i guess, but more about jlink configurations, program configurations or our hardware design.

    Best regards,

    Mehdi

  • Hi,

    I have tested a new protoype, whit the normal setup ( P19 ), For the first time connection the jlink board recognize our custom board and read it whitout any problem, but when we flash a simple blinky code the led doesnt blink and the custom board stick in protection mode, we try to recover and erase using the commands programmer and vscode, the custom board stick in protection mode and the jlink show an unknow board.  /cfs-file/__key/communityserver-discussions-components-files/4/Log_5F00_file_5F00_nrf52.txt

    The problems after flashing a simple code : 

    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    Failed to read device memories.[error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".

    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [ nRF52] - Failed when checking readback protect status.
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    [error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
    ERROR: JLinkARM DLL reported an error. Try again. If error condition
    ERROR: persists, run the same command again with argument --log, contact Nordic
    ERROR: Semiconductor and provide the generated log.log file to them.
    NOTE: For additional output, try running again with logging enabled (--log).
    NOTE: Any generated log error messages will be displayed.
    FATAL ERROR: command exited with status 33: nrfjprog --program 'c:\nordicsemi\MyApps2\blinky\build\zephyr\zephyr.hex' --chiperase --verify -f NRF52 --snr 1050248226

  • Update 

    We figure out that we are on Rev2 ( D0) and we didnt connect the DEC5 capacitor, can we program out custom board or we should have this capacitor connected.

  • Hello Simon,

    We encountered two problems when flashing the protos with the default flash (the classic method for dev kits), we just had to adapt our way of flash to the case of our prototype.

    - The pin reset:


    o Problem: In our case the pin reset is not connected and therefore upgraded high internally, so it had to be disabled at the firmware level, the problem is that we use the classic flash (default settings) which force the reset to be reactivated by writing in the UICR registry and thus cancelling the configs we made in the firmware.


    o Solution: To solve this problem, you must disable the firmware reset on the one hand by adding this configuration to the file prj.conf (CONFIG_GPIO_AS_PINRESET=n), for more security add the appropriate deactivation function (see pj Désactiver_APPROTECT) to the project then call it at the beginning of the hand (as an initialization function).  And for flash firmware use the following command line: ( west flash --recover –softreset ) with recover removes the contents of the chip and then with softreset we write the program without enabling the reset.


    - Power:
    o Problem: In our case we pass the power directly to the microcontroller, this is not a problem because the chip has a LDO and a DCDC that allows to avoid current peaks and physical phenomena of this style. However, in order for these microcontroller internal elements to function properly, it is necessary to place components including inductances ( see pj DCDCMODE ) but we didnt add them.


    o Solution: To solve this problem you must disable the LDO and DCDC part in the power registry with the following configuration (CONFIG_BOARD_ENABLE_DC_DC=n ).

    These solutions allow us to flash our protos without the program locking and with a single command line.

    Do you have some advices to improves our project ?

    Thank you,

    Best regards,

    -Mehdi

Related