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.

[参考译文] CC2674R10:mcuboot:跳转到应用程序失败

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

https://e2e.ti.com/support/wireless-connectivity/bluetooth-group/bluetooth/f/bluetooth-forum/1433971/cc2674r10-mcuboot-jump-to-application-fails

器件型号:CC2674R10
主题中讨论的其他器件:CC1354P10

工具与软件:

尊敬的 TI 团队:

示例:mcuboot_LP_EM_CC1354P10_1_nortos_ticlang
SDK:simplelink_cc13xx_cc26xx_sdk_7_41_00_17

使用使用使用-O0和 exclude_trace 未定义编译的引导加载程序示例会导致异常。

调查后,我们发现 mcuboot_app.c 中的 start_app()是不安全的。
编译器可能会生成行为不符合预期的代码。
下面是一个修复建议:

__attribute__((noreturn, naked)) static void start_app(const uint32_t * volatile vector_table)
{
    /* The following code resets the SP to the value specified in the
     * provided vector table, and then the Reset Handler is invoked.
     *
     * Per ARM Cortex specification:
     *
     *           ARM Cortex VTOR
     *
     *
     *   Offset             Vector
     *
     * 0x00000000  ++++++++++++++++++++++++++
     *             |    Initial SP value    |
     * 0x00000004  ++++++++++++++++++++++++++
     *             |         Reset          |
     * 0x00000008  ++++++++++++++++++++++++++
     *             |          NMI           |
     *             ++++++++++++++++++++++++++
     *             |           .            |
     *             |           .            |
     *             |           .            |
     *
     * */

    /* Reset the SP with the value stored at vector_table[0] */
    __asm volatile ("ldr r1, [r0]");
    __asm volatile ("msr msp, r1");

    /* Jump to the Reset Handler address at vector_table[1] */
    __asm volatile ("ldr r0, [r0, #4]");
    __asm volatile ("bx r0"); // jump, not call (blx)
}

此致、
托比亚斯

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

    您好、Tobias:

    我希望你做得好。 我可以联系内部团队、查看他们对此主题的反馈。  

    谢谢!
    Alex F

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

    您好、Tobias:

    我们内部有一个 TT 在跟踪一个非常类似的问题(编译器-O0导致 MCU 崩溃)、并已对未来的 F2 SDK (CC13xx 和 CC26xx)版本添加了修复。  

    谢谢!
    Alex F

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

    Alex、您好!

    太好了、可能是同一个问题。
    有关计划版本和发布日期的任何详细信息?

    此致、
    托比亚斯

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

    您好、Tobias:

    此修复程序将包含在8.30 F2 SDK 版本(下一个版本)中、因为 SDK 即将发布的日期(时间表可能会更改、但这个月或下一个月)。  

    谢谢!
    Alex F