[Wiki]7.Setting up Pokitto for Hardware debugging


#21

Sure. Will add.


#22

J-link probes are great and SEGGER utilities also excellent, but depending on your location and various shipping costs, LPC-Link2 might work out cheaper. Its available from Embedded Artists in Sweden, and from several distributors (Digikey, Mouser, Farnell/Newark, Arrow, Avent, … etc). If you happen to have an LPC development board (like the LPC11U68 one Jonne has) you can actually flash it with J-link OB using the free LPCScrypt tool from NXP.


#23

Hi Brendon and thanks for the heads-up on LPC-Link2. Yes, buying an NXP dev board with integrated LPC-link2 is a very cost effective way of getting into hardware debugging. It also opens up the possibility to prototype mbed code on different kind of hardware. I highly recommend this approach.

I will try to put up a Pokitto-LPC-link2 hw debugging example also.


#24

HW debugging works with Segger J-Link :grinning: What I needed to do in addition to Jonne’s instructions, was

  1. installing the J-Link SW from here: https://www.segger.com/downloads/jlink
    I installed the “J-Link Software and Documentation Pack” (V6.22a).

  2. Start EmBitz. Update the correct “GDB Server path” in the GDB Server settings as described in Jonne’s Wiki (“C:\Program Files (x86)\SEGGER\JLink_V622a” in my case)

  3. Then just connect Segger to Pokitto and PC

  4. Rebuild and start debugger (F7). I did not have to change any build settings.

I have now just quickly tested HW debugging, but it looks to work much as debugging in Windows using Code Blocks.


#25

How can I just flash any binary with Segger? I started Segger J-Flash application and seleted LPC11U68 as MCU. What else is needed to setup J-Flash or is that enough?


#26

That’s it. Nothing else is needed.


#27

J-Flash Lite worked. Thanks!


#28

Which pins of the swd cable should i connect to what pins in Pex, if i want to use Pex for the hw debugging (and save poor Pokitto from cutting;-) ) ?


#29

Very easy: swd_clock, swd_io, reset and ground. Thats it

Swd = single wire debug. All data goes thru swd_io. Clock is clock signal, reset allows debugger to reset device, ground for common ground between debugger and device


#30

Are you sure VCC is not connected? I could not get PEX to work with debugging.


#31

Yep, I think VCC is needed also. VCC is used to detect if the device is “there” or not.


#32

Still no luck :frowning:


#33

I have succesfully debugged through the PEX several times. I know it works.


#34

I will next try some other GND pins in the segger SWD connector. Maybe they are no all really connected to the ground. SWO is not used, right?


#35

could you elaborate on how it fails? no device found?


#36

Could not connect.


#37

Switch swdio and swdclk around. Maybe they are wrong way around


#38

Tried that but the same result

So I have connected:

SWD        PEX
====       ====
VCC--------3V3
SWDIO------SWD_IO
SWDCLK-----SWD_CLK
nRESET-----RESET
GND(P3)----GND 

I have checked the connections with a multimeter.


#39

Same result on both of your pokittos?


#40

Yest, fails with the other (proto) Pokitto too. That was working before with on board SWD connector. I cannot test it now as I have ruined my SWD-to-SWD cable.