cancel
Showing results for 
Search instead for 
Did you mean: 

CRC only up to 8kB Flash instead of 16kB

klaus2
Associate II
Posted on October 28, 2014 at 17:38

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-flash
5 REPLIES 5
Posted on October 28, 2014 at 18:19

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 Fault

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
klaus2
Associate II
Posted on October 28, 2014 at 18:44

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 ?

Posted on October 28, 2014 at 18:47

Because the die has 32KB of FLASH on it?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
klaus2
Associate II
Posted on October 28, 2014 at 18:58

This sounds evident.

Posted on October 28, 2014 at 19:11

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.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..