2014-10-28 09:38 AM
I want to calculate a CRC over the whole Flash Memory (16kB) of a STM32F030F4. I works fine up 8kB. Putting Values >8192 for BufferLength into CRC_CalcBlockCRC(uint32_t pBuffer[], uint32_t BufferLength). The program won't reach Reset GPIO_PIN_1. Tools: Keil 5.1 ST-LinkV2
Any Idea ?&sharpdefine FLASH_BASE ((uint32_t)0x08000000) /*!< FLASH base address in the alias region */
GPIOB->BSRR|=GPIO_Pin_1;
CRC_DeInit();
CRC_ResetDR();
uint32_t *pFLASH= (uint32_t *)FLASH_BASE;test_CRC=CRC_CalcBlockCRC(pFLASH,8192)
GPIOB->BRR|=GPIO_Pin_1; #crc-stm32f030f4-flash2014-10-28 10:19 AM
BufferLength parameter in 32-bit words, not 8-bit bytes, 16KB would be 4096 words
If you exceed the flash on die you'll get a Hard Fault2014-10-28 10:44 AM
Debug shows that MCU goes into Hard Fault. Thx for the Hint with Words, but why does the MCU not go into HardFault between 4096-8192 ?
2014-10-28 10:47 AM
Because the die has 32KB of FLASH on it?
2014-10-28 10:58 AM
This sounds evident.
2014-10-28 11:11 AM
In the world of IC manufacture, testing and marketing, it's common to sell parts at lower ratings, where expensive test time is skipped. The STM32F2 die have 1MB of flash, the ''256KB'' part is cheaper because the time on the tester is significantly reduced.