Search code examples
memoryembeddedaccess-violationflash-memoryautosar

Embedded: Accessing unwritten ROM address content


I am working on an embedded device which uses an Aurix TC234. My (AUTOSAR) software which runs on it needs to do some checks during startup at a specific ROM address range.

The data which has to be checked is not written during flashing my software hex file. That means the address range has to be written before my software is flashed on that device.

My worst case scenario: Someone forgets to flash that address range. My software is flashed and during startup that memory is accessed. In that case a trap occurs.

My question: Is there a safe way of checking that specific ROM address range if it was written or not? Is it possible to handle such kind of trap?


Solution

  • After few checks, for TC29X flow with ECC error for ROM can be handled like below:

    • enable SMU alarms
    • catch ECC error in ISR from SMU
    • store flag in no init RAM area
    • SW reset must be called (no exit from trap for ECC)
    • in next startup check flag value

    Hope this help and similar solution will be available on your micro.