actuino / stm32flash

Automatically exported from code.google.com/p/stm32flash
0 stars 0 forks source link

Toggle RTS option [patch] #40

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
It would be useful to be able to toggle the RTS pin before programming to issue 
a reset on the device, and I have created a patch that does just that. This 
option is described in the help text as well.

I have not implemented this on the windows part, nor am I planning to or have 
any possibility do so, but I have added a stub in the windows serial port 
driver and a few #ifdefs, so someone else can do it if they want to (it should 
still compile, but the option is not available).

I have made a simple circuit with one transistor, one diode and a few resistors 
and capacitors that creates the following behaviour:

* When reset using a power cycle, the normal program will start.
* When reset using a reset input (not directly connected to the reset pin), the 
bootloader will start. When the bootloader resets the mcu afterwards, the 
normal program will start.

Thus, when the reset input is used, boot0 will be connected to vcc and reset to 
gnd. When the reset input is released, the boot0 pin is pulled down to gnd 
slower than the reset pin, so the bootloader will read it as one and start, and 
a few milliseconds later it will be pulled to zero. This is really useful for 
remote-programming with e.g. an RN41 based bluetooth-to-serial module, such as 
this one: https://www.sparkfun.com/products/10268

/Benjamin

Original issue reported on code.google.com by vedde...@gmail.com on 26 Dec 2012 at 2:41

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by lists.to...@gmail.com on 9 Dec 2013 at 11:25