Keil Logo

µVISION: Hard Fault Errors on ECC Memory with SmartFusion2

Information in this knowledgebase article applies to:

  • MDK-ARM -- All Versions


You receive a Hard Fault error when starting your application using a SmartFusion2 device with ECC memory enabled.


The linker, by default, compresses RW data to reduce the size of the ROM image. The decompressor uses a store-byte (STRB) instruction to initialize ECC memory which performs a read-modify-write operation to store a byte into a 32-bit word on this device. Since the memory is uninitialized, the "read" part of the operation causes the hard fault error.


In your µVision project, turn the RW data compressor off by setting the "--datacompressor off" option in Options for Target -> Linker -> Misc Controls. This results in memory being initialized with a store-word instruction (STR), which does not perform a read before writing.

Decompressor off Option

Depending on the application, this may result a larger ROM image.

Any attempt to initialize ECC memory with an STRB or STRH instruction will result in a Hard Fault. For example, the memset() function calls lower-level libraries which may use STRB or STRH. If using the memset() or memcpy() function causes a Hard Fault, and you do not want to turn off decompression, you may want to write your own version of that function using code similar to the following:

    for (i=RAM_DATA_START; i<((uint32_t)&Image$$ER_RW$$Base); i+=4) {
        ptr = (u4*)i;
        *ptr = 0x00000000;


Last Reviewed: Tuesday, April 4, 2017

Did this article provide the answer you needed?
Not Sure
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.