Embedded: Accessing unwritten ROM address content

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
HereturbiesWalt
Level 1
Level 1
5 sign-ins 5 questions asked First like given

Hi

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 echatrandom azar of trap?

0 Likes
2 Replies
Di_W
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 250 solutions authored

Hi Walt,

Could you try to add a flag after "address range", then your firmware could check the flag to judge if it is written already. If it's not written, then you can do some special operations to avoid Trap.

If your flag exsits, then just make sure the "address range " is correctly written, then your firmware will run normally.

If you do the condition judge in firmware, maybe Trap is not needed to handle.

dw_0-1650369773408.png

dw

 

0 Likes
Jamber
Level 3
Level 3
25 replies posted 50 sign-ins First like received

Hi, Walt,

TC2xx support two ECC type, Safe ECC and Legacy ECC, if you use Legacy ECC, reading an erased flash will not cause a trap. It is configured via register FCON.NSAFECC.

Best regards

Jamber