This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

nRF52 DK flashing with jlink in ubuntu

Hi.

Trying to set up the Ubuntu development environment for you nRF52 development kit.

I followed this tutorial: devzone.nordicsemi.com/.../

Stuff done so far:

  • Installed latest gcc-arm-none-eab tools under /usr/local/
  • installed 32 bit libraries(sudo apt-get install lib32z1 lib32ncurses5)
  • installed the SDK (developer.nordicsemi.com/nRF52_SDK)
  • changed the makefile.posix to: GNU_INSTALL_ROOT := /usr/local/gcc-arm-none-eabi-5_2-2015q4 GNU_VERSION := 5.2.1 GNU_PREFIX := arm-none-eabi

-Tested the build for blinky demo (success) -Tested the flashing in drag-and-drop-mode (success) -Installed the jlink (www.segger.com/jlink-software.html) Linux V5.10u, TGZ archive 64-bit version [13,715 kb]. I put it to /opt/SEGGER/JLink as it seems to be the hardcoded location in the SDK

At this phase I tried the old style flashing with /home/matti/Tools/nRF5x-Command-Line-Tools_8_3_0_Li nux-x86_64/nrfjprog/nrfjprog --family nRF52 --program _build/nrf52832_xxaa.hex

I get: ERROR: There is no debugger connected to the PC.

Also if I try to run /opt/SEGGER/JLink/JLinkGDBServer, I get: SEGGER J-Link GDB Server V5.10u Command Line Version

JLinkARM.dll V5.10u (DLL compiled Mar 17 2016 19:06:19)

-----GDB Server start settings----- GDBInit file: none GDB Server Listening port: 2331 SWO raw output listening port: 2332 Terminal I/O port: 2333 Accept remote connection: yes Generate logfile: off Verify download: off Init regs on start: off Silent mode: off Single run mode: off Target connection timeout: 0 ms ------J-Link related settings------ J-Link Host interface: USB J-Link script: none J-Link settings file: none ------Target related settings------ Target device: unspecified Target interface: JTAG Target interface speed: 1000kHz Target endian: little

Connecting to J-Link... Connecting to J-Link failed. Connected correctly? GDBServer will be closed... Shutting down... Could not connect to J-Link. Please check power, connection and settings.

If I check lsusb, I can see the the device there (and as said, drag'n'drop flashing works): Bus 001 Device 020: ID 1366:1015 SEGGER

also dmesg | SEGGER: PQ: 0 ANSI: 4 [4343271.361802] usb 1-2: Manufacturer: SEGGER [4343277.367831] scsi 11:0:0:0: Direct-Access SEGGER MSD Volume 1.00 PQ: 0 ANSI: 4


I can live with the drag and drop flashing, but the problem is that the eclipse debugging doesn't work either (test with the blinky example just like in the tutorial). There I get the same error as above: EGGER J-Link GDB Server V5.10u Command Line Version

JLinkARM.dll V5.10u (DLL compiled Mar 17 2016 19:06:19)

-----GDB Server start settings----- GDBInit file: none GDB Server Listening port: 2331 SWO raw output listening port: 2332 Terminal I/O port: 2333 Accept remote connection: localhost only Generate logfile: off Verify download: on Init regs on start: on Silent mode: off Single run mode: on Target connection timeout: 0 ms ------J-Link related settings------ J-Link Host interface: USB J-Link script: none J-Link settings file: none ------Target related settings------ Target device: nRF52 Target interface: SWD Target interface speed: 1000kHz Target endian: little

Connecting to J-Link... Connecting to J-Link failed. Connected correctly? GDBServer will be closed... Shutting down...

Ideas? Suggestions?

  • Try this command JLinkExe -device nrf51822_xxaa -if swd -speed 4000

  • Why not just use the JLINK DEB file from Segger? My guess is you have a permission issue. To test that try sudo JLinkExe -device nrf52 -if swd -speed 4000

  • Ok, the sudo JLinkExe -device nrf52 -if swd -speed 4000 updated the firmware:

    SEGGER J-Link Commander V5.10u (Compiled Mar 17 2016 19:06:22) DLL version V5.10u, compiled Mar 17 2016 19:06:19

    Connecting to J-Link via USB...Updating firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Mar 15 2016 18:03:17 Replacing firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Jan 21 2016 17:58:20 Waiting for new firmware to boot New firmware booted successfully O.K. Firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Mar 15 2016 18:03:17 Hardware version: V1.00 S/N: 682343799 VTref = 3.300V

    After that I tried flashing the blinky, but now I get another error:

    sudo nrfjprog --family nRF52 --program _build/nrf52832_xxaa.hex Parsing hex file. Reading flash area to program to guarantee it is erased. ERROR: The area to write is not erased.

  • Try to erase the flash first: nrfjprog -e

    Then program the application (and SoftDevice if used). If application and SoftDevice are not compatible, or if memory settings for the application is wrong, then there might be an overlap in memory for where to put SoftDevice and application and you will still get that error.

Related