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 ()将失败

Guru**** 2448780 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1501784/am263p4-q1-flash_norospiwrite-fails-if-length-of-data-to-write-is-odd

器件型号:AM263P4-Q1

工具/软件:

您好:

我使用的是 SDK 9.2.56。

我使用 Flash_norOspiWrite ()通过 Flash_write ()将随机长度文件刷写到 OSPI 闪存。

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

在本例中、我只想闪存的数据恰好是"277545"个字节的长度。 代码将其划分为 Flash_norOspiWrite()的3个迭代调用、其中 len 为:

131072.

131072.

15401.

在第3个调用中 、len 为15401、Flash_norOspiWrite()返回 SystemP_FAILURE。

如果我强制 len 为15400或15402、Flash_norOspiWrite()返回 SystemP_SUCCESS。

可能有一个很好的原因,为什么一个奇数字节数失败,请确认它,但至少在 Flash_norOspiWrite()中似乎有一个验证步骤缺失,这将明确地通知我,长度必须是偶数。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Kier:

    感谢您指出这一点。 这似乎是驱动程序现在的行为。 我们将在内部咨询 SDK 团队。

    继续进行偶数字节对齐的写入(如您已经发现可以使用的那样)是合适的。

    此致、
    Aswin