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.

[参考译文] TI-RTOS-MCU:HWI 函数中的 SWI_Post ()调用会导致 SWI 的过帐、但不会执行该函数

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

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1048069/ti-rtos-mcu-swi_post-call-in-hwi-function-results-in-posting-of-the-swi-but-not-executing-the-function

器件型号:TI-RTOS-MCU
主题中讨论的其他器件: TM4C1294NCPDTTM4C123

我在我的项目中使用 TI-RTOS,我在 I2C 外设的 Hwi 函数中使用 Swi_post ()发布 Swi,Swi 被发布,但该函数从未执行。

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

    您好、Ahmed、

    您在什么 TI 器件上使用 TI-RTOS-MCU?

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

    TivaC tm4c1294ncpdt

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

    您好!

     您是否在 main()末尾调用了 BIOS_start()? 如果没有 BIOS_start(),操作系统内核将不会安排 SWI 运行。 请看 下面的示例。 它是 TM4C123的示例、但具有与 TM4C129相同的使用概念。 一个 HWI 被创建用来处理定时器中断。 当有一个定时器中断时、它调用 Swi_post 来运行 LED 函数。  

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    //----------------------------------------
    // BIOS header files
    //----------------------------------------
    #include <xdc/std.h> //mandatory - have to include first, for BIOS types
    #include <ti/sysbios/BIOS.h> //mandatory - if you call APIs like BIOS_start()
    #include <xdc/runtime/Log.h> //needed for any Log_info() call
    #include <xdc/cfg/global.h> //header file for statically defined objects/handles
    #include <xdc/runtime/System.h>
    #include <xdc/runtime/Error.h>
    #include <ti/sysbios/hal/Hwi.h>
    //------------------------------------------
    // TivaWare Header Files
    //------------------------------------------
    #include <stdint.h>
    #include <stdbool.h>
    #include "inc/hw_types.h"
    #include "inc/hw_memmap.h"
    #include "driverlib/sysctl.h"
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

    首先、感谢您今天早些时候的回复、我发现问题是我未清除 RIS 寄存器以及 IMR 仍然被设置、因此中断始终被触发、而不让 Swi 执行、 因此、解决方案是在布置 swi 之前清除 RIS 标志、这样 I2C 中断就不会再次从这种环境中触发。