2026-04-22 8:04 PM - last edited on 2026-04-23 3:01 AM by Andrew Neil
Dear, @halfhalf
Post Edited by ST moderator to apply source code formatting and translate from Chinese to English to comply with the community rule:
Best regards,
Gyessine
------------------------------------------------------------------------------------------------------------
The STM32G474R datasheet does not mention the BOOT1 pin.
If the BOOT0 pin of STM32G474R is set to high, where does the program start?
If the BOOT0 pin is set to high and the BOOT1 pin is set to high, the program starts from SRAM. Is the program size limited by the size of SRAM? If a bootloader program and a main program are written, with the bootloader starting at address 0x20000000 and the main program starting at address 0x08000000, can this solve the issue of jumping from SRAM at 0x20000000 to flash memory at 0x08000000, so that the main program size is only limited by the size of flash memory?
--------------------------------------------------------------------------------------------------------------------------------------------------
1、STM32G474R数据手册中没有查找到BOOT1引脚
2、如果STM32G474R的BOOT0引脚接了高电平,程序从哪里启动?
3、如果BOOT0引脚接了高电平,BOOT1引脚接了高电平,程序从SRAM启动,程序的大小岂不是被SRAM大小限制?如果写个BOOTLOAD程序和主程序,BOOTLOAD起始程序0x20000000,主程序从0x8000000启动,,是否就可以解决从SRAM0x2000 0000跳转到0x8000 0000,而主程序的大小就只受FLASH大小限制?
2026-04-23 2:54 AM
Hello @halfhalf
On STM32G474R, there is no BOOT1 pin. With the default configuration, BOOT0 = 1 boots to system memory (the ST ROM bootloader), not to SRAM. If code is executed from SRAM, then its size is indeed limited by the available SRAM, but you can still have a small SRAM-resident routine or loader jump to an application stored in Flash at 0x08000000; in that case, the main application size is limited by Flash, not SRAM. However, for a real product, the usual and recommended approach is to place both the bootloader and the application in Flash, because SRAM is volatile and does not retain code after reset or power-off.
2026-04-23 3:36 AM
@Saket_Om wrote:SRAM is volatile and does not retain code after ... power-off.
True.
@Saket_Om wrote:SRAM ... does not retain code after reset .
But that's not true: SRAM contents do survive a reset, provided the power stays up.
However, the default behaviour of the C startup code is to reinitialise the SRAM - so you do have to override that if you want the contents to remain available to a C program ...
2026-04-26 8:26 PM
you can check the STM32G474R reference manual, there is no boot1 pin, but nSWBOOT0, nBoot0, nBoot1.
if the Boot0 s high, and
2026-04-26 8:28 PM
if the Boot0 s high, and nswboot0 is 1, you need to check also the nboot1 value