Skip to main content
jpeacock23
Associate
July 1, 2010
Question

Initializing memory C runtime

  • July 1, 2010
  • 2 replies
  • 912 views
Posted on July 01, 2010 at 16:48

Initializing memory C runtime

    This topic has been closed for replies.

    2 replies

    kcd193
    Visitor II
    May 17, 2011
    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 III
    May 17, 2011
    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.