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.

TMS570LS3137: Abort when executing memcpy ()

Part Number: TMS570LS3137

Hi everyone,

My customer has a problem that Hercules aborts when running memcpy().

The value of the register at abort is as follows. 

I do not know the cause, I want some advice.

Best regards,

Sasaki

  • Hello Sasaki,

    How did your customer use memcpy(): source address, destination address, and data length? If copying data to external RAM attached to EMIF, which type is the external memory configured as: normal, device or strongly-ordered? BTW, the destination address should not point to flash memory.

    Does the code make unaligned accesses to the flash? The CortexR4 CPU will sometimes get an abort when making an unaligned access near the physical end of the bank boundary. Please refer to FMC#79, and FMC#80 in SPNZ195d.pdf
  • Hi Wang-san,

    Thank you for your support.
    I confirm with my customer.

    Best regards,
    Sasaki
  • Hi Wang-san,

    I confirmed with my customer.

    QJ Wang said:

    How did your customer use memcpy(): source address, destination address, and data length?

    souce address : 0x001E0000
    destination address : 0x0801D918
    data length : 4byte

    QJ Wang said:

    If copying data to external RAM attached to EMIF, which type is the external memory configured as: normal, device or strongly-ordered?
    BTW, the destination address should not point to flash memory.
    Does the code make unaligned accesses to the flash?

    memcpy() is transferring from internal FLASH to internal RAM.

    QJ Wang said:

    The CortexR4 CPU will sometimes get an abort when making an unaligned access near the physical end of the bank boundary.
    Please refer to FMC#79, and FMC#80 in SPNZ195d.pdf

    It did not correspond to the above errata.

    Do you find any problems from the above?

    Best regards,
    Sasaki

  • Hello Sasaki,

    There is no problem to memcpy data from flash to SRAM.

    memcpy(void *destination_address, const void *source_address, size_t length)

    If they swap the destination address and source address, and the flash is configured as read only (MPU), they may get abort when writing data to flash.
  • Hi Wang-san,

    Thank you for your support.

    I got it.

    Best regards,

    Sasaki