Programming STM32 Microcontroller via ISP

Click the above Programming STM32 Microcontroller via ISP “Easy Learning Electronics” to follow us with one click and easily learn electronic knowledge.

Easy Learning Electronics Subscription

Daily updates on electronic industry technical articles and the latest microcontroller news, learn easily anytime, anywhere.

Students may encounter fewer issues, but when starting work in software development, various “unimaginable” problems may arise. However, with gradual accumulation, you can gain a certain understanding of hardware and software, enabling you to master them quickly!

When using the STM32F103 series MCU, I used a pirated JTAG programmer back in school, so I didn’t pay much attention to the programming pins (as long as it works, that’s fine). However, after starting work in a company, I found that typically only 4 pins are used for programming—this is the so-called SWD mode, which only requires 4 pins (VCC, GND, SWCLK, SWDATA). The reason for using only four pins is to make the chip smaller and the device more compact! Sometimes, the JTAG debugging interface of the MCU may be used as a regular IO port, so the pin multiplexing feature needs to be utilized. Once multiplexed, you need to be cautious! Once you reuse the programming interface, you can write to it, but you can no longer program it!

Therefore, let’s get to the point—ISP programming.

Software used—FlyMCU.

Preparation before use: Understanding Boot0 and Boot1.

Programming STM32 Microcontroller via ISP

The programmer writes code into the flash memory; therefore, generally speaking, Boot0 is set to 0 (ground mode).

What is the second situation used for?

It is our ISP mode, where the chip comes with a built-in BootLoader to download via UART1 (user cannot erase!).

The third situation is in SRAM mode (SRAM is volatile random-access memory, used for debugging, but generally not used).

Thus, we only need to focus on two modes:

1. Boot0 = 0

2. Boot0 = 1 && Boot1 = 0

We use the second mode for ISP programming!

1. First, insert the USB-to-serial adapter (or any serial port that can connect to the MCU).

Wiring: Use the STM32’s UART1, which are PA9 and PA10; TX connects to RX, RX connects to TX, and then share the ground.

2. Open FlyMCU, as shown in the interface: first click to clear the chip, then power it on! This will clear the written chip data.

Programming STM32 Microcontroller via ISP

> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >

How to Share to Moments

Click the top right corner Programming STM32 Microcontroller via ISP and select Programming STM32 Microcontroller via ISP to share to Moments.

How to Follow “Easy Learning Electronics”

1. On WeChat, click the top right corner “+” and select “Add Friends” → Search for “Easy Learning Electronics” in “Find Official Accounts” to find and follow us. 2. You can also search for WeChat ID “Easy Learning Electronics” to find and follow us.

How to View Past Messages

Click the top right icon to enter “Account Information” → “View Historical Messages”.

Easy Learning Electronics Subscription

WeChat Name: Easy Learning Electronics updates various knowledge in the electronic industry and the latest microcontroller news daily, come and open your visual feast.

Easy Learning Electronics Service Account

WeChat Name: Easy Learning Electronics is a new type of knowledge-sharing platform, view the latest articles, online videos and more from Easy Learning Electronics online, leading you into the world of electronic engineer technical development and learning.

==> Visit www.eeskill.com to learn more!

Leave a Comment