This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Cant get i to work :-).

Hi there i have serius problem in gettimng my nrf52840-dk to work, i am set up in Visualstudio code on a mac, avery thing compiles and seem to upload but nothing happens afterward, i am just trying ti blink the led . 

As seen avery thing seems fine, so i am suddenly getting aín doubt abouth avery thing here.

Please really need help, to get it to work under vsc, have attached at video so configuration can be seen.

Terminal will be reused by tasks, press any key to close it.

> Executing task: platformio run --target upload <

Processing nrf52840_dk (platform: nordicnrf52; board: nrf52840_dk; framework: arduino)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: docs.platformio.org/.../nrf52840_dk.html
PLATFORM: Nordic nRF52 3.5.0 > Nordic nRF52840-DK
HARDWARE: NRF52840 64MHz, 256KB RAM, 1MB Flash
DEBUG: Current (cmsis-dap) On-board (cmsis-dap, jlink) External (blackmagic, stlink)
PACKAGES: tool-jlink 1.64607.0 (6.46.7), toolchain-gccarmnoneeabi 1.70201.0 (7.2.1), framework-arduinonordicnrf5 1.600.0 (6.0), tool-openocd 2.1000.190422 (10.0), tool-sreccat 1.164.0 (1.64)
LDF: Library Dependency Finder -> bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 2 compatible libraries
Scanning dependencies...
No dependencies
Checking size .pio/build/nrf52840_dk/firmware.elf
Memory Usage -> http://bit.ly/pio-memory-usage
DATA: [ ] 0.1% (used 140 bytes from 262144 bytes)
PROGRAM: [ ] 0.3% (used 2640 bytes from 1048576 bytes)
Configuring upload protocol...
AVAILABLE: blackmagic, cmsis-dap, jlink, mbed, nrfjprog, stlink
CURRENT: upload_protocol = jlink
Uploading .pio/build/nrf52840_dk/firmware.hex
SEGGER J-Link Commander V6.46g (Compiled Jun 14 2019 19:36:04)
DLL version V6.46g, compiled Jun 14 2019 19:35:53


J-Link Command File read successfully.
Processing script file...

J-Link connection not established yet but required for command.
Connecting to J-Link via USB...FAILED: Cannot connect to J-Link via USB.

J-Link connection not established yet but required for command.
Connecting to J-Link via USB...FAILED: Cannot connect to J-Link via USB.

J-Link connection not established yet but required for command.
Connecting to J-Link via USB...FAILED: Cannot connect to J-Link via USB.


Script processing completed.

============================================================================= [SUCCESS] Took 1.26 seconds =============================================================================

Terminal will be reused by tasks, press any key to close it.

> Executing task: platformio run --target upload <

Processing nrf52840_dk (platform: nordicnrf52; board: nrf52840_dk; framework: arduino)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: docs.platformio.org/.../nrf52840_dk.html
PLATFORM: Nordic nRF52 3.5.0 > Nordic nRF52840-DK
HARDWARE: NRF52840 64MHz, 256KB RAM, 1MB Flash
DEBUG: Current (cmsis-dap) On-board (cmsis-dap, jlink) External (blackmagic, stlink)
PACKAGES: tool-jlink 1.64607.0 (6.46.7), toolchain-gccarmnoneeabi 1.70201.0 (7.2.1), framework-arduinonordicnrf5 1.600.0 (6.0), tool-openocd 2.1000.190422 (10.0), tool-sreccat 1.164.0 (1.64)
LDF: Library Dependency Finder -> bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 2 compatible libraries
Scanning dependencies...
No dependencies
Checking size .pio/build/nrf52840_dk/firmware.elf
Memory Usage -> http://bit.ly/pio-memory-usage
DATA: [ ] 0.1% (used 140 bytes from 262144 bytes)
PROGRAM: [ ] 0.3% (used 2640 bytes from 1048576 bytes)
Configuring upload protocol...
AVAILABLE: blackmagic, cmsis-dap, jlink, mbed, nrfjprog, stlink
CURRENT: upload_protocol = jlink
Uploading .pio/build/nrf52840_dk/firmware.hex
SEGGER J-Link Commander V6.46g (Compiled Jun 14 2019 19:36:04)
DLL version V6.46g, compiled Jun 14 2019 19:35:53


