This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to fill unused flash memory with code



My software runs on F28027 out of flash.  Just wonder if there's a way I can fill unused flash with certain code so that the software can gets restart if the program counter should get astray.  How do I do it and what''s the preferred code to fill?

The application code converts to ASCII hex format(.a00) to be programmed into flash by using command line: /hex2000.exe  a.out -boot -sci8,

Thanks,

Michael Fang

  • Micheal,

    Please clarify your question. Why do you want to enter code in unused flash?

    Generally flash execution goes astray when CPU receives illegal instruction. When this happens it takes illegal ISR depending upon the contents of PIE vector table (or) BOOT ROM vector table. In the illegal isr routine watchdog gets enabled before entering into infinite loop. When the watchdog times out, reset signal is generated and restarts which seems to be expected behavior you want.

    Regards,

    Manoj

     

  • Manoj,

    What I want is to have the CPU gets reset as early as possible when it goes astray.  That way the application can get back running without long gap inbetween. 

    I'm not aware of the fact  you described that CPU will run interrupt ISR when it receives illegal instruction.  Is this a feature TI MCU has?  Is it mentioned in TI documents?

    When CPU receives  illegal instructions, which ISR vector (among the 96 in the PIE vector table) does CPU jbreaches to?  (ENPIE = 1 in my application.)  Looks like enabling watch dog in the (right) ISR and let it reset CPU will work.

    Thanks and regards,

    Michael

  • Micheal,

    Yes, this feature is available in C28x core and is documented. Please refer Pg 120 Table 109. PIE Vector Table for more information. When you have PIE enabled, it branches to illegal ISR routine pointed by address vector 0xD26 / 0xD27. Addresses 0xD26 and 0xD27 stores the starting address of the illegal ISR routine. This routine can be configured however you want the device to respond.

    Regards,

    Manoj

  • Thanks, Manoj.

    I did find PIE table vector definition in table 109 in TI document SPRUFN3C.  Just couldn't find the paragraph that describes how/when the 0xD26 ILLEGAL isr gets called.  But I'll take your word for it.

     

    Regards,

    Michael

     

     

  • Micheal,

    Illegal ISR is explained in Pg: 15 of TMS320x2802x Piccolo Boot ROM Reference Guide (Rev. A) (http://www.ti.com/lit/ug/sprufn6a/sprufn6a.pdf)

    Regards,

    Manoj

     

  • Thanks, Manoj.  That answered my question.