<< return to Pixycam.com

Debugging Pixy using Keil

Hi!
I´m trying to debug the firmware with a segger J-Link-Debugger.

What do I have to change in the keil configuration?
Should I use Flash Download? See: Project/Options for Video…/Debug/Flash Download

Building a video.hex with uVision5 and flash it to the Pixy using PixyMon works fine.
But when I start debugging, I got the following console output.
Pressing Step Over(F10) -> no error, pressing Step(11) leads to an error message:
“Could not stop Cortex-M device! Please check the JTAG-cable.”

Thanks!
Jan


  • JLink Info: Device “UNSPECIFIED” selected (0 KB flash, 0 KB RAM).
    Set JLink Project File to “C:\Users\Jan\git\pixyhardware\src\device\video\JLinkSettings.ini”* JLink Info: Device “UNSPECIFIED” selected (0 KB flash, 0 KB RAM).

JLink info:

DLL: V4.91b, compiled Sep 15 2014 09:17:56
Firmware: J-Link V9 compiled Sep 5 2014 18:54:08
Hardware: V9.00
S/N : 269302404
OEM : SEGGER-EDU
Feature(s) : FlashBP, GDB

  • JLink Info: TotalIRLen = 8, IRPrint = 0x0011
  • JLink Info: Found Cortex-M4 r0p1, Little endian.
  • JLink Info: FPUnit: 6 code (BP) slots and 2 literal slots
  • JLink Info: TPIU fitted.
  • JLink Info: ETM fitted.
    ROMTableAddr = 0xE00FF003

Target info:

Device: LPC4330:Cortex-M4
VTarget = 3.296V
State of Pins: TCK: 1, TDI: 0, TDO: 0, TMS: 0, TRES: 1, TRST: 1
Hardware-Breakpoints: 6
Software-Breakpoints: 8192
Watchpoints: 4
JTAG speed: 2000 kHz

Load “C:\Users\Jan\git\pixyhardware\src\device\video\spifi\video.axf”
Verify failed on VerifyBlock()*** error 57: illegal address (0x14000000)
*** error 122: AGDI: memory read failed (0x00000022)
Include “C:\Users\Jan\git\pixyhardware\src\device\video\spifi.ini”

FUNC void Setup (unsigned int region) {
region &= 0xFFFF0000;
SP = _RDWORD(region); // Setup Stack Pointer
PC = _RDWORD(region + 4); // Setup Program Counter
_WDWORD(0xE000ED08, region); // Setup Vector Table Offset Register
}

LOAD “spifi\video.axf” INCREMENTAL
Verify failed on VerifyBlock()*** error 57: illegal address (0x14000000)
Setup(0x14000000); // Get ready to execute image in SRAM or whatever region it is in
^
*** error 34, line 10: undefined identifier
SET SRC = …\libpixy
g,main
__^
*** error 34, line 12: undefined identifier

Hi Jan,

Hmm the “Could not stop Cortex-M device! Please check the JTAG-cable.” error can be a tricky one. Its not always obvious what the root problem is. Are you using the project files from the git repo? I’m not by my Windows computer at the moment, so I’ll have to wait until tomorrow to give you detailed instructions. Let me know how your progress is coming.

Scott

Hi Scott!

Thanks!
I´m using the source from the git repo ~1 month old.

I think the problem is in my flash programming configuration.
It would be nice if you could tell what your settings are.

I changed the following in Project/Options for Video…/Debug/Flash Download:
Start: 0x14000000 (I read this in your post [[Memory use on Pixy]])
Size: 0x1500
Added Programming Algorithm "LPC18xx/43xx … <— Device Type says Ext Flash SPI, which must be wrong for Pixy, but the alternatives are much worse and also external flash:
LPC18xx43xx_S25FL032.FLM
LPC407x_8x_S25FL032.FLM
RC28F640J3x_x2.FLM
S29GL064Nx2.FLM
Changed target selection (Flash/RAM) in project video. Which one do you use?
Is there a risk of bricking the pixy, especially the .hex-Flash-Bootloader?

Jan

Hi Scott!

I know, you have much to do, but you said you can give me detailed instructions?
Especially your setting at Project/Options for Video…/Debug/Flash Download would be very interesting.

Jan