I have a Luminary/TI EKK-LM3S9B96 eval board and just got openOCD 0.4.0 from http://www.freddiechopin.info/ (thank you for providing binaries by the way). Initially, I couldn’t get openOCD to find my board although the TI programmer would work. So I tried removing the TI USB driver and installed the USB driver in the openOCD package. Now openOCD is happy and I can debug, but now the TI programmer no longer finds the board! So, I wanted to use openOCD to flash the micro. I used to do this with an old version of openOCD, but the .cfg files appear to be incompatible.
I’ve looked thru the openOCD user guide, and while I could probably get it working in a few days after much frustration, surely someone else has done this already. I just want to execute a command, and have it program a .bin file hardcoded in the .cfg file. Can anyone help me out with this? Whether I use the TI programmer or openOCD I don’t care.
write a basic script which would look something like this:
reset halt
flash write_image erase filename.bin
There is a chance that you’d need to add a new option to pad the erased area to sector boundary and an offset if the flash in your microcontroller does not start at address 0.
Freddie Chopin:
write a basic script which would look something like this:
reset halt
flash write_image erase filename.bin
There is a chance that you'd need to add a new option to pad the erased area to sector boundary and an offset if the flash in your microcontroller does not start at address 0.
4\/3!!
Thanks for replying. I’m a little confused…what else would I need in the .cfg file? I tried putting the two lines you gave me into the existing ek-lm3s9b9x.cfg, and upon running it it says "
invalid command name “reset”
I also tried “flash info 0” and “flash erase_address 0 0 255”, but every command that requires arguments complains “command requires more arguments”.
I assume I have to use “flash bank” first to configure it, which is in the included .cfg files. The other thing is, I already have scripts from an older version of openOCD that worked with a different Luminary micro, but not this one, and those old scripts have commands that 0.4.0 doesn’t seem to understand.
I guess what I’m asking is, since I can debug with the included .cfg files, is where would I add flash commands? It doesn’t seem to like them anywhere I add them into the existing .cfg files.
You should not embed any “non-config” commands in the cfg files. You should create your procedure, by enclosing any “non-config” commands like this:
proc name_of_your_procedure {} {
<commands>
}
Than you can run the procedure:
from gdb with "monitor name_of_your_procedure
from telnet with “name_of_your_procedure”
from command line with openocd "openocd … -c “init” -c “name_of_your_procedure”
you can also just do "openocd … -c “init” -c “command1” -c “command2” …
If you want your procedure to be automatically executed when your configs are parsed you need to add “init” BEFORE any “non-config” commands, but AFTER all “config” commands:
<config commands of the script>
init
name_of_your_procedure # or just various commands
And for future - it you’re talking about some non-working scripts it would be easier for both of us if you’d just post them along with the errors you get when executing those.
Freddie Chopin:
You should not embed any “non-config” commands in the cfg files. You should create your procedure, by enclosing any “non-config” commands like this:
proc name_of_your_procedure {} {
<commands>
}
Than you can run the procedure:
from gdb with "monitor name_of_your_procedure
from telnet with "name_of_your_procedure"
from command line with openocd "openocd ... -c "init" -c "name_of_your_procedure"
you can also just do "openocd ... -c "init" -c "command1" -c "command2" ...
If you want your procedure to be automatically executed when your configs are parsed you need to add "init" BEFORE any "non-config" commands, but AFTER all "config" commands:
init
name_of_your_procedure # or just various commands
And for future - it you're talking about some non-working scripts it would be easier for both of us if you'd just post them along with the errors you get when executing those.
4\/3!!
Ahh, I see, that’s what I was missing. That’s why it wouldn’t take my commands.
I didn’t have any new scripts, I was simply trying to add these commands to the existing ones in openOCD. Thanks for the help!
I build openocd myself following this tutorial : http://wiki.openpilot.org/OpenOCD_Compile_on_x86 but I use FTDI drivers present on the CD provided with the kit TI_software_doc\Tools\FTDI and I modified the ek-lm3s9b9x.cfg file in C:\Program Files\OpenOCD\0.4.0\board folder to create an ek-lm3s9b96.cfg
d/ek-lm3s9b9x.cfg Open On-Chip Debugger 0.4.0 (2010-02-22-19:05) Licensed under GNU GPL v2 For bug reports, read http://openocd.berlios.de/doc/doxygen/bugs.html Warn : Interface already configured, ignoring 500 kHz jtag_nsrst_delay: 100 srst_only separate srst_gates_jtag srst_open_drain Error: unable to open ftdi device: device not found Command handler execution failed
I got OpenOCD 0.4.0 for Windows. An msi installer of complete package and it’s md5 checksum. Due to alleged GPLv2 license incompatibility of using ftd2xx.dll libraries, this version was compiled to use libftdi + libusb-win32 libraries.
Then delete previous FTDI driver from Stellaris distribution with FTClean.
Then unpack libusb-win32_ft2232_driver-100223.zip, plug usb on, install Luminary Micro Stellaris LM3S811 Evaluation Kit (Channel A), Second channel is not installed, serial port is not installed.
I am facing the same problem. :oops: The project is built successfully but the debugging fails saying “Error: unable to open ftdi device: device not found”. I have openOCD v0.4.0…will openOCD v0.5.0 solve my problrm?? I am eager to see the breakpoints and registers…Somebody HELP…!!
When I try flash and debug with some version of the OpenOCD. I found that version 0.5.0 can connect to stellaris core and flash binary image.
Open On-Chip Debugger 0.5.0 (2011-12-21-14:30)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.berlios.de/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
500 kHz
Info : clock speed 500 kHz
Info : JTAG tap: lm3s9b9x.cpu tap/device found: 0x4ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x4)
Info : lm3s9b9x.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : accepting 'telnet' connection from 4444
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x21000000 pc: 0x00000174 msp: 0x200000fc
auto erase enabled
wrote 1024 bytes from file /tmp/blinky.bin in 0.454855s (2.199 KiB/s)
500 kHz
cortex_m3 reset_config vectreset
Info : JTAG tap: lm3s9b9x.cpu tap/device found: 0x4ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x4)
Warn : Only resetting the Cortex-M3 core, use a reset-init event handler to reset any peripherals
I get latest git, switch it to v0.5.0 tag. Make and make install.
Right now I didn’t understand work it or not because test source is not working.
Ok, it’s not just me, then. OpenOCD 0.50 here, and it won’t connect to my Stellaris EK-LM3S3749 board (thankfully LMFlash works and I can watch debug spew in Hyperterminal).
I’ll try dropping back to 0.40 and see if that helps.