Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

STM32F030 and BOOT0 pin

Tags:

cortex-m

stm32

I'm trying to create circuit with STM32F030K6T6 microcontroler and im not sure about one thing.

There is only BOOT0 pin (without BOOT1) and maybe I'm blind but I can't find description about this pin in ST documentation (I was looking in "DoclD024849 Rev 1" document which is datasheet for mentioned uC).

One thing I found is a description about pair of BOOT pins, showed below (based on "DoclD018940 Rev 5" - RM0091 Reference Manual document):

BOOT0=0 BOOT1=x - main flash memory boot
BOOT0=1 BOOT1=0 - system memory boot (boot loader)
BOOT0=1 BOOT1=1 - RAM memory

What I want to do is to program chip by SWD and I'm not realy sure what I need to do with BOOT0 pin.

The questions are: Should I pull-up this pin? What is the default value of BOOT1 in this case?

like image 518
Tyrreus Avatar asked Mar 12 '14 12:03

Tyrreus


People also ask

What is boot0?

boot0 is the first-stage bootloader of the Starlet ARM core on board the Hollywood; it's contained in 4K of Mask ROM (only 1.5K of which is actually used).

Does STM32 come with bootloader?

The bootloader is stored in the internal boot ROM (system memory) of STM32 devices, and is programmed by ST during production. Its main task is to download the application program to the internal Flash memory through one of the available serial peripherals (such as USART, CAN, USB, I2C, SPI).

What is bootloader STM32?

What is a system bootloader? System bootloader in STM32 is the bootloader that has been provided by the chip manufacturers. That we cannot overwrite as it has loaded into the ROM memory. We can also call this as a ROM bootloader. Using this bootloader, we can update the firmware or application from the bootloader.


2 Answers

In STM32F030 datasheet you can find that BOOT0 is the microcontroller pin, and BOOT1 is boot selector option bit (page 12)

In RM0360 on page 62 you can find that bit in FLASH_OBR register. There is also section about how to setup Boot configuration.

In the STM32F0x0, three different boot modes can be selected through the BOOT0 pin and boot configuration bits nBOOT1 in the User option byte, as shown in the following table.

(...)

The boot mode configuration is latched on the 4th rising edge of SYSCLK after a reset. It is up to the user to set boot mode configuration related to the required boot mode. The boot mode configuration is also re-sampled when exiting from Standby mode.

like image 113
Gaskoin Avatar answered Oct 03 '22 02:10

Gaskoin


The simple answer: SWD doesn't need to be connected during boot so boot pin configuration doesn't matter for that (unless you want to prevent execution of some "hazardous" SW). If you're intending to write your SW to main flash I would just suggest leaving BOOT0 down to save the trouble.

If the case would have been that you want to flash the chip using serial (UART1), you'd need to invoke the bootloader (BOOT0=1 BOOT1=0) for that.

like image 24
d'-'b Avatar answered Oct 03 '22 01:10

d'-'b