Jumping from to internal bootloader with Option Byte set to Read out protection (RDP Level 1) .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2023-12-12 8:22 PM
Board :- Custom board with STM32F105RCT6
Description :- I am trying to Jump to internal bootloader when Option Byte for Read Out Protection is set to 1 (RDP Level 1).
- When I am jumping to internal bootloader by Disabling the Read out protection I am able to Jump to SRAM and able to bootloader over UART and I can read the Device memory.
- When I am jumping to internal bootloader Enabling Read out protection then I am not able to Jump to SRAM and not able to bootloader over UART and it is asking for Disable the RDP and try again.
- After that again I am jumping to internal bootloader and Disabling the Read out protection by software (mention below) after that also I am not able to Jump to SRAM and not able to bootloader over UART and I cannot read the Device memory.
void __attribute__((section(".RamFunc"))) JumpToBootloader(void) {
FLASH_OBProgramInitTypeDef OptionsBytesStruct;
while(HAL_FLASH_Unlock() != HAL_OK);
while(HAL_FLASH_OB_Unlock() != HAL_OK);
HAL_RCC_DeInit();
__disable_irq();
OptionsBytesStruct.OptionType = OPTIONBYTE_RDP ;
OptionsBytesStruct.RDPLevel = OB_RDP_LEVEL_0;
while(HAL_FLASHEx_OBProgram(&OptionsBytesStruct) != HAL_OK);
void (*SysMemBootJump)(void);
volatile uint32_t addr = 0x1FFFB000;
SysTick->CTRL = 0;
SysTick->LOAD = 0;
SysTick->VAL = 0;
SysMemBootJump = (void (*)(void)) (*((uint32_t *)(addr + 4)));
__set_MSP(*(uint32_t *)addr);
SysMemBootJump();
}
- Labels:
-
STM32Cube MCU Packages
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2023-12-12 10:08 PM
Hello @Abhishek4 and welcome to the Community :)
Please have a look at this FAQ: How to change the Read Out Protection on STM32F1 - STMicroelectronics Community., this will help you on how to properly configure the option bytes for the STM32F1 series and change the Read-Out Protection feature.
Hope this helps you!
Imen
Thanks
Imen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2023-12-13 4:50 PM
Enabling a "ReaD out Protection" doesn't allow reading the flash... what a surprise! Then setting the RDP=0 and therefore doing a mass erase doesn't allow the (erased) firmware to run... again what a surprise! Maybe read the reference manual first?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2023-12-14 10:51 PM
Thank you for the reply......
I already followed the same link what you have mention....but not getting expected output for this....So please help me out with this.... Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2024-01-03 8:19 AM
Hi @Abhishek4
The forum moderator had marked your post as needing a little more investigation and direct support. An online support case has been created on your behalf, please stand by for just a moment and you will hear from us.
Regards,
Billy
