ZHDA243 July   2026 AM13E23019 , AM13E232N9

 

  1.   1
  2.   摘要
  3.   商标
  4. 1简介
    1. 1.1 TI AM13E230x 简介
    2. 1.2 TI MCU 的 AI 工具链简介
  5. 2详细说明
    1. 2.1 EPI 的 Sysconfig 设置
      1. 2.1.1 刷新计数
      2. 2.1.2 EPI 时钟分频器
    2. 2.2 用于外部 SRAM 执行的 AI 模型库部署
      1. 2.2.1 第 1 步:将 AI “.a”文件添加到 CCS 工程中
      2. 2.2.2 第 2 步:链接器脚本更改 (`linker_m33_ti_arm_clang.cmd`)
      3. 2.2.3 'main.c' 变更
        1. 2.2.3.1 包含头文件
        2. 2.2.3.2 声明由链接器生成的符号
        3. 2.2.3.3 memcpy 函数
        4. 2.2.3.4 将条目函数放在 SDRAM 部分中
        5. 2.2.3.5 Main() 引导顺序
      4. 2.2.4 第 4 步:CSS 项目验证
    3. 2.3 硬件设计最佳实践
  6. 3总结
  7. 4参考资料

Main() 引导顺序

这是正确引导 MCU 并开始使用外部 SDRAM 运行 AI 模型的主要功能序列。

int main(void)
{
    /* Step 1: Hardware init — Device_Init() sets up clocks and cache.
     * SYSCFG_DL_init() configures the EPI peripheral, making SDRAM
     * accessible at 0x80000000. Both must run before any SDRAM access. */
    Device_Init();
    SYSCFG_DL_init();

    /* Step 2: Copy .CS1_EXECUTE section from Flash to SDRAM.
     * Transfers all AI model functions and weights from their Flash
     * load addresses to their SDRAM run addresses (0x80000000+).
     * After this call, all AI functions execute from SDRAM. */
    memcpy(&sdram_code_runstart,&sdram_code_loadstart,(size_t)&sdram_code_loadsize);


    /* Step 3: Call AI inference — PC moves to 0x80000000+ region.
     * In the demo project this is executeFromCs0().
     * For customer: replace with the AI model inference entry point. */
    ExecuteFromSDRAM();/* customer replaces this with their AI inference call */


    /*Verify dot product result. */
    LOG_ASSERT((App_DotProd_Result == APP_DOT_PROD_EXPECTED),
               "arm_dot_prod_f32 result mismatch: expected 20.0\r\n");
    LOG("PASS: arm_dot_prod_f32 = %.1f — executed from SDRAM\r\n",
        App_DotProd_Result);

    LOG("Example PASS\r\n");

    return 0;
}