Page 10 of 12

Re: ST-Link V2 on Linux/OSX/Windows

Posted: Wed Feb 20, 2013 2:28 pm
by DeusExMachina
may be i should try old version of toolchain...

Re: ST-Link V2 on Linux/OSX/Windows

Posted: Wed Feb 20, 2013 4:19 pm
by alex31
did you enable IWDG (independant watchdog) on your project ?

I have had problem with that, unless a special bit is set to make the IWDG stop during debug or flashing, IWDG continue
to count, and reset the MCU during debug of flashing, with nasty consequences.

Probably not the problem for you, but since i have fight several day with that ...

Alexandre

Re: ST-Link V2 on Linux/OSX/Windows

Posted: Wed Feb 20, 2013 5:27 pm
by DeusExMachina
I swiched off watchdog, so this is not a reason

Re: ST-Link V2 on Linux/OSX/Windows

Posted: Sat Feb 23, 2013 4:37 am
by DeusExMachina
After all, I have to switch to Windows (Atollic gdb server + Eclipse). All toolchain combinations and st-link firmware combinations failed in debugging in Linux... Sadly, my project lost a week for my investigations...

Re: ST-Link V2 on Linux/OSX/Windows

Posted: Sat Feb 23, 2013 8:22 am
by Giovanni
Strange, it works for me. Note that you have to do an USB related setting in the system, it is described in the OOCD manual.

Giovanni

Re: ST-Link V2 on Linux/OSX/Windows

Posted: Fri Mar 01, 2013 11:14 am
by mobyfab
Hey,

I am currently making a lot of changes, and the current SVN version does not work yet. (FLASH_SR PGAERR bit error...)

The latest stable version is R75 and only supports STM32F4.

I'll let you know when it get the new code working. It'g going to be a lot better and support all STM32 devices :)

Re: ST-Link V2 on Linux/OSX/Windows

Posted: Sat Mar 02, 2013 7:30 pm
by mobyfab
Okay last revision works with the F4.

For the F0 I'm making a flash loader program that will run from ram.
The STLink can only write 8 or 32 bits at a time but the flash programming requires 16 bits, so a flash loader is needed.
This is also how the official tool works. I expect the loader method to be quite faster.

Also you can now verify the binary against the flash memory :)

Re: ST-Link V2 on Linux/OSX/Windows

Posted: Thu Mar 28, 2013 10:45 am
by DeusExMachina
It is interesting that I can use st-util in Linux in non-chibios apps successfully. I can debug bare applications, or apps using FreeRTOS without problems...

Re: ST-Link V2 on Linux/OSX/Windows

Posted: Sun Mar 31, 2013 2:31 pm
by DeusExMachina
today I downloaded latest openocd and, voila - it works with F4!
I start it

Code: Select all

openocd -f /usr/local/share/openocd/scripts/board/stm32f4discovery.cfg -c "stm32f4x.cpu configure -rtos auto;"

In Eclipse startup

Code: Select all

file /home/../build/ch.elf
monitor reset halt
load
monitor reset halt
run

so I get a normal flash process and debugging
A texain st-link has a SERIOUS BUG!!! It brokes a flash during transmission (esspesially a big one). Dont use it!

Re: ST-Link V2 on Linux/OSX/Windows

Posted: Wed Apr 03, 2013 6:24 pm
by mobyfab
Hey guys,

I just finished updating Qstlink2 with some flash loaders, it works with the F0 now. (Revision 104)

I will test the F4 tonight and push some fixes if needed.

Could you guys test with other MCUs such as the F1/2/3 ? They all have a loader.
I will make the windows exe available tonight, for the ubuntu package it is available already.

By the way if someone could review the flash loader that would be cool, since it's not super clean code :D
I'm sure it can be improved. I used the ST library so it's pretty easy to modify.

Thanks!