cancel
Showing results for 
Search instead for 
Did you mean: 

STM32WB55 RDP protection level

DineshB
Associate III

Hello 

I am trying to flash code using openocd(through JTAG) in option byte RDP protection level is set to AA(0) but still openocd throwing error memory is write protected can not write on address 0x8000000.

 

Hardware : STM32WB55 Nucleo board

Openocd Version : 0.11

 

if anyone know the reason then please let me know.

 

Thanks in advance

Dinesh Bisen

7 REPLIES 7
Pierre_Paris
ST Employee

Hello @DineshB,

Thank you for your question.

The FLASH pages can also be protected against unwanted write (WRP) due to loss of program counter context.

The user area in flash memory can be protected against unwanted write operations. Two write-protected (WRP) areas can be defined, with page (4 Kbytes) granularity. Each area is defined by a start page offset and an end page offset related to the physical flash memory base address. These offsets are defined in the WRP address registers Flash memory WRP area A address register (FLASH_WRP1AR) and Flash memory WRP area B address register (FLASH_WRP1BR). 

  • Can you check those registers ?
  • Can you connect to your target with STCubeProgrammer and try to write in FLASH ?

Best Regards, 

Pierre

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Untitled_1.png

Untitled_2.png

DineshB
Associate III

Dear @Pierre_Paris 

I have uploaded photos of WRP1A and WRP1B start and end address values please let me know what's wrong with this value i have tried WRP1A_STRT = WRP1A_END and WRP1B_SART = WRP1B_END but still facing the same issues.

 

Pierre_Paris
ST Employee

Hello @DineshB ,

Here are some remark you can investigate :

  • Your values seem correct. If you can verify WRP, that means you are attached to the target. Can you please enter in the first tab named "Memory & File editing" and then try to write manually a random value at the first flash address 0x08000000. Is it working ?  
  • Are you respecting the flashing steps ?
    1. Configure via the command flash bank
    2. Operate on the flash via flash subcommand
    3. GDB Flashing
    You can read more details here (chapter 12-13) in this openOCD user's guide. Are you using a configuration file .cfg ? 
  • 2nd error on your screenshot : " Error executing stm32l4 flash write algorithm ".  This is surely not the issue but are you sure your flashing the right algorithm ?
  • Last thing, are you using sysfsgpio ? Also the first line advise you to use 'adapter driver', can you switch ?

Best Regards,

Pierre

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Dear @Pierre_Paris 

  • In "Memory & File editing" i am able to to write manually a random value at the first flash address 0x08000000. 
  • I am using correct config file i.e. "stm32wbx.cfg" 
  • in stm32wbx.cfg file stm32l4 is mentioned.
  • flash bank $_FLASHNAME stm32l4 0 0 0 0 $_TARGETNAME
Pierre_Paris
ST Employee

Hello @DineshB,

We can conclude there are no mechanism protecting STM32 flash, so the problem must come from somewhere else :

  • When you create your target, how did you configure your work area ? Setting WORKAREASIZE especially...
  • The first error is "timeout waiting for algorithm, a target reset is recommended", you should check your algorithm. Maybe because you're halting the CPU ?
  • Have you modified the Run configurations (or did you keep by default) ? Can you try other reset mode ?

Best Regards,

Pierre

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.