cancel
Showing results for 
Search instead for 
Did you mean: 

Microcontroller programming technology

k.s.corp
Associate II

Hello. Please tell us how the microcontroller programming process works. The controller can be programmed in two ways, fill the firmware through the bootloader and through the programmer.

If in the first case there is microcode on the controller that allows you to update the firmware.

And if you flash through the programmer, is there any minimal microcode?

Faced a compilation problem under Linux, there, without certain templates, the program does not start on the controller.

4 REPLIES 4

> And if you flash through the programmer, is there any minimal microcode?

That depends on the programmer. Not necessarily.

The JTAG/SWD interface provides a remote access to the internal buses, that's all; basically the programmer then does exactly the same steps as your program would do when writing to FLASH.

> Faced a compilation problem under Linux, there, without certain templates, the program does not start on the controller.

Elaborate. It's unlikely this is primarily due to device programming.

JW

PS. Change your username to a normal nick.

berendi
Principal

> The controller can be programmed in two ways, fill the firmware through the bootloader and through the programmer.

> If in the first case there is microcode on the controller that allows you to update the firmware.

Right. There is around 30 kBytes of "System Memory" containing the code that can load the firmware through diverse communication interfaces. Details can be found in AN2606 STM32 microcontroller system memory boot mode

> And if you flash through the programmer, is there any minimal microcode?

It's possible both with and without code on the microcontroller. Why is it relevant?

S.Ma
Principal

When starting with microcontroller, the baseline is to have a JTAG/SWD debug probe such as J-link or STLink.

With this, using 2+ MCU pins, you can fully control it.

Usually when you compile and link, a bin or out file is created which contains the flash image of the program.

The STLink, when entering debug mode, will first flash the micro with the program image, then reset the core and starts the code on your command.

This is the basic. Then you can control the flash by embedded SW, if the flash has dual bank, you can split the flash in 2 parts for SW upgrades with backup.

There is also a special area for the bootloader which by default enable you to flash the MCU by USB (enabled by default if the flash is virgin), USART, etc...

Also, there are some config flash flags to lock/protect the embedded flash SW globally or by areas, potentially disabling debug capability to favor security.

k.s.corp
Associate II

ALL thanks!