cancel
Showing results for 
Search instead for 
Did you mean: 

Flash Loader Demonstrator v2.1.0 RTS/DTR control issue

swhite
Associate III
Posted on December 24, 2009 at 00:34

Flash Loader Demonstrator v2.1.0 RTS/DTR control issue

#stm32-flash-bootloader
10 REPLIES 10
swhite
Associate III
Posted on May 17, 2011 at 13:32

I'm trying to use ST's STMFlashLoader.exe program, which comes with the

http://www.st.com/stonline/products/support/micro/files/um0462.zip

package. I've successfully been able to use STMFlashLoader.exe out of the package (without recompiling etc) to load code/data into a blank STM32F processor.

On my hardware I've connected the RS232 RTS and DTR signals to NRST and BOOT0 (with appropriate level shifting etc) so that a PC application can completely control the loading of the application without manual user intervention (i.e. jumper on the BOOT0 signal) for manufacturing/testing purposes.

However I've run into a problem in that the RTS/DTR signals seem to be controlled within the STUARTBLLIB.dll (for which source code code in NOT provided!) via the Win32 EscapeCommFunction() API rather than the setRts()/setDtr() functions in STBLLIB.dll (for which source IS provided). I say ''seem to be'' because I changed/recompiled STBLLIB.dll with setRts()/setDtr() stubbed out (i.e. do nothing) and yet the RTS signal still toggles. I know this isn't done in the main program (STMFlashLoader.cpp) because I've checked.

Therefore is it possible for someone with access to the STUARTBLLIB.dll source code to determine if RTS/DTR are controlled directly (why?????).

akaiser9
Associate II
Posted on May 17, 2011 at 13:32

For personal use, there is a free STM32 programmer using RTS/DTR for bootloader control. See

http://www.mikrocontroller.net/topic/141711

. If you cannot read german, just follow the links. The program itself talks english.

[ This message was edited by: prx on 04-12-2009 14:51 ]

swhite
Associate III
Posted on May 17, 2011 at 13:32

Thank you. That works great even with a standard serial port. The only issue is that it doesn't provide a way of setting the flash-write protection bits. That's ok because I can have my firmware do that when it runs 🙂

pswenson
Associate II
Posted on May 17, 2011 at 13:32

I'm using an STM32F101C8T6. I have DTR controlling STM32 power and RTS controlling BOOT0. I have tried to use STMFlashLoader and it won't toggle DTR or RTS. I run the following and DTR doesn't move:

STMFlashLoader -Dtr --Hi

I'm on COM1. If I open HyperTerm or TeraTerm, DTR goes high. STMFlashLoader is using a library call, STBL_SetDtr(TRUE|FALSE), but I'm not sure if this boils down to an EscapeCommFunction. I've used Dale Wheat's STM32Boot (which does use the EscapeCommFunctions to toggle DTR and RTS) and it worked well with bootloader v2.0. See

http://www.st.com/mcu/forums-cat-6284-23.html

However, my latest chips are running bootloader v2.1, so I can't use that at the moment.

Is anyone else using STMFlashLoader to toggle DTR/RTS with success? I also looked at STM32Prog.exe, but it assumes DTR and RTS on specific pins and I can't change them (plus, there's no source).

mcuisp
Associate II
Posted on May 17, 2011 at 13:32

there have a free tool,call ''mcuisp.exe'',which can download from www.mcuisp.com.

It is write by me, mm

swhite
Associate III
Posted on May 17, 2011 at 13:32

You just confirmed what I found. STMFlashLoader is broken when it comes to DTR/RTS. I gave up and downloaded/used STM32Prog.exe (the link is in the reply to my original post above). It worked immediately with no fuss.

That said my connections are:

RTS to NRST

DTR to BOOT0

If you can't reverse the signals then you'll probably have to write your own PC utility.

roderick1983
Associate II
Posted on May 17, 2011 at 13:32

:D

mcuisp,你的软件是中文的,这里�?�好些个都是大鼻�?,估计�?太认得中文呢。

reinhard2
Associate
Posted on May 17, 2011 at 13:33

Hi.

Is there any chance to get a working version of the flash loader (command line version) regarding the RTS and DTR lines? This would be very helpful!

thanks a lot and kind regards

gustavo239955
Associate II
Posted on June 09, 2011 at 19:00

I could successfully download following these steps:

  1. Download the Flash Loader Demonstrator v2.2.0.

  2. Use a USB2UART IC (I use FT232RL), or RS232 driver with DTR and RTS.

  3. Use DTR as NRST and RTS as BOOT0.

  4. Configure FT232RL DTR and RTS pins to let NRST=HI and BOOT0=LO when the COM port is closed (to avoid resetting the STM32 after downloading and closing the COM).

  5. Be careful to use only 3.3V logic (STM32 NRST and BOOT0 do not support 5V).

  6. Call the downloader with these parameters:

    ''%ProgramFiles%\STMicroelectronics\Software\Flash Loader Demonstrator\STMFlashLoader.exe'' -c --pn 3 --br 230400 -Rts --Hi -Dtr --Hi -Dtr --Lo -i STM32_Connectivity-line_256K -e --all -d --v --fn FW.HEX -c --pn 3 -Rts --Lo -Dtr --Hi

It has worked perfectly for me, no more switches! Hope it helps everybody.

GUGA