You can see the wires (the two green ones) here.
The completed programming circuit for the STM32 Discovery |
If you download this file, reset the STM32 board using the black button, then run the program with the following :-
python stm32loader.py -p /dev/ttyS0
with a bit of luck it will echo back at you :
Bootloader version 22
Chip id `['0x4', '0x20']'
You may have to try a few times. It seems a little unreliable on my machine, not related to the baud rate either. The thing that seems to help is having a short gap between the reset press and running the python application.
It will sometimes echo "Can't init. Ensure that BOOT0 is enabled and reset device" back instead. I'm not sure if this is the application or the hardware.
Various possible causes spring to mind - the STM programmer interfering, the buggy USB key interfering, the circuitry being wrong.
I have found a C program which claims to do the same thing, and will experiment with that.
This comment has been removed by the author.
ReplyDeletegdb/gdbserver works with the STM32 on Windows - it is usable even on my MSI Wind Netbook. Here is what you need to do:
ReplyDeleteThe Atollic gdb server does not work as installed.
1. The server is located in
"Program Files/Atollic/TrueSTUDIO STM32 Lite 1.4.0/Servers/ST-Link_gdbserver"
ST-Link_gdbserver.bat will start the server using the config.txt file. However, this file is missing one important option: -d
Add the following lines to the end of this file:
##############################################################
# -d enable STD mode
# ############################################################
-d
From a DOS box, launch gdbserver (assuming you have the server in your path):
ST-Link_gdbserver.bat
2. The ARM tool chain is located in
"Program Files/AtollicTrueSTUDIO STM32 Lite 1.4.0/ARMTools"
This includes arm-atollic-eabi-gdb.exe.
From another DOS box launch gdb:
Program Files/AtollicTrueSTUDIO STM32 Lite 1.4.0/ARMTools/bin/arm-atollic-eabi-gdb.exe
Connect to the server using the following at the gdb command prompt
target remote localhost:61234
You should see messages on the gdbserver console indicating connection and you should see the
gdb prompt in this DOS box.
The following command will display the registers:
info regs
There are some additional options available for the gdbserver. use the -h switch to see them.
I have not tried any other tool chains yet as it take forever to build them under cygwin.
I just hacked my protoboard so I could work with this board:
ReplyDeletehttp://maujabur.blogspot.com/2010/11/stm32-discovery-pinout-fail.html
If you would like also to program the STM32F103 on the discovery board : https://sites.google.com/site/mcu314/project-updates/programalsothestm32f103onthediscoveryboard
ReplyDeleteTim - YOU ARE THE MAN! i've been tearing my hair out trying to get my discovery board doing *anything* and i was able to get gdb talking to the board with your guide. now if only i could figure out how to start sending code from atollic....
ReplyDeleteReally sorry guys, but where are the tutorials to be found?
ReplyDeletechrltn101 - here is a good tutorial for getting the stm32 discovery boards working with Linux or Mac OS X http://cu.rious.org/make/stm32f4-discovery-board-with-linux/
ReplyDelete