AN2659 STM8 In-Application Programming Using Customized User-Bootloader Application Note

This application note is intended for STM8 firmware and system designers who need to implement an in-application programming (IAP) feature in the product they are developing with the STM8 microcontroller. The STM8 is an 8-bit microcontroller family with a Flash memory for storing the user program code or firmware. IAP makes it possible to update the firmware ‘in situ’, after the microcontroller has been embedded in the final product. The advantage is that the microcontroller board can stay inside its product enclosure. No mechanical intervention is needed to make the update. IAP is extremely useful for distributing new firmware versions. It makes it easy to add new product features and correct problems throughout the product life cycle. The user-bootloader firmware source code provided with this application note shows an example of how to implement IAP for the STM8 microcontroller. Use this code as a reference when integrating IAP in your STM8 application. It includes the following features: ● Bootloader activated by external pin (jumper on PCB) ● Flash block programing by executable RAM code management ● Read while write (RWW) feature ● High level C-language usage ● Reduced size of the code (optimized code) ● Support for multiple communication interfaces (SPI , I2C, and UART) ● UART code compatible with ST Flash loader demonstrator


AN2659 STM8 In-Application Programming Using Customized User-Bootloader Application Note - cover page
Brand
STMicroelectronics
Category
microcontrollers
Document type
Application Note
Language
English
Pages
25
File format
PDF
File size
236 KB
Published
07 August, 2012
Updated
28 September, 2023
Model
STM8
MD5 checksum
3D49B5BE6A2F240CE2503B97F6E9BAFB

About this manual

This document provides guidance for STM8 firmware and system designers on implementing an in-application programming (IAP) feature. It details the operation theory of IAP, distinguishing between devices with built-in ROM-bootloaders and those requiring a custom solution.

The note includes a specific user-bootloader firmware example designed for STM8A, STMBL, and STM8S families. This example supports features such as activation via an external pin, flash block programming, read-while-write (RWW) capability, and multiple communication interfaces including SPI, I2C, and UART.

What's inside

  • Operation theory
  • STM8 devices with built-in ROM-bootloader
  • User-bootloader for STM8 devices
  • Memory management for IAP
  • Configuring the Cosmic compiler
  • Setting up application firmware

Specifications

Supported Microcontroller FamilySTM8 (including STM8A, STMBL, and STM8S)
Communication InterfacesSPI, I2C, UART, CAN

Frequently asked questions

What is the purpose of this application note?

It is intended for STM8 firmware and system designers who need to implement an in-application programming (IAP) feature.

What are the features of the provided user-bootloader example?

The example includes bootloader activation by external pin, flash block programming, read-while-write support, high-level C-language usage, and reduced code size.

Download PDF (236 KB)

More STMicroelectronics Manuals


View all STMicroelectronics manuals →