cancel
Showing results for 
Search instead for 
Did you mean: 

Initializing memory C runtime

jpeacock23
Associate III
Posted on July 01, 2010 at 16:48

Initializing memory C runtime

2 REPLIES 2
kcd193
Associate
Posted on May 17, 2011 at 13:56

Yes.

In my project I modified the startup code to immediately crank up the clock speed to 72 MHZ.

Another thing I do before the variable initialization is a RAM integrity test.  By doing the test before variable initialization and ensuring that I'm only using registers, I can get complete coverage in my RAM test.  Of course this test also happens after I have bumped up the clock speed.

damh
Associate II
Posted on May 17, 2011 at 13:56

Fastest way should be:

1. configure and enable HSE/PLL

2. start copying/initializing

3. interrupt on HSERDY/PLLRDY and in this interrupt you will switch to HSE/PLL

4. continue step 2

5. Only wait for HSERDY/PLLRDY, if you really need it (for MCO or timers i.e)!

HSE and PLL startup are very slow (HSE typ. ~2ms). With dumb assembler code you can initialize about 18k of RAM in 2ms to zero (28% of 64k RAM) or 13k of RAM as copy from flash (20% of 64k RAM) ;)

Most programs doesn't need more initialized memory.