2009-05-04 12:01 AM
CrossStudio + Read Protection
2011-05-17 04:11 AM
I am just testing the ''Read Protection'' feature of the STM32. I am using Rowley's CrossStudio 1.7 IDE.
To enable the ''Read Protection'' I am using the following code: if (FLASH_GetReadOutProtectionStatus() == RESET) { FLASH_ClearFlag (FLASH_FLAG_BSY | FLASH_FLAG_EOP | FLASH_FLAG_PGERR | FLASH_FLAG_WRPRTERR); FLASH_EnableWriteProtection (FLASH_WRProt_Pages2to3 | FLASH_WRProt_Pages4to5 | FLASH_WRProt_Pages6to7 | FLASH_WRProt_Pages8to9); FLASH_ClearFlag (FLASH_FLAG_BSY | FLASH_FLAG_EOP | FLASH_FLAG_PGERR | FLASH_FLAG_WRPRTERR); FLASH_ReadOutProtection (ENABLE); NVIC_GenerateSystemReset(); } This seems to work (tested with the Flash Loader Demo). But after enable the ''Read Protection'' the start up code of CrossStudio seems to be no longer working. I am getting a ''Hard Fault Exception'' in ''thumb_crt0.s''. I think it happens, when the default values of the variables are copied from the Flash to the SRAM. Any ideas?