ojijoni 0 Posted October 26, 2012 Share Posted October 26, 2012 UPDATE: I was using the yagarto toolchain, with the ARM GCC toolchain i do not have this problem. I have got the following error: in GDB console (gdb) target remote :3333 Remote debugging using :3333 Remote 'g' packet reply is too long: 0000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000007c454c46ffffffff010 10100000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000 and in opendocd console i see: Open On-Chip Debugger 0.7.0-dev-00062-g170c851 (2012-10-25-22:34) Licensed under GNU GPL v2 For bug reports, read http://openocd.sourceforge.net/doc/doxygen/bugs.html adapter speed: 1000 kHz Info : clock speed 1000 kHz Info : ICDI Firmware version: 9270 Info : lm4f23x.cpu: hardware has 6 breakpoints, 4 watchpoints target state: halted target halted due to debug-request, current mode: Thread xPSR: 0x01000000 pc: 0x00010100 msp: 0x464c457c Info : accepting 'gdb' connection from 3333 Warn : acknowledgment received, but no packet pending Info : dropped 'gdb' connection I am building the blinky code in the TI supplied stellarisware software. Computer: 64 bit windows 7 BTW: I did flash the device with "LM Flash programmer" , i suppose that does not mater. Quote Link to post Share on other sites
ntfreak 0 Posted October 26, 2012 Author Share Posted October 26, 2012 That has been a known OpenOCD issue for a while - it is on my todo list. It does depend on what gdb you use, however the fix is here: http://www.mail-archive.com/openocd-development@lists.berlios.de/msg18182.html Spen Quote Link to post Share on other sites
ntfreak 0 Posted October 26, 2012 Author Share Posted October 26, 2012 I have just updated the windoze binaries, fixing a very obscure timeout issue - no functional changes. Same url as before: https://docs.google.com/uc?export=download&id=0Bzv7UpKpOQhnQTcwWU9PcFNEU00 Spen bluehash 1 Quote Link to post Share on other sites
ojijoni 0 Posted October 26, 2012 Share Posted October 26, 2012 Does not seem to break a second time at a breakpoint. Code snip from the blinky example. while(1) { // // Turn on the LED. // GPIO_PORTF_DATA_R |= 0x08; // // Delay for a bit. // for(ulLoop = 0; ulLoop < 200000; ulLoop++)//break point is here { } // // Turn off the LED. // GPIO_PORTF_DATA_R &= ~(0x08); // // Delay for a bit. // for(ulLoop = 0; ulLoop < 200000; ulLoop++) { } } What is do is: GNU gdb (GNU Tools for ARM Embedded Processors) 7.3.1.20110908-cvs Copyright (C) 2011 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "--host=i586-mingw32 --target=arm-none-eabi". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>... Reading symbols from C:\Misc\StellarisWare\boards\ek-lm4f120xl\blinky\gcc/blinky .axf...done. (gdb) target remote :3333 Remote debugging using :3333 ResetISR () at startup_gcc.c:251 251 for(pulDest = &_data; pulDest < &_edata; ) (gdb) break blinky.c:78 Breakpoint 1 at 0x284: file blinky.c, line 78. (gdb) monitor halt reset Invalid command argument halt [milliseconds] lm4f23x.cpu arp_halt lm4f23x.cpu arp_halt_gdb reset [run|halt|init] soft_reset_halt wait_halt [milliseconds] in procedure 'halt' (gdb) c Continuing. Note: automatically using hardware breakpoints for read-only addresses. Breakpoint 1, main () at blinky.c:78 78 for(ulLoop = 0; ulLoop < 200000; ulLoop++) (gdb) c Continuing. I was expecting that it breaked very very often , but is does not it just continues. Quote Link to post Share on other sites
geoffreymbrown 0 Posted October 26, 2012 Share Posted October 26, 2012 Thanks, we all really appreciate your efforts! I used this as my cfg file: # # TI Stellaris Launchpad ek-lm4f120xl Evaluation Kits # # http://www.ti.com/tool/ek-lm4f120xl # # # NOTE: using the bundled ICDI interface is optional! # This interface is not ftdi based as previous board were # source [find interface/ti-icdi.cfg] set WORKAREASIZE 0x4000 set CHIPNAME lm4f120h5qr source [find target/stellaris_icdi.cfg] Flashing code, setting breakpoints, triggering breakpoints, 'step', 'finish', and 'next' all seemed to work great. I wasn't able to get watchpoints working. Should watchpoints work OK? -rick Breakpoints work ? When I look at the git repository, the file /ti_icdi_usb.c contains no code to set or clear breakpoints. Quote Link to post Share on other sites
ntfreak 0 Posted October 26, 2012 Author Share Posted October 26, 2012 Breakpoints work ? When I look at the git repository, the file /ti_icdi_usb.c contains no code to set or clear breakpoints. The code to set breakpoints is in target/cortex_m.c Spen Quote Link to post Share on other sites
Rickta59 589 Posted October 26, 2012 Share Posted October 26, 2012 I have got the following error: in GDB console (gdb) target remote :3333 Remote debugging using :3333 Remote 'g' packet reply is too long: 0 ..... Sorry, yeah I had already patched my openocd so it would work with the stm32 chips. I'm also using a version of yagarto. -rick Quote Link to post Share on other sites
ntfreak 0 Posted October 26, 2012 Author Share Posted October 26, 2012 Does not seem to break a second time at a breakpoint. Code snip from the blinky example. while(1) { // // Turn on the LED. // GPIO_PORTF_DATA_R |= 0x08; // // Delay for a bit. // for(ulLoop = 0; ulLoop < 200000; ulLoop++)//break point is here { } // // Turn off the LED. // GPIO_PORTF_DATA_R &= ~(0x08); // // Delay for a bit. // for(ulLoop = 0; ulLoop < 200000; ulLoop++) { } } What is do is: GNU gdb (GNU Tools for ARM Embedded Processors) 7.3.1.20110908-cvs Copyright (C) 2011 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "--host=i586-mingw32 --target=arm-none-eabi". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>... Reading symbols from C:\Misc\StellarisWare\boards\ek-lm4f120xl\blinky\gcc/blinky .axf...done. (gdb) target remote :3333 Remote debugging using :3333 ResetISR () at startup_gcc.c:251 251 for(pulDest = &_data; pulDest < &_edata; ) (gdb) break blinky.c:78 Breakpoint 1 at 0x284: file blinky.c, line 78. (gdb) monitor halt reset Invalid command argument halt [milliseconds] lm4f23x.cpu arp_halt lm4f23x.cpu arp_halt_gdb reset [run|halt|init] soft_reset_halt wait_halt [milliseconds] in procedure 'halt' (gdb) c Continuing. Note: automatically using hardware breakpoints for read-only addresses. Breakpoint 1, main () at blinky.c:78 78 for(ulLoop = 0; ulLoop < 200000; ulLoop++) (gdb) c Continuing. I was expecting that it breaked very very often , but is does not it just continues. try using 'monitor reset halt' rather than 'monitor halt reset'. As a side note it is often safer to use 'monitor reset init'. this does the same as reset halt except it will call any registered reset scripts - if any. you may also use extended remote rather than remote, then you have access to the gdb start/run cmd's that will perform a reset and set a breakpoint on main automatically. so use target extended-remote :3333 rather than target remote :3333 Spen Quote Link to post Share on other sites
ojijoni 0 Posted October 29, 2012 Share Posted October 29, 2012 Cool, yes it works as you discribe it above (i have to study more on gdb). TNX Quote Link to post Share on other sites
tschwarz 0 Posted November 4, 2012 Share Posted November 4, 2012 When running openocd for the ek-lm4f120xl : openocd -s ~/lib/openocd/tcl -f board/ek-lm4f120xl.cfg I get: Error: The specified debug interface was not found (hla) A search on that error turns up empty. Anybody know how this could be fixed? Thomas Quote Link to post Share on other sites
ntfreak 0 Posted November 5, 2012 Author Share Posted November 5, 2012 When running openocd for the ek-lm4f120xl : openocd -s ~/lib/openocd/tcl -f board/ek-lm4f120xl.cfg I get: Error: The specified debug interface was not found (hla) How did you build OpenOCD, you will need to pass --enable-ti-icdi to configure Spen Quote Link to post Share on other sites
scompo 0 Posted November 7, 2012 Share Posted November 7, 2012 Got it working. Really nice to use, great job and really useful! I've made a tutorial on how to build openocd and debug a simple code in gdb, if anyone it's interested it's here. bluehash, Martytoof and XTL 3 Quote Link to post Share on other sites
tschwarz 0 Posted November 18, 2012 Share Posted November 18, 2012 scompo & spen, Thanks alot for helping out - I'm up and running now! Scompo's tutorial did the trick ... Quote Link to post Share on other sites
doragasu 0 Posted November 18, 2012 Share Posted November 18, 2012 Thanks a lot for all the work getting this working! It's really nice to be able to develop for this board using only free tools! I'd love to set up these tools for debugging, but I'm too noobish to get it done without some more hints about the process Right now I have the cross compiler and lmtools working. Building programs and flashing them works perfect. But I don't know how to continue. Reading this thread, it looks like I have to compile a patched version of openocd... where can I find it? Quote Link to post Share on other sites
miceuz 0 Posted November 18, 2012 Share Posted November 18, 2012 Is there a way to mask interrupts while stepping? I'm trying to debug a USB CDC enabled code. After a breakpoint I try stepping and end up in USB0DeviceIntHandler. I've seen some posts about cortex_m3 maskint, but it seems this command is not available (nor applicable) in this patched version on OpenOCD. gdb) next Single stepping until exit from function USBRingBufUsed, which has no line number information. 0x00001dfc in USB0DeviceIntHandler () Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.