ST-Link V2 on Linux/OSX/Windows
- DeusExMachina
- Posts: 223
- Joined: Tue Apr 03, 2012 5:08 am
- Has thanked: 3 times
- Been thanked: 3 times
Re: ST-Link V2 on Linux/OSX/Windows
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
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
- DeusExMachina
- Posts: 223
- Joined: Tue Apr 03, 2012 5:08 am
- Has thanked: 3 times
- Been thanked: 3 times
- DeusExMachina
- Posts: 223
- Joined: Tue Apr 03, 2012 5:08 am
- Has thanked: 3 times
- Been thanked: 3 times
Re: ST-Link V2 on Linux/OSX/Windows
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...
- Giovanni
- Site Admin
- Posts: 14894
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: ST-Link V2 on Linux/OSX/Windows
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
Giovanni
Re: ST-Link V2 on Linux/OSX/Windows
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
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
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
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
- DeusExMachina
- Posts: 223
- Joined: Tue Apr 03, 2012 5:08 am
- Has thanked: 3 times
- Been thanked: 3 times
Re: ST-Link V2 on Linux/OSX/Windows
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...
- DeusExMachina
- Posts: 223
- Joined: Tue Apr 03, 2012 5:08 am
- Has thanked: 3 times
- Been thanked: 3 times
Re: ST-Link V2 on Linux/OSX/Windows
today I downloaded latest openocd and, voila - it works with F4!
I start it
In Eclipse startup
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!
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
runso 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
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
I'm sure it can be improved. I used the ST library so it's pretty easy to modify.
Thanks!
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
I'm sure it can be improved. I used the ST library so it's pretty easy to modify.
Thanks!