ubuntu@ubuntu-xenial:~/Code/CIAA/firmware_v2$ make openocd
Starting OpenOCD for lpc4337_m4...
Open On-Chip Debugger 0.9.0 (2017-12-31-20:04)
Licensed under GNU GPL v2
For bug reports, read
adapter speed: 2000 kHz
Info : auto-selecting first available session transport "jtag". To override use 'transport select <transport>'.
none separate
cortex_m reset_config vectreset
Info : clock speed 2000 kHz
Info : JTAG tap: lpc4337.m4 tap/device found: 0x4ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x4)
Info : JTAG tap: lpc4337.m0 tap/device found: 0x0ba01477 (mfg: 0x23b, part: 0xba01, ver: 0x0)
Info : lpc4337.m4: hardware has 6 breakpoints, 4 watchpoints
Info : lpc4337.m0: hardware has 2 breakpoints, 1 watchpoints
ubuntu@ubuntu-xenial:~$ gdb Code/CIAA/firmware_v2/out/lpc4337_m4/freeRTOS_01_blinky.axf
...
Reading symbols from Code/CIAA/firmware_v2/out/lpc4337_m4/freeRTOS_01_blinky.axf...done.
(gdb) target remote localhost:3333
Remote debugging using localhost:3333
warning: Architecture rejected target-supplied description
warning: Cannot convert floating-point register value to non-floating-point type.
value has been optimized out
0x00000000 in ?? ()
(gdb)
Info : accepting 'gdb' connection on tcp/3333
undefined debug reason 7 - target needs reset
(gdb) b gpioToggleBreakpoint 1 at 0x1a0024dc: file modules/lpc4337_m4/sapi_rtos/src/sapi_gpio.c, line 310.
(gdb) c
Continuing.
Note: automatically using hardware breakpoints for read-only addresses.
Warning:
Cannot insert hardware breakpoint 1.
Could not insert hardware breakpoints:
You may have requested too many hardware breakpoints/watchpoints.
Command aborted.
Error: can't add breakpoint: resource not available
Polling target lpc4337.m4 failed, trying to reexamine
Warn : Invalid ACK 0x7 in JTAG-DP transaction
Warn : Invalid ACK 0x7 in JTAG-DP transaction
Warn : Invalid ACK 0x7 in JTAG-DP transaction
Warn : Invalid ACK 0x7 in JTAG-DP transaction
Warn : Invalid ACK 0x7 in JTAG-DP transaction
Warn : Invalid ACK 0x7 in JTAG-DP transaction
Warn : Invalid ACK 0x7 in JTAG-DP transaction
Warn : Invalid ACK 0x7 in JTAG-DP transaction
Warn : Invalid ACK 0x7 in JTAG-DP transaction
Warn : Invalid ACK 0x7 in JTAG-DP transaction
Examination failed, GDB will be halted. Polling again in 300ms
Error: Debug regions are unpowered, an unexpected reset might have happened
Buenas!Después de un par de sesiones de debug exitosas el debugging me dejo de funcionar.Para depurar hago lo siguiente. Por un levanto el openocd ejecutando make openocd. La salida parece ser normalubuntu@ubuntu-xenial:~/Code/CIAA/firmware_v2$ make openocd
Starting OpenOCD for lpc4337_m4...
Open On-Chip Debugger 0.9.0 (2017-12-31-20:04)
Licensed under GNU GPL v2
For bug reports, read
adapter speed: 2000 kHz
Info : auto-selecting first available session transport "jtag". To override use 'transport select <transport>'.
none separate
cortex_m reset_config vectreset
Info : clock speed 2000 kHz
Info : JTAG tap: lpc4337.m4 tap/device found: 0x4ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x4)
Info : JTAG tap: lpc4337.m0 tap/device found: 0x0ba01477 (mfg: 0x23b, part: 0xba01, ver: 0x0)
Info : lpc4337.m4: hardware has 6 breakpoints, 4 watchpoints
Info : lpc4337.m0: hardware has 2 breakpoints, 1 watchpoints
Luego inicio el gdb y lo conecto al OpenOCD de la siguiente maneraubuntu@ubuntu-xenial:~$ gdb Code/CIAA/firmware_v2/out/lpc4337_m4/freeRTOS_01_blinky.axf
--
-- Recibiste este mensaje porque estás suscripto al Grupo Google Embebidos32. Para postear en este grupo, escribe un email a embeb...@googlegroups.com. Para des-suscribirte, envía un email a embebidos32+unsubscribe@googlegroups.com. Para más opciones, visita el sitio del grupo en https://groups.google.com/d/forum/embebidos32?hl=es
---
Has recibido este mensaje porque estás suscrito al grupo "Embebidos32" de Grupos de Google.
Para cancelar la suscripción a este grupo y dejar de recibir sus mensajes, envía un correo electrónico a embebidos32+unsubscribe@googlegroups.com.
Para acceder a más opciones, visita https://groups.google.com/d/optout.
--
Punto, en ubuntu 16.04 (y supongo que en 14.04 y otros similares) existe el paquete gdb-multiarch (sudo apt install gdb-muliarch)Este permite depurar programas de cualquier arquitectura.Aparte, tiene añadido GDB-TUI (interfaz "grafica" de texto de GDB) que facilita bastante el seguimiento del codigo.En mi maquina, luego de hacer "make debug" lanzo esto:$> gdb-multiarch -tui out/program.elf -ex "target remote :3333" -ex "mon reset halt" -ex "load" -ex "b main" -ex "c"Y funciona perfectamente.
El 20 de marzo de 2018, 20:16, 'Carlos Pantelides' via Embebidos32 <embeb...@googlegroups.com> escribió:
salame y queso (yo)
On Tuesday, March 20, 2018 at 10:50:33 AM UTC-3, Federico Moya wrote:Claro Ruso, eso es!!! Por eso me dejo de andar de un momento a otro. Porque pase de usar el arm-none-eabi-gdb a usar el gdb del sistema. No puedo ser más salame.Infinitas gracias!!
--
-- Recibiste este mensaje porque estás suscripto al Grupo Google Embebidos32. Para postear en este grupo, escribe un email a embeb...@googlegroups.com. Para des-suscribirte, envía un email a embebidos32...@googlegroups.com. Para más opciones, visita el sitio del grupo en https://groups.google.com/d/forum/embebidos32?hl=es
---
Has recibido este mensaje porque estás suscrito al grupo "Embebidos32" de Grupos de Google.
Para cancelar la suscripción a este grupo y dejar de recibir sus mensajes, envía un correo electrónico a embebidos32...@googlegroups.com.
--
-- Recibiste este mensaje porque estás suscripto al Grupo Google Embebidos32. Para postear en este grupo, escribe un email a embeb...@googlegroups.com. Para des-suscribirte, envía un email a embebidos32+unsubscribe@googlegroups.com. Para más opciones, visita el sitio del grupo en https://groups.google.com/d/forum/embebidos32?hl=es
---
Has recibido este mensaje porque estás suscrito al grupo "Embebidos32" de Grupos de Google.
Para cancelar la suscripción a este grupo y dejar de recibir sus mensajes, envía un correo electrónico a embebidos32+unsubscribe@googlegroups.com.