cancel
Showing results for 
Search instead for 
Did you mean: 

Jumping from to internal bootloader with Option Byte set to Read out protection (RDP Level  1) .

Abhishek4
Associate

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).

  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.

Abhishek4_0-1702441068942.png

 

 

  1. 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.

Abhishek4_1-1702441068953.png

 

 

  1. 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();

                }

Abhishek4_2-1702441068962.png

 

 

 

 

 

4 REPLIES 4
Imen.D
ST Employee

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

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Piranha
Chief II

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?

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 

Billy OWEN
ST Employee

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