Associate
September 3, 2020
Question
I'm having some issues reading memory addresses in an STM32L071RB.
- September 3, 2020
- 3 replies
- 3457 views
Hello, I'm having some issues with an STM32L071RB. I'm unable to read from memory address 0x08020000 onwards because it's supposed to be read/write-protected.
I had similar results on STM32CubeProgrammer and via the I2C bootloader, which are as follow:
- Reading address 0x08020000 from STM32CubeProgrammer. I get: "Error: Data read fail". Any address from 0x08000000 up to 0x08020000 work fine.
- Reading the whole flash space from I2C bootloader and it fails at "Read address 0x08020000 (66.67%) Failed to read memory at address 0x08020000, target write-protected?"
To remove the read/write protections I tried the following:
On CubeProgrammer
- Making sure all the read/write protections are disabled in the option bytes.
- Tried setting WPRMOD=1 and then WPRMOD=0
- Tried setting RDPROT=0xBB and then back to RDPROT=0xAA
- Tried doing a full erase, which fails because some sections are write protected.
Via I2C bootloader
- Sent commands to remove read and write protections, but the result is the same.
Via firmware
- Reading option bytes using HAL_FLASHEx_AdvOBGetConfig. The result is that PCROPSector, PCROPSector and PCROPState are all 0.
- Tried also to set it to 1 and then back to 0.
This issue seemed to have appeared when I was testing writing and reading from EEPROM, which shouldn't be related.
I'm not sure what else I could try. Any help is appreciated.
