<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>nRF52 DK JLink debugging in ubuntu</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/12846/nrf52-dk-jlink-debugging-in-ubuntu</link><description>Hi. 
 Quest to get the toolchain working under ubuntu continues. 
 I&amp;#39;ve done the eclipse and jlink config as explained in the nrf51 linux tutorial (with of course keeping mind that I should use 52 packages). I can make build under eclipse, but I cannot</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 31 Mar 2016 10:06:25 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/12846/nrf52-dk-jlink-debugging-in-ubuntu" /><item><title>RE: nRF52 DK JLink debugging in ubuntu</title><link>https://devzone.nordicsemi.com/thread/48855?ContentTypeID=1</link><pubDate>Thu, 31 Mar 2016 10:06:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:48a00659-894c-4280-9a1e-65128fa62239</guid><dc:creator>Matts</dc:creator><description>&lt;p&gt;Ok, now the debugger works.&lt;/p&gt;
&lt;p&gt;HOX! NORDIC YOU NEED TO FIX THE FAMILY PACK 8.5.0!! HOX!&lt;/p&gt;
&lt;p&gt;Found ansver in the tutorial comments that some dude had to revert device family pack from 8.5.0 to 8.3.2 to get the debugger working. Also I had to change:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Makefile CFLAGS += -Wall -Werror -O3 to CFLAGS += -Wall -Werror -O0 -g3
Change the program counter from 0 to start of app (soft device starts from address 0) to (in my case) 0x1f000. This can be done in debug configurations -&amp;gt; GDB SEGGER J-Link Debugging -&amp;gt; you config -&amp;gt; startup page -&amp;gt; set program counter at -field.
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 DK JLink debugging in ubuntu</title><link>https://devzone.nordicsemi.com/thread/48854?ContentTypeID=1</link><pubDate>Wed, 30 Mar 2016 08:49:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:87dc10d8-30d5-4d0f-8989-849eda0026ce</guid><dc:creator>Matts</dc:creator><description>&lt;p&gt;Plot thickens.&lt;/p&gt;
&lt;p&gt;With just &amp;quot;run&amp;quot; option the eclipse seems to be able to flash the targets added to make targets (now with the ble proximity example both soft device and the app). Also I managed to see the device with smartphone. So this worked atleast for a moment.&lt;/p&gt;
&lt;p&gt;However the debugger still doesn&amp;#39;t play along. I can see the user thread for a second or two, but it disappears right away and JLinkGDBServer and gdb terminate with rval -1. Also the SWV terminal terminates with status 0. I tried also logging with the printf/app_trace_put (just added define for the trace support flag in app_trace.h before it&amp;#39;s checked). However I can only see crap in the terminal. With same setup and modified blinky example I did manage to see proper trace.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 DK JLink debugging in ubuntu</title><link>https://devzone.nordicsemi.com/thread/48852?ContentTypeID=1</link><pubDate>Wed, 30 Mar 2016 07:45:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cf389489-a831-4aa7-904e-497851373b07</guid><dc:creator>Matts</dc:creator><description>&lt;p&gt;Ok, I didn&amp;#39;t have anything in the 99-jlink.rules. Also I tried running the eclipse in sudo state, so it got the jlink open (rights issue to USB device?). The firmware got updated OK last week when I first tried the JLink from cmd line.&lt;/p&gt;
&lt;p&gt;However it cannot attach &amp;amp; flash the device via eclipse. The debugger start log seems legit so I don&amp;#39;t think this is far from OK.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;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:      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:                 nRF52832_xxAA
Target interface:              SWD
Target interface speed:        1000kHz
Target endian:                 little

