I have tried following the examples in the reference manual and online, but am having issues!This is on STM32F030C8T6, on a custom PCB and connected to debugger over SWD: void readProtect_lvl1(void){
//read protection is in effect on next power ...
for understanding, I have copied the code from the first post, and now completes successfully (PRGERR is never set as OPTPG is set during debug, and after line step the result is 0x44bb in ob->RDP), so can't recreate the issuecant find out what was t...
Because your computer can recognize the device (probably read voltage, SN etc ), your connection must work and I suspect read level protectioncould you confirm the MCU doesn't have read level protection set, with a read protected device I see:when us...
for the googlers of the future: this works! Thanks for all the replies, copying HAL was key (HAL is better)for whatever reason, the flash status register no longer shows a PGERR as FLASH->CR |= FLASH_CR_OPTPG executes in debug moderesults are consist...
OB->RDP = 0xBB; //any value other than 0xCC or 0xAA sets lvl1 read protection
while ((FLASH->SR & FLASH_SR_BSY) != 0) {}
FLASH->CR &= ~FLASH_CR_OPTPG; //reset option byte programming bit
FLASH->CR |= FLASH_CR_LOCK; //reset the control re...