J-Link Command File read successfully.
Processing script file...

J-Link connection not established yet but required for command.
Connecting to J-Link via USB...O.K.
Firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Jan 7 2019 14:07:15
Hardware version: V1.00
S/N: 683070858
VTref=3.300V
Target connection not established yet but required for command.
Device "NRF52840_XXAA" selected.


Connecting to target via SWD
Found SW-DP with ID 0x2BA01477
Found SW-DP with ID 0x2BA01477
Scanning AP map to find all available APs
AP[2]: Stopped AP scan as end of AP map has been reached
AP[0]: AHB-AP (IDR: 0x24770011)
AP[1]: JTAG-AP (IDR: 0x02880000)
Iterating through AP map to find AHB-AP to use
AP[0]: Core found
AP[0]: AHB-AP ROM base: 0xE00FF000
CPUID register: 0x410FC241. Implementer code: 0x41 (ARM)
Found Cortex-M4 r0p1, Little endian.
FPUnit: 6 code (BP) slots and 2 literal slots
CoreSight components:
ROMTbl[0] @ E00FF000
ROMTbl[0][0]: E000E000, CID: B105E00D, PID: 000BB00C SCS-M7
ROMTbl[0][1]: E0001000, CID: B105E00D, PID: 003BB002 DWT
ROMTbl[0][2]: E0002000, CID: B105E00D, PID: 002BB003 FPB
ROMTbl[0][3]: E0000000, CID: B105E00D, PID: 003BB001 ITM
ROMTbl[0][4]: E0040000, CID: B105900D, PID: 000BB9A1 TPIU
ROMTbl[0][5]: E0041000, CID: B105900D, PID: 000BB925 ETM
Cortex-M4 identified.
PC = 000114F6, CycleCnt = 000EFC3B
R0 = 01000001, R1 = 40020518, R2 = 00000014, R3 = 00000000
R4 = 20000093, R5 = E000E000, R6 = 00000000, R7 = 00000000
R8 = 00000000, R9 = 00000000, R10= 00000000, R11= 00000000
R12= 00000000
SP(R13)= 20004AE8, MSP= 20004AE8, PSP= 00000000, R14(LR) = 000114F5
XPSR = 21000000: APSR = nzCvq, EPSR = 01000000, IPSR = 000 (NoException)
CFBP = 00000000, CONTROL = 00, FAULTMASK = 00, BASEPRI = 00, PRIMASK = 00

FPS0 = 00000000, FPS1 = 00000000, FPS2 = 00000000, FPS3 = 00000000
FPS4 = 00000000, FPS5 = 00000000, FPS6 = 00000000, FPS7 = 00000000
FPS8 = 00000000, FPS9 = 00000000, FPS10= 00000000, FPS11= 00000000
FPS12= 00000000, FPS13= 00000000, FPS14= 00000000, FPS15= 00000000
FPS16= 00000000, FPS17= 00000000, FPS18= 00000000, FPS19= 00000000
FPS20= 00000000, FPS21= 00000000, FPS22= 00000000, FPS23= 00000000
FPS24= 00000000, FPS25= 00000000, FPS26= 00000000, FPS27= 00000000
FPS28= 00000000, FPS29= 00000000, FPS30= 00000000, FPS31= 00000000
FPSCR= 00000000

Downloading file [.pio/build/nrf52840_dk/firmware.hex]...
Comparing flash [100%] Done.
Erasing flash [100%] Done.
Programming flash [100%] Done.
Verifying flash [100%] Done.
J-Link: Flash download: Bank 0 @ 0x00000000: 1 range affected (4096 bytes)
J-Link: Flash download: Total time needed: 0.202s (Prepare: 0.041s, Compare: 0.004s, Erase: 0.084s, Program: 0.062s, Verify: 0.000s, Restore: 0.008s)
O.K.

Reset delay: 0 ms
Reset type NORMAL: Resets core & peripherals via SYSRESETREQ & VECTRESET bit.
Reset: Halt core after reset via DEMCR.VC_CORERESET.
Reset: Reset device via AIRCR.SYSRESETREQ.


Script processing completed.

============================================================================= [SUCCESS] Took 1.28 seconds =============================================================================