Connecting to J-Link...
J-Link is connected.
Firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Mar 15 2016 18:03:17
Hardware: V1.00
S/N: 682343799
Checking target voltage...
Target voltage: 3.30 V
Listening on TCP/IP port 2331
Connecting to target...Connected to target
Waiting for GDB connection...Connected to 127.0.0.1
Reading all registers
Read 1 bytes @ address 0x00000000 (Data = 0x00)
Read 1 bytes @ address 0x00000000 (Data = 0x00)
Reading 64 bytes @ address 0x00000000
Reading 8 bytes @ address 0x00000000
Reading 7 bytes @ address 0x00000000
Target interface speed set to 1000 kHz
Resetting target
Halting target CPU...
...Target halted (PC = 0x000010BC)
R0 = 00000000, R1 = 00000000, R2 = 00000000, R3 = 00000000
R4 = 00000000, R5 = 00000000, R6 = 00000000, R7 = 00000000
R8 = 00000000, R9 = 00000000, R10= 00000000, R11= 00000000
R12= 00000000, R13= 20008000, MSP= 20008000, PSP= 00000000
R14(LR) = FFFFFFFF, R15(PC) = 000010BC
XPSR 01000000, APSR 00000000, EPSR 01000000, IPSR 00000000
CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00
Reading all registers
Read 1 bytes @ address 0x00000000 (Data = 0x00)
Read 1 bytes @ address 0x00000000 (Data = 0x00)
Reading 8 bytes @ address 0x00000000
Reading 7 bytes @ address 0x00000000
Select auto target interface speed (1000 kHz)
Flash breakpoints enabled
Semi-hosting enabled (Handle on BKPT)
Semihosting I/O set to TELNET Client
SWO disabled succesfully.
SWO enabled succesfully.
Read 1 bytes @ address 0x00000000 (Data = 0x00)
Read 1 bytes @ address 0x00000000 (Data = 0x00)
Reading 8 bytes @ address 0x00000000
Reading 7 bytes @ address 0x00000000
Downloading 4096 bytes @ address 0x0001F000 - Verified OK
Downloading 4096 bytes @ address 0x00020000 - Verified OK
Downloading 4096 bytes @ address 0x00021000 - Verified OK
Downloading 4096 bytes @ address 0x00022000 - Verified OK
Downloading 4096 bytes @ address 0x00023000 - Verified OK
Downloading 4096 bytes @ address 0x00024000 - Verified OK
Downloading 4096 bytes @ address 0x00025000 - Verified OK
Downloading 260 bytes @ address 0x00026000 - Verified OK
Downloading 8 bytes @ address 0x00026104 - Verified OK
Downloading 104 bytes @ address 0x0002610C - Verified OK
Comparing flash   [....................] Done.
Verifying flash   [....................] Done.
Writing register (R8 = 0x00025fb1)
Writing register (s8 = 0xffffffff)
Read 1 bytes @ address 0x00025FB1 (Data = 0x49)
Reading 64 bytes @ address 0x00023740
Read 1 bytes @ address 0x0002376D (Data = 0xB5)
Resetting target
Halting target CPU...
...Target halted (PC = 0x000010BC)
Read 1 bytes @ address 0x0002376D (Data = 0xB5)
R0 = 00000000, R1 = 00000000, R2 = 00000000, R3 = 00000000
R4 = 00000000, R5 = 00000000, R6 = 00000000, R7 = 00000000
R8 = 00000000, R9 = 00000000, R10= 00000000, R11= 00000000
R12= 00000000, R13= 20008000, MSP= 20008000, PSP= 00000000
R14(LR) = FFFFFFFF, R15(PC) = 000010BC
XPSR 01000000, APSR 00000000, EPSR 01000000, IPSR 00000000
CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00
Reading all registers
Read 1 bytes @ address 0x00000000 (Data = 0x00)
Read 1 bytes @ address 0x00000000 (Data = 0x00)
Reading 64 bytes @ address 0x00000000
Reading 8 bytes @ address 0x00000000
Reading 7 bytes @ address 0x00000000
Setting breakpoint @ address 0x0002376D, Size = 4, BPHandle = 0x0001
Starting target CPU...
Debugger requested to halt target...
...Target halted (PC = 0x000007F0)
Reading all registers
Read 1 bytes @ address 0x00000000 (Data = 0x00)
Read 1 bytes @ address 0x00000000 (Data = 0x00)
Reading 64 bytes @ address 0x00000000
Reading 8 bytes @ address 0x00000000
Reading 7 bytes @ address 0x00000000
Removing breakpoint @ address 0x0002376D, Size = 4
Starting target CPU...
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;After this the old app still runs happily.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 DK JLink debugging in ubuntu</title><link>https://devzone.nordicsemi.com/thread/48853?ContentTypeID=1</link><pubDate>Tue, 29 Mar 2016 13:38:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9f0af5fb-44c6-4d8b-9910-d4beacd005f7</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Since the Segger debugger includes a &amp;quot;drag and drop&amp;quot; drive for .hex files, it shall enumerate parts of it as a SCSI drive. I get the same print outs in my dmesg.&lt;/p&gt;
&lt;p&gt;It seems that it has some issues enumerating at your end:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;[4510004.609642] usb 1-2: config 1 interface 1 altsetting 0 bulk endpoint 0x83 has invalid maxpacket 64
[4510004.609646] usb 1-2: config 1 interface 1 altsetting 0 bulk endpoint 0x4 has invalid maxpacket 64
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If you run JLinkExe from command line (should be in $PATH), it will force a firmware update if available. Could you try this (and ensure that it finishes properly) then power-cycle the board?
Or maybe JlinkExe also have issues connecting to the board? If so, try to sudo it and see if that changes anything.&lt;/p&gt;
&lt;p&gt;Can you also ensure that the Segger udev rules are present? They should be located in /etc/udev/rules.d/99-jlink.rules and have atleast these three lines (will have many others, but this is the one for the nRF52-DK debugger):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ACTION!=&amp;quot;add&amp;quot;, SUBSYSTEM!=&amp;quot;usb_device&amp;quot;, GOTO=&amp;quot;jlink_rules_end&amp;quot;
ATTR{idProduct}==&amp;quot;1015&amp;quot;, ATTR{idVendor}==&amp;quot;1366&amp;quot;, MODE=&amp;quot;666&amp;quot;
LABEL=&amp;quot;jlink_rules_end&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Cheers,
Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 DK JLink debugging in ubuntu</title><link>https://devzone.nordicsemi.com/thread/48851?ContentTypeID=1</link><pubDate>Tue, 29 Mar 2016 13:18:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fe892dda-148b-4d53-abb4-6e033565610c</guid><dc:creator>Christopher</dc:creator><description>&lt;p&gt;Do you set the correct device name in the debugger tab configuration ? Could you try with &lt;code&gt;nRF52832_xxAA&lt;/code&gt; ?&lt;/p&gt;
&lt;p&gt;See the supported device names: &lt;a href="https://www.segger.com/jlink_supported_devices.html"&gt;www.segger.com/jlink_supported_devices.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You should also check the udev rules, see &lt;a href="http://gnuarmeclipse.github.io/debug/jlink/install/#gnulinux"&gt;gnuarmeclipse.github.io/.../&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>