2013-07-08 05:53 AM
Hi guys, i need to program a stm32f0 mcu using a serial cable.
At this moment i'm using an external St-link device.Can i use only a serial cable without st-link (e.g. over hyper terminal)? #uart2013-07-08 07:16 AM
Depends what you mean. Hyper Terminal is probably not a fantastic vehicle to do it.
You can write your own code to do anything you want, the IAP examples for the STM32 series in general use a Y-Modem protocol, but you could use something else. To use the System Loader (BOOT0=High) you're going to have to use something like the Flash Demonstrator application, which implements a unique protocol to program a blank chip. This is not compatible with a terminal application.2013-07-09 01:14 AM
I have python script written (adjusted stm32loader) for this, but its for:
# these come from AN2606 chip_ids = { 0x412: ''STM32 Low-density'', 0x410: ''STM32 Medium-density'', 0x414: ''STM32 High-density'', 0x420: ''STM32 Medium-density value line'', 0x428: ''STM32 High-density value line'', 0x430: ''STM32 XL-density'', 0x416: ''STM32 Medium-density ultralow power line'', 0x411: ''STM32F2xx'', 0x413: ''STM32F4xx'', } If you find your chip in this documentation, then this is what you're looking for.2013-07-09 07:19 AM
well, my mcu code is : STM32F051R8T6.
Datasheet says ''Low and Medium density...''Anyway in AN2606 (page 80) we can read that the STM32F051xx device is supported.Well, can you describe me the programming phase step by step, please?Thanks a lot.2013-07-09 07:55 AM
This will tell you everything you need: https://github.com/jsnyder/stm32loader
I will upload my code there when I am sure I got everything made as it should.2013-07-09 11:44 PM
Well, can you describe me the programming phase step by step, please?
It's detailed in AN3155
2013-08-29 02:57 AM
2013-08-29 03:02 AM
thanks for the script, but there are some problem
using the seguent commandpython ''path''/stm32loader.py -e -w -v myprogram.binit says ''Can't init. May be already running?''Do you can help me, please?thanks2013-08-29 06:50 AM
Hm, ok first of that python at start is not needed because script already has
#!/usr/bin/env python
. All you need to do is chmod +x it, to get it executeable. Next you will have to run it as superuser so sudo ... I cant find your error message anywhere so I will assume it comes from one of error prints. It could mean that you already have something running on that serial/USB port that you are wanting to flash through (although again your command does not tell which USB port to use, so I will assume you've changed the config).2013-08-30 12:21 AM
Goodmorning, sorry but i used a different script, it's stm32loader.py from tuxotronic website.
Anyway i've overwrite the script, and now the message is:''Can't init. Ensure that BOOT0 is enabled and reset device.''But Boot0 is enabled, i'm sure because if disable it starts old code in my board.And i'm so sure about the cable correct work, because in other applications i use it for send and receive commands on other terminals.