cancel
Showing results for 
Search instead for 
Did you mean: 

Stm32f427 system memory bootloader

yasintasan
Associate II
Posted on November 29, 2014 at 12:54

i have custom board with STM32F427VI and want to boot from usart3 via bootloader inside system memory.

boot0 pin is low and boot1 pin is NC. i dont want to switch boot pins. because eventually these pin connections must be

permanent

. just want to jump system bootloader address by my embedded software. if i set boot0 to high, i can drop the code to the bootloader and can update firmware by usart3. i used below software (STSW-MCU005) for this. so i can understand that my pinout connections are not wrong.

http://www.st.com/web/en/catalog/tools/PF257525

i read following passage from reference guide (RM0090) page 70 ''To select boot from Flash memory bank 2, clear the BFB2 bit in the user option bytes. When this bit is set and the boot pins are in the boot from main Flash memory configuration, the device boots from system memory, and the boot loader jumps to execute the user application programmed in Flash memory bank 2. For further details, please refer to AN26'' so i used following code for jumping to bootloader address:

RCC_DeInit(); 
// shutdown any tasks
// reset the systick timer
SysTick->CTRL = 0; 
SysTick->LOAD = 0;
SysTick->VAL = 0;
__set_PRIMASK(1); 
// disable interrupts
FLASH_OB_Unlock(); 
// flash option bytes unlock
FLASH->OPTCR |= 0x10; 
// set BFB2 bit 
FLASH_OB_Lock(); 
// flash option bytes lock
__set_MSP(*(__IO uint32_t*) 0x20002318); 
// Initialize user application's Stack Pointer 
(*((
void
(*)(
void
))(*(unsigned 
long
*)0x1fff0004)))(); // jump address

after the last line, code jumps to address of 0x1fff4abf. because in the memory address of 0x1fff0004 contains value of 0x1fff4abf. this address value is from system memory(below image)but it is not the start address of the bootloader. because i tried it with STSW-MCU005 software and could not make contact with bootloader. 0690X00000602z0QAA.jpg so how can i jump to system memory bootloader with my software, without using mcu boot pins? #usart #stm32f4 #bootloader
1 REPLY 1
Posted on November 29, 2014 at 14:50

Follow this, and the other links in the subsequent post

[DEAD LINK /public/STe2ecommunities/mcu/Lists/STM32Java/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/STM32Java/jumping%20to%20the%20bootloader%20via%20software%20does%20not%20permit%20dfu%20mode&FolderCTID=0x01200200770978C69A1141439FE559EB459D758000F9A0E3A95BA69146A17C2E80209ADC21&currentviews=260]https://my.st.com/public/STe2ecommunities/mcu/Lists/STM32Java/Flat.aspx?RootFolder=%2Fpublic%2FSTe2ecommunities%2Fmcu%2FLists%2FSTM32Java%2Fjumping%20to%20the%20bootloader%20via%20software%20does%20not%20permit%20dfu%20mode&FolderCTID=0x01200200770978C69A1141439FE559EB459D758000F9A0E3A95BA69146A17C2E80209ADC21¤tviews=260

The BFB2 does NOT help you here.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..