/var/www/restricted/ssh/stm32/www/stm32circle/ STM CircleOS forum / Linux support

Username:     
Password:     
             

Forum

# 1   2007-10-08 16:37:52 Linux support

seantellis
New member
From: Surrey, UK
Registered: 2007-10-08
Posts: 4
Website

Linux support

I have picked up a STM32 from the ARM DevCon last week, and was wondering if anyone has any tips for programming/debugging under Linux?


Sean
$1

Offline

 

# 2   2007-10-09 07:49:42 Linux support

Francis
Administrator
From: France-Grenoble
Registered: 2007-07-09
Posts: 890

Re: Linux support

Programming should be easy: the used compiler is GCC and it is available for Linux at CodeSourcery (http://www.codesourcery.com/gnu_toolcha … nload.html).

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.

Francis

Offline

 

# 3   2007-10-09 09:32:36 Linux support

seantellis
New member
From: Surrey, UK
Registered: 2007-10-08
Posts: 4
Website

Re: Linux support

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?


Sean
$1

Offline

 

# 4   2007-10-09 11:52:20 Linux support

Francis
Administrator
From: France-Grenoble
Registered: 2007-07-09
Posts: 890

Re: Linux support

We use a similar solution based on a ST (ST72651) solution. But the protocol is proprietary.

Offline

 

# 5   2008-01-27 22:44:17 Linux support

abardsley
New member
From: Manchester, UK
Registered: 2007-12-20
Posts: 2

Re: Linux support

Have a look at the project: fatfryer

Offline

 

# 6   2008-07-29 16:07:37 Linux support

seantellis
New member
From: Surrey, UK
Registered: 2007-10-08
Posts: 4
Website

Re: Linux support

I know that this is 7 months late, but thanks for the tip. I will take a look.


Sean
$1

Offline

 

# 7   2008-08-06 16:12:13 Linux support

rosbacke
New member
Registered: 2008-04-19
Posts: 1

Re: Linux support

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.

--- Mikael Rosbacke

Offline

 

# 8   2008-08-08 11:00:07 Linux support

seantellis
New member
From: Surrey, UK
Registered: 2007-10-08
Posts: 4
Website

Re: Linux support

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.


Sean
$1

Offline

 

# 9   2008-09-11 17:16:38 Linux support

andrewrogers
New member
Registered: 2008-08-26
Posts: 5

Re: Linux support

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.

Offline

 

# 10   2008-09-11 20:40:48 Linux support

andrewrogers
New member
Registered: 2008-08-26
Posts: 5

Re: Linux support

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:

http://www.rogerstech.co.uk/STM32Primer/diary.txt

I think it's best if I only post significant things here.

Offline

 

# 11   2008-09-13 14:40:03 Linux support

andrewrogers
New member
Registered: 2008-08-26
Posts: 5

Re: Linux support

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.

http://www.rogerstech.co.uk/STM32Primer/

HELP: ST7 assembler please!

Offline

 

# 12   2008-09-14 23:30:23 Linux support

andrewrogers
New member
Registered: 2008-08-26
Posts: 5

Re: Linux support

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.

Offline

 

# 13   2008-10-06 09:15:18 Linux support

sjo
New member
Registered: 2007-08-02
Posts: 1

Re: Linux support

st7 assembler is part of the st7 tools pack - it is a large download:
http://www.st.com/stonline/products/sup … oolset.exe

If you need any help on the openocd side let me know - i am  a dev on the project.

Cheers
Spen

Offline

 

# 14   2008-10-10 16:08:20 Linux support

andrewrogers
New member
Registered: 2008-08-26
Posts: 5

Re: Linux support

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?

Offline

 

# 15   2008-12-22 18:02:17 Linux support

zwieblum
Member
Registered: 2008-12-19
Posts: 68

Re: Linux support

andrewrogers, how is the status? is it possible to flash under linux ?

Offline

 

# 16   2008-12-22 20:50:34 Linux support

iar
New member
From: Saint-Petersburg, Russia
Registered: 2008-10-30
Posts: 3
Website

Re: Linux support

zwieblum, i flash 'primer' under linux over serial port. I write loader on python and solder usb->uart to primer's board.

If you want i can translate little howto to english.

Offline

 

# 17   2008-12-22 23:22:38 Linux support

zwieblum
Member
Registered: 2008-12-19
Posts: 68

Re: Linux support

Please do so. At the moment I use a win2000 image in qemu, not really funny (win2k, i mean)

Offline

 

# 18   2008-12-23 11:18:02 Linux support

iar
New member
From: Saint-Petersburg, Russia
Registered: 2008-10-30
Posts: 3
Website

Re: Linux support

zwieblum, howto with photo http://tuxotronic.org/wiki/tutorial/stm … -over-uart ;-)

$1 bootloader erases and writes the entire flash memory. How to write separate applications for the circle OS I do not know.

Offline

 

# 19   2008-12-23 13:21:40 Linux support

Francis
Administrator
From: France-Grenoble
Registered: 2007-07-09
Posts: 890

Re: Linux support

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.

Offline

 

# 20   2009-01-07 23:44:16 Linux support

Robster
New member
From: Christchurch, New Zealand
Registered: 2007-10-19
Posts: 4
Website

Re: Linux support

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.

Offline

 

# 21   2009-01-08 00:21:08 Linux support

iar
New member
From: Saint-Petersburg, Russia
Registered: 2008-10-30
Posts: 3
Website

Re: Linux support

Robster, thanx you. It really working smile

Offline

 

# 22   2009-01-08 00:44:28 Linux support

Robster
New member
From: Christchurch, New Zealand
Registered: 2007-10-19
Posts: 4
Website

Re: Linux support

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!

Offline

 

# 23   2009-01-08 13:25:01 Linux support

zwieblum
Member
Registered: 2008-12-19
Posts: 68

Re: Linux support

Robster, good to hear!

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

Offline

 

# 24   2009-01-08 20:07:43 Linux support

Robster
New member
From: Christchurch, New Zealand
Registered: 2007-10-19
Posts: 4
Website

Re: Linux support

Ah, yes: I had kinda forgotten that OpenOCD isn't familiar to some people smile

The short answer is, that you need to specify an interface and a target. the following should work:

Code:

openocd -f interface/rlink.cfg -f board/stm32f10x_128k_eval.cfg

Once OpenOCD is running, you can telnet to it on port 4444 for programming operations:

Code:

telnet localhost 4444

typing 'help' will give a list of commands to erase/write the flash, start and stop the CPU, etc.

OpenOCD is also a gdb frontend, so you can start up gdb and connect to it on port 3333:

Code:

arm-none-eabi-gdb
target remote :3333

The longer answer is, I'm putting together some documentation for OpenOCD and STM32-Primer, I'll let you know when it's done.

Hope this helps!

Offline

 

# 25   2009-01-22 22:16:23 Linux support

zwieblum
Member
Registered: 2008-12-19
Posts: 68

Re: Linux support

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 big_smile

I don't know what I'll do with primer2, but i'm sure there is a way ...

Offline

 

Board footer