STM8 without manual reset enter the self-bootloader method (serial download)

Source: Internet
Author: User
Tags rar

Source:STM8 without manual reset enter the self-bootloader method (serial download)

STM8 without manual reset enter the self-bootloader method (serial download)
Unless the STM8 film is empty, if the reset is running with bootloader, and to download the program through the serial port, you must click on the host computer within 1s, or run the user program. This step is troublesome, so I want to dispense with it. Later found that the host computer Flash Loader demonstrator in the Start screen click Next, will first from the serial port DTR, RTS output a pulse of about 100 milliseconds, TTL level is negative pulse, and then the MCU communication. So as long as the following figure wiring, if the single-chip microcomputer reset operation is the bootloader, as long as the Flash Loader Demonstrator Start screen Click Next, the software will reset the microcontroller, do not have their own manual reset and click on next can be and single-chip computer communication.

ourdev_584482ahfil8.jpg(95.32 KB) 2010-12-30 05:06

ourdev_584483vamtsx.jpg(101.08 KB) 2010-12-30 05:06

There is the download stm8s or stm8l when the Flash Loader demonstrator Start screen settings are not the same

Stm8s is like this:

ourdev_584484gf34hc.jpg(60.28 KB) 2010-12-30 05:06

STM8L is like this:

ourdev_584485xkmqj1.jpg(63.51 KB) 2010-12-30 05:06

Also about whether the reset runs from the bootloader, at least one of the following two conditions can be

1, the device is empty (the new buy is empty)

2, Optionbyte in the bootloader is enable

The new device Optionbyte in the bootloader is disable, in order to be able to use the serial download program more than once, the first download program must be modified Optionbyte make bootloader enable

This is the STM8S program:

#include"iostm8.h" voidMainvoid) {Flash_dukr=0xae; ASM ("NOP"); Flash_dukr=0x56; ASM ("NOP");  while(! (FLASH_IAPSR &0x08)); ASM ("NOP"); Flash_cr2=0x80; ASM ("NOP"); Flash_ncr2=0x7f; ASM ("NOP"); * ((unsignedChar*)0x487e) =0x55; ASM ("NOP"); * ((unsignedChar*)0x487f) =0xaa;  while(1); } 

Click here to download stm8s_bl_en.rar (12.95 KB)

Stm8s_bl_en.rar(12.95 KB) Download count: 4202010-12-30 05:06

This is the STM8L program:

#include"iostm8L152c6.h" voidMainvoid) {Flash_dukr=0xae; ASM ("NOP"); Flash_dukr=0x56;//write-protection is removedasm"NOP");  while(! (FLASH_IAPSR &0x08));//waiting to be unlockedasm"NOP"); Flash_cr2=0x80;//write to an option byteasm"NOP"); * ((unsignedChar*)0x480b) =0x55; ASM ("NOP"); * ((unsignedChar*)0x480c) =0xaa;//Write Options bytes     while(1); }

STM8 without manual reset enter the self-bootloader method (serial download)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.