Terminal will be reused by tasks, press any key to close it.

  • Hi,

    It seems that the PC isn't able to establish a J-link connection. Could see if the device is listed if you use nrfjprog and issue the command:

    nrfjprog --ids

    If it isn't, please go through the steps listed in this thread and see if the solves the issue.

    Lastly, PlatformIO isn't an extension that we are able to offer support to, we generally recommend using one of the IDE's that are used in the SDK.

    regards

    Jared 

  • I know you don’t do support for platform io. . here are the ids 683070858

    I think I accidentally added one to many download txt, and one without the board attached.
    Is this better.
    Ok I will go back to the adafruit board and give up on this.  
    Thanks anyway.
    Ps. Is it correct when code is downloaded the mcu led dim's very short Avery sec.
    Lars
    > Executing task in folder NrfTest: platformio run --target upload <
    Processing upstream_develop_nrf52 (platform: https://github.com/platformio/platform-nordicnrf52.git; board: nrf52840_dk; framework: arduino)
    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Verbose mode can be enabled via `-v, --verbose` option
    PLATFORM: Nordic nRF52 3.5.0 #adc6c6c > Nordic nRF52840-DK
    HARDWARE: NRF52840 64MHz, 256KB RAM, 1MB Flash
    DEBUG: Current (cmsis-dap) On-board (cmsis-dap, jlink) External (blackmagic, stlink)
    PACKAGES: tool-jlink 1.64607.0 (6.46.7), toolchain-gccarmnoneeabi 1.70201.0 (7.2.1), framework-arduinonordicnrf5 1.600.0 (6.0), tool-openocd 2.1000.190422 (10.0), tool-sreccat 1.164.0 (1.64)
    LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
    LDF Modes: Finder ~ chain, Compatibility ~ soft
    Found 2 compatible libraries
    Scanning dependencies...
    No dependencies
    Checking size .pio/build/upstream_develop_nrf52/firmware.elf
    DATA:    [          ]   0.1% (used 140 bytes from 262144 bytes)
    PROGRAM: [          ]   0.3% (used 2644 bytes from 1048576 bytes)
    Configuring upload protocol...
    AVAILABLE: blackmagic, cmsis-dap, jlink, mbed, nrfjprog, stlink
    CURRENT: upload_protocol = jlink
    Uploading .pio/build/upstream_develop_nrf52/firmware.hex
    SEGGER J-Link Commander V6.46g (Compiled Jun 14 2019 19:36:04)
    DLL version V6.46g, compiled Jun 14 2019 19:35:53
    J-Link Command File read successfully.
    Processing script file...
    J-Link connection not established yet but required for command.
    Connecting to J-Link via USB...O.K.
    Firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Jan  7 2019 14:07:15
    Hardware version: V1.00
    S/N: 683070858
    VTref=3.300V
    Target connection not established yet but required for command.
    Device "NRF52840_XXAA" selected.
    Connecting to target via SWD
    Found SW-DP with ID 0x2BA01477
    Found SW-DP with ID 0x2BA01477
    Scanning AP map to find all available APs
    AP[2]: Stopped AP scan as end of AP map has been reached
    AP[0]: AHB-AP (IDR: 0x24770011)
    AP[1]: JTAG-AP (IDR: 0x02880000)
    Iterating through AP map to find AHB-AP to use
    AP[0]: Core found
    AP[0]: AHB-AP ROM base: 0xE00FF000
    CPUID register: 0x410FC241. Implementer code: 0x41 (ARM)
    Found Cortex-M4 r0p1, Little endian.
    FPUnit: 6 code (BP) slots and 2 literal slots
    CoreSight components:
    ROMTbl[0] @ E00FF000
    ROMTbl[0][0]: E000E000, CID: B105E00D, PID: 000BB00C SCS-M7
    ROMTbl[0][1]: E0001000, CID: B105E00D, PID: 003BB002 DWT
    ROMTbl[0][2]: E0002000, CID: B105E00D, PID: 002BB003 FPB
    ROMTbl[0][3]: E0000000, CID: B105E00D, PID: 003BB001 ITM
    ROMTbl[0][4]: E0040000, CID: B105900D, PID: 000BB9A1 TPIU
    ROMTbl[0][5]: E0041000, CID: B105900D, PID: 000BB925 ETM
    Cortex-M4 identified.
    PC = 00000748, CycleCnt = 000C0F60
    R0 = 0003D930, R1 = 000003E8, R2 = 007E1AB3, R3 = 00000000
    R4 = 000003E8, R5 = 0003D861, R6 = 00000000, R7 = 00000000
    R8 = 00000000, R9 = 00000000, R10= 20000000, R11= 00000000
    R12= 00000000
    SP(R13)= 2000FFE0, MSP= 2000FFE0, PSP= 00000000, R14(LR) = 00000749
    XPSR = 21000000: APSR = nzCvq, EPSR = 01000000, IPSR = 000 (NoException)
    CFBP = 00000000, CONTROL = 00, FAULTMASK = 00, BASEPRI = 00, PRIMASK = 00
    FPS0 = 00000000, FPS1 = 00000000, FPS2 = 00000000, FPS3 = 00000000
    FPS4 = 00000000, FPS5 = 00000000, FPS6 = 00000000, FPS7 = 00000000
    FPS8 = 00000000, FPS9 = 00000000, FPS10= 00000000, FPS11= 00000000
    FPS12= 00000000, FPS13= 00000000, FPS14= 00000000, FPS15= 00000000
    FPS16= 00000000, FPS17= 00000000, FPS18= 00000000, FPS19= 00000000
    FPS20= 00000000, FPS21= 00000000, FPS22= 00000000, FPS23= 00000000
    FPS24= 00000000, FPS25= 00000000, FPS26= 00000000, FPS27= 00000000
    FPS28= 00000000, FPS29= 00000000, FPS30= 00000000, FPS31= 00000000
    FPSCR= 00000000
    Downloading file [.pio/build/upstream_develop_nrf52/firmware.hex]...
    Comparing flash   [100%] Done.
    Verifying flash   [100%] Done.
    J-Link: Flash download: Bank 0 @ 0x00000000: Skipped. Contents already match
    O.K.
    Reset delay: 0 ms
    Reset type NORMAL: Resets core & peripherals via SYSRESETREQ & VECTRESET bit.
    Reset: Halt core after reset via DEMCR.VC_CORERESET.
    Reset: Reset device via AIRCR.SYSRESETREQ.
    Script processing completed.
    ============================================================================= [SUCCESS] Took 1.19 seconds =============================================================================
    Processing nrf52840_dk (platform: nordicnrf52; board: nrf52840_dk; framework: arduino)
    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Verbose mode can be enabled via `-v, --verbose` option
    PLATFORM: Nordic nRF52 3.5.0 > Nordic nRF52840-DK
    HARDWARE: NRF52840 64MHz, 256KB RAM, 1MB Flash
    DEBUG: Current (cmsis-dap) On-board (cmsis-dap, jlink) External (blackmagic, stlink)
    PACKAGES: tool-jlink 1.64607.0 (6.46.7), toolchain-gccarmnoneeabi 1.70201.0 (7.2.1), framework-arduinonordicnrf5 1.600.0 (6.0), tool-openocd 2.1000.190422 (10.0), tool-sreccat 1.164.0 (1.64)
    LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
    LDF Modes: Finder ~ chain, Compatibility ~ soft
    Found 2 compatible libraries
    Scanning dependencies...
    No dependencies
    Checking size .pio/build/nrf52840_dk/firmware.elf
    DATA:    [          ]   0.1% (used 140 bytes from 262144 bytes)
    PROGRAM: [          ]   0.3% (used 2644 bytes from 1048576 bytes)
    Configuring upload protocol...
    AVAILABLE: blackmagic, cmsis-dap, jlink, mbed, nrfjprog, stlink
    CURRENT: upload_protocol = jlink
    Uploading .pio/build/nrf52840_dk/firmware.hex
    SEGGER J-Link Commander V6.46g (Compiled Jun 14 2019 19:36:04)
    DLL version V6.46g, compiled Jun 14 2019 19:35:53
    J-Link Command File read successfully.
    Processing script file...
    J-Link connection not established yet but required for command.
    Connecting to J-Link via USB...O.K.
    Firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Jan  7 2019 14:07:15
    Hardware version: V1.00
    S/N: 683070858
    VTref=3.300V
    Target connection not established yet but required for command.
    Device "NRF52840_XXAA" selected.
    Connecting to target via SWD
    Found SW-DP with ID 0x2BA01477
    Found SW-DP with ID 0x2BA01477
    Scanning AP map to find all available APs
    AP[2]: Stopped AP scan as end of AP map has been reached
    AP[0]: AHB-AP (IDR: 0x24770011)
    AP[1]: JTAG-AP (IDR: 0x02880000)
    Iterating through AP map to find AHB-AP to use
    AP[0]: Core found
    AP[0]: AHB-AP ROM base: 0xE00FF000
    CPUID register: 0x410FC241. Implementer code: 0x41 (ARM)
    Found Cortex-M4 r0p1, Little endian.
    FPUnit: 6 code (BP) slots and 2 literal slots
    CoreSight components:
    ROMTbl[0] @ E00FF000
    ROMTbl[0][0]: E000E000, CID: B105E00D, PID: 000BB00C SCS-M7
    ROMTbl[0][1]: E0001000, CID: B105E00D, PID: 003BB002 DWT
    ROMTbl[0][2]: E0002000, CID: B105E00D, PID: 002BB003 FPB
    ROMTbl[0][3]: E0000000, CID: B105E00D, PID: 003BB001 ITM
    ROMTbl[0][4]: E0040000, CID: B105900D, PID: 000BB9A1 TPIU
    ROMTbl[0][5]: E0041000, CID: B105900D, PID: 000BB925 ETM
    Cortex-M4 identified.
    PC = 00000722, CycleCnt = 001230D3
    R0 = 00008B2E, R1 = 000003E8, R2 = 00008B2E, R3 = 00000000
    R4 = 021FABB0, R5 = 00000000, R6 = 00000000, R7 = 00000000
    R8 = 00000000, R9 = 00000000, R10= 20000000, R11= 00000000
    R12= 00000000
    SP(R13)= 2000FFDC, MSP= 2000FFDC, PSP= 00000000, R14(LR) = 00000749
    XPSR = 41000000: APSR = nZcvq, EPSR = 01000000, IPSR = 000 (NoException)
    CFBP = 00000000, CONTROL = 00, FAULTMASK = 00, BASEPRI = 00, PRIMASK = 00
    FPS0 = 00000000, FPS1 = 00000000, FPS2 = 00000000, FPS3 = 00000000
    FPS4 = 00000000, FPS5 = 00000000, FPS6 = 00000000, FPS7 = 00000000
    FPS8 = 00000000, FPS9 = 00000000, FPS10= 00000000, FPS11= 00000000
    FPS12= 00000000, FPS13= 00000000, FPS14= 00000000, FPS15= 00000000
    FPS16= 00000000, FPS17= 00000000, FPS18= 00000000, FPS19= 00000000
    FPS20= 00000000, FPS21= 00000000, FPS22= 00000000, FPS23= 00000000
    FPS24= 00000000, FPS25= 00000000, FPS26= 00000000, FPS27= 00000000
    FPS28= 00000000, FPS29= 00000000, FPS30= 00000000, FPS31= 00000000
    FPSCR= 00000000
    Downloading file [.pio/build/nrf52840_dk/firmware.hex]...
    Comparing flash   [100%] Done.
    Verifying flash   [100%] Done.
    J-Link: Flash download: Bank 0 @ 0x00000000: Skipped. Contents already match
    O.K.
    Reset delay: 0 ms
    Reset type NORMAL: Resets core & peripherals via SYSRESETREQ & VECTRESET bit.
    Reset: Halt core after reset via DEMCR.VC_CORERESET.
    Reset: Reset device via AIRCR.SYSRESETREQ.
    Script processing completed.
    ============================================================================= [SUCCESS] Took 1.24 seconds =============================================================================
    ====================================================================================== [SUMMARY] ======================================================================================
    Environment upstream_develop_nrf52      [SUCCESS]
    Environment nrf52840_dk                 [SUCCESS]
    ============================================================================= 2 succeeded in 2.43 seconds =============================================================================
    Terminal will be reused by tasks, press any key to close it.
Related