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.

AM263P4-Q1: Flash_norOspiWrite() Fails if Length of Data To Write is Odd

Part Number: AM263P4-Q1


Tool/software:

Hello,

I'm using SDK 9.2.56.

I am flashing a random length file to OSPI flash using Flash_norOspiWrite() via Flash_write().

static int32_t Flash_norOspiWrite(Flash_Config *config, uint32_t offset, uint8_t *buf, uint32_t len);

In this example, the data I want to flash just happens to be '277545' bytes long. The code divides this into 3 iterative calls of Flash_norOspiWrite() where len is:

131072

131072

15401

On the third call where len is 15401, Flash_norOspiWrite() returns SystemP_FAILURE.

If I force the len to be either 15400 or 15402, Flash_norOspiWrite() returns SystemP_SUCCESS.

There's probably a very good reason why an odd number of bytes fails, please confirm it, but at the very least there seems to be a validation step missing in Flash_norOspiWrite() which would have explicitly informed me that len must be even.

  • Hi Kier,

    Thanks for pointing this out. This does appear to be the behavior of the driver now. We’ll check with the SDK team internally.

    Continuing with even-byte aligned writes, as you've already found to be working, would be suitable.

    Regards,
    Aswin