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.
您好!
我们已使用闪存 API 库很长一段时间、没有问题。
本周在执行 Fapi_setActiveFlashBank 函数时程序卡住、没有任何明显的原因
我已经读取了其他线程、并验证了我们是否运行了 RAM 存储器中与闪存相关的函数、以及中断是否被禁用。
导致此问题的原因以及如何解决?
P.S.:这对我们使用闪存 API 非常重要、我们无法避免使用它!!
Zvi,
感谢您提出、您是在多个器件还是仅一个器件上看到这种情况吗?
任何可能相关的器件历史记录、例如 TI 提供的全新器件或已使用一段时间且已经历多次写入/擦除周期的器件等。
TI EVM 或定制 PCB、是否有任何近期的 BOM 或设计更改?
您在 CPU1或 CPU2上看到的是这种情况、还是出现了或只是在 ActiveFlashBank 函数中"卡住"的任何 NMI?
据我所知、该闪存 API 现已有一段时间没有变化、但我将在这一侧进行检查、看看是否有任何更新
此致!
马修
Matthew 您好!
此问题在多个器件上重复出现。
这些器件正在使用中一段时间、但当我刻录较旧的固件版本时没有问题-新固件版本与使用闪存 API 库的代码没有变化。 新版本只是该项目必不可少的附加功能。
我们使用定制 PCB -没有 BOM 或设计更改。
此问题发生在 CPU02上,执行 ActriveFlashBank 函数后,程序将跳转到 ILLEGAL_ISR()并保持不变。
我们之前遇到过这个问题、并且通过将编译器版本从 v18.12.2更新到 v22.6.0、"修复了"这个问题-今天我们使用的是最新版本 v22.6.1
此致、
Zvi.
Zvi,
是否可以为新旧 FWs (和两个 CPU)发送.map 文件(对于各自项目应位于.out 的同一目录中)以便我查看是否可以发现任何冲突?
此致!
马修
Zvi,
我已经了解到有关使用 Fapi_setActiveFlashBank ()和闪存预取缓冲器的新情况。 如果调用 Fapi_setActiveFlashBank()时闪存预取缓冲器处于活动状态,则可能会产生您看到的 ITRAP。 原因是 Fapi_setActiveFlashBank()函数也禁用了预取缓冲区,但如果缓冲区中仍有正在等待的指令,我们就可以获取陷阱。
解决方案是从 RAM 中执行的代码中禁用预取缓冲区、并强制流水线清除、以便缓冲区中没有剩余的代码。
我有用于启用和禁用的下面的 C/P 代码。 在活动闪存组中进行任何更改之前需要调用 DISABLE。 使能只是为了提供执行相同刷写操作的互补函数、等等。
#ifdef __cplusplus #pragma CODE_SECTION(".TI.ramfunc"); #else #pragma CODE_SECTION(Flash_DisablePrefetch_SW_Workaround, ".TI.ramfunc"); #endif void Flash_DisablePrefetch_SW_Workaround(uint32_t ctrlBase) { // // Check the arguments. // ASSERT(Flash_isCtrlBaseValid(ctrlBase)); // // Disable flash prefetch // Flash_disablePrefetch(ctrlBase); // // Force a pipeline flush to ensure that the write to the last register // configured occurs before returning. // FLASH_DELAY_CONFIG; } /* Below is the code for Flash_EnablePrefetch_SW_Workaround() */ //***************************************************************************** // //! Enables flash prefetch mechanism and adds 7 cycle delay //! //! \param ctrlBase is the base address of the flash wrapper control registers. //! //! \return None. // //***************************************************************************** #ifdef __cplusplus #pragma CODE_SECTION(".TI.ramfunc"); #else #pragma CODE_SECTION(Flash_EnablePrefetch_SW_Workaround, ".TI.ramfunc"); #endif void Flash_EnablePrefetch_SW_Workaround(uint32_t ctrlBase) { // // Check the arguments. // ASSERT(Flash_isCtrlBaseValid(ctrlBase)); // // Disable flash prefetch // Flash_enablePrefetch(ctrlBase); // // Force a pipeline flush to ensure that the write to the last register // configured occurs before returning. // FLASH_DELAY_CONFIG; }
此致!
马修
Matthew 您好!
谢谢、我将尝试此权变措施。
此致、
ZVI