At the moment, debugging (and FLASH programming) is only possible with the Raisonance tools (Windows application). There is no external JTAG/SWD connection, and the embedded USB-JTAG controller is driven only by Raisonance.
Thanks. I noticed the GCC part, and I thought that the USB/JTAG might be controlled by something semi-standard, like a FTDI FT2232C chip.
Unfortunately, I don't have any Windows boxes at home. Anyone from Raisonance reading this board, and willing to share the protocol information for the programmer?
FWIW I tried running a windows instance using kvm under Ubuntu 8.04 (has easy setup of virtual boxes). Installed RIDE7. After a bit of research I managed to get kwm to forward USB ports to the virtual windows machine. It allowed me to at least flash a program to my Primer. The emulation was to slow for me but that's probably caused by me running a 32 bit OS under 64 bit host OS. Just got my 'Wow cool' kick but didn't pursue it any further. I lost that installation now though.
I didn't take the VM route because it still requires a valid license for Windows, which I don't have. But it sounds like a good workaround if you have an old license lying around.
I would like to reprogram the ST7 that forms the core of the RLink JTAG interface. My plan:
1) instal fatfryer 2) make a STM32 hosted ICC programmer for the ST7 and connect the IO pads of the STM32 to the 6 pin ICC header of the ST7. All these pads are easy to get at. Will need 12 Vpp? 3) Write a new JTAG driver and program it to the ST7 via the STM32 programmer created in step 2. There will also be hooks for upgrades.
I would like a free assembler for ST7, so if anyone knows of one, please let me know.
I thought about writing data to the RLink using libusb to see what happens. So far I have established that there are just four endpoints by looking at the descriptors. For those few people that wish to follow this they can find more info on:
I have managed to get some simple code running on the ST7 without flashing it which means I can now write my own JTAG kernel into the ST7 and make it compatible with OpenOCD. However I really do want a ST7 assembler, I had to hand assemble the simple 'adding' program. As the JTAG kernel will run from RAM the flash is unaltered, RLink should still work with Ride. Don't have Windows so can't confirm it.
Found that the ST7 is nearly machine code compatible with HC08, there are a few differences in the extended instructions. Assuming the ST7 is a HC08 is working OK for me so far. I am using the as-hc08 assembler from the sdcc.
The SDCC HC08 assembler has served me well. I have almost completed the kernel that runs on the ST7 and can now get the IDCODE from the STM32 via JTAG. I am now working on the OpenOCD driver, I have copied the ft2232 driver and am modifying it. I could have written the kernel to be FTDI2232 compatible but didn't want to copy it so I produced my own command protocol called "ARJtag". If ever I make my own JTAG adapter (using a different micro) I intend using the same protocol. A layout called "rlink" will be added to the arjtag driver. I will post the kernel and protocol spec very soon so that you can play. If I get stuck with OpenOCD I will be in contact! Many thanks
Andrew PS. Are you using the STM32Primer with OpenOCD? If so, by what means?
When you write applications for CircleOS, you have to use circle_mgr.exe to load them. In this case, the previous applications (and CircleOS) are kept. Circlle_mgr.exe only program additional applications in the available space, and it does not erase the FLASH.
A bit late I guess, but OpenOCD on Linux now supports the STM32-Primer. It "should" support RLink in general, but there are still things we're working on there. Also it doesn't work properly on Windows, not sure why that is but again we'll look into it.
It'd be best to compile OpenOCD from svn, because I'm not sure if the rlink support has made it into an official tarball yet. Don't forget to use the "--enable-rlink" option for configure.
The Primer2 uses SWD instead of JTAG, and OpenOCD doesn't support SWD yet. At some point in the future it will be supported, but at this point I have no idea when.
You're welcome, but I wouldn't want to take all the credit. In fact, my part was relatively minor. You can read the OpenOCD mailing list archives if you want more of the story.
Please leave feedback (good or bad), either here or on the OpenOCD mailing list!
Is there somewhere a how to get started guide with openocd on stm32primer? Reason is, I have never used OpenCD before and do not quite know how to start. OpenOCD (svn version, "--enable-rlink" ) compiled fine, but what to do next?
When I run
openocd -f target/interface/rlink.cfg
I get this errors & warnings:
Error: There are no enabled taps? Error: There are no enabled taps? Warn : no telnet port specified, using default port 4444 Warn : no gdb ports allocated as no target has been specified Warn : no tcl port specified, using default port 6666
Small success story: I successfully compiled circleos-3.3 on debian using gcc 4.3.1 (the original from gnu, not codesourcery) and flased it with openocd on primer1 .. and it works
I don't know what I'll do with primer2, but i'm sure there is a way ...