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

Username:     
Password:     
             

Forum

# 26   2009-02-12 22:52:23 Linux support

lko
New member
Registered: 2008-01-11
Posts: 2

Re: Linux support

Hi zwiebum,
can you please decribe what steps (i.e commands) do you performed to flash primer with openocd? i'm also new to openocd - i was able to connect but do not kown how to flash primer.

thanks in advance.

Offline

 

# 27   2009-02-13 09:39:11 Linux support

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

Re: Linux support

Ok, let's assume you have a compiled program - probably Circle.hex - in your working folder. primer1 is connected, openocd is runnung. telnet to openocd with

Code:

telnet localhost 4444

Get som info about primer flash (optional, but nice too see)

Code:

flash probe 0

stm32x is locked after boot, so unock it:

Code:

stm32x unlock 0

Now you can flash your hex file:

Code:

flash write_image erase /<adsolute_path>/Circle.hex

If command sometimes fails, just retry both lines. Now you can start gdb to debug the program:

Code:

> arm-elf-gdb Circle.elf
(gdb) target remote localhost:3333
(gdb) monitor reset
(gdb) step
...

gdb sends commands with "monitor" prefix directly to openocd, so the "monitor reset" will be "reset".

Here's a console dump from the beginning of a gdb session:

Code:

zwieblum@debian:/home/entwicklung/stm32/versuche/ourdev_190912/RIDE-mit-CircleOS-3.3/Circle/OS> arm-elf-gdb Circle.elf
GNU gdb 6.8
Copyright (C) 2008 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=i686-pc-linux-gnu --target=arm-elf"...
(gdb) target remote localhost:3333
Remote debugging using localhost:3333
HardFaultException () at stm32f10x_circle_it.c:46
46          {
(gdb) monitor reset
JTAG tap: stm32.cpu tap/device found: 0x3ba00477 (Manufacturer: 0x23b, Part: 0xba00, Version: 0x3)
JTAG Tap/device matched
JTAG tap: stm32.bs tap/device found: 0x16410041 (Manufacturer: 0x020, Part: 0x6410, Version: 0x1)
JTAG Tap/device matched
target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x21000000 pc: 0x080004d0

(gdb) step
TIM2_IRQHandler () at stm32f10x_circle_it.c:157
157         {
(gdb) step
TIM2_IRQHandler () at stm32f10x_circle_it.c:159
159         GPIO_WriteBit( GPIOA, GPIO_Pin_7, Bit_RESET );
(gdb) break main
Breakpoint 1 at 0x80003f2: file main.c, line 83.

Happy coding :-)

Last edited by zwieblum (2009-02-13 10:27:05)

Offline

 

# 28   2009-02-22 12:46:55 Linux support

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

Re: Linux support

Debugging with DDD and gdb: same setup as in last posting. just start ddd instead of gdb with these commands:

Code:

ddd --eval-command="target remote localhost:3333" --debugger arm-elf-gdb Circle.elf

Offline

 

# 29   2009-03-02 09:50:31 Linux support

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

Re: Linux support

pramode has put documentation on his site  http://wiki.fosstronics.com/arm_cortex- … -c-program ( see this post for more text:   http://www.stm32circle.com/forum/viewtopic.php?id=554 ) - so I suggest you go there. I'll put my stuff on his site, too :-)

Offline

 

# 30   2009-07-16 14:06:23 Linux support

royer_k
New member
Registered: 2009-03-01
Posts: 4

Re: Linux support

I have built CircleOS 3.7 for Primer 2 under linux.

I have makefiles etc if you would like a copy.

Still no way to burn to Primer2 - have to use windows machine for the flash bit....

Offline

 

# 31   2009-07-16 15:40:02 Linux support

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

Re: Linux support

Well done :-)

Can you post the Makefile(s) and linker scripts?

AFAIK there is nobody working on SDW now, so there will probably be no way to use Primer2 under Linux for the next months (more likley years). I've already donated mine to a interested person. Maybe Primer3 will have JTAG again, but I do not think so.

Offline

 

# 32   2009-09-29 16:57:11 Linux support

paulfertser
Member
Registered: 2009-09-20
Posts: 13

Re: Linux support

Hey. Unfortunately, i can't provide any solution but i want to make you aware of more useful links. I guess that a bright person can add an ad-hoc support for SWD over rlink in a matter of one day of hacking:

Here's an ad-hoc patch that makes SWD work over ft2232:
https://lists.berlios.de/pipermail/open … 03742.html

Here's some information about rlink reversing history (not really useful but interesting):  http://lists.berlios.de/pipermail/openo … 04082.html

Now all it takes one to ad ad-hoc support is to port SWD patch to rlink support already present in OpenOCD (the code is quite understandable). It'll not be accepted by mainline of course because it'll lack abstraction but at least it will give a way to flash primer2's without hardware mods.

HTH

Offline

 

# 33   2010-08-18 07:21:42 Linux support

Nail
New member
Registered: 2010-08-18
Posts: 1

Re: Linux support

Lolx..smile


..

Offline

 

# 34   2010-10-04 01:28:56 Linux support

Kybertech
New member
Registered: 2010-05-12
Posts: 5

Re: Linux support

paulfertser :

Here's an ad-hoc patch that makes SWD work over ft2232:
https://lists.berlios.de/pipermail/open … 03742.html

Well thanks but this seems to be based on a pre 0.1.0 version of openocd which is no longer available, there is to way to get it. Or maybe over git form this not very sympathetic berlios site? (sf ripoff imo)
The problem with swd is quite frankly it's an ARM solution for ARM Architectures and nobody else uses it while JTAG rules it all. Strange world...

Oh btw, I had a quick into the the SWD Specification, and there are several ways the protocol can be used. There are several sub interfaces, ``Debug and  Access Ports" in the whole SWD Protocol, among them a Common, a JTAG and native SWD variant. So until we know how SWD is done in the Primer2 I think this might be a futile attempt
Besides implementing everything in the specification from scratch and trying every Method possible.

$1

Last edited by Kybertech (2010-10-04 03:06:52)

Offline

 

Board footer