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.

[参考译文] RTOS/AM4377:EtherCAT 从站中的硬件中断锁定

Guru**** 2609945 points


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

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/653795/rtos-am4377-hardware-interrupt-lock-in-ethercat-slave

器件型号:AM4377

工具/软件:TI-RTOS

您好!

  tisebsp.c 文件的"bsp_send_command_to_firmware"函数中有一个中断锁定和解锁调用。 中断锁定下的关键段代码包含多个函数调用以及一个 DO 循环、该循环进而调用另一个函数来验证 while 真/假条件、这可能会持续更长时间。 请参阅以下代码:

void bsp_send_command_TO_firmware (PRUICSS_handle pruIcssHandle、uint32命令、uint16 param1、uint16 param2)
{
uint32_t evtoutNum = 0;
volatile t_host_interface* pHost2PruIntfc =(volatile t_host_interface *)(((((PRUICSS_HwAttrs *)(pruIcsHandle->hwAttrs))->baseAddr)+ PRU_ICSS_DataRAM (0);
{
#if defined (enable_PDI_task)|| defined (enable_PDI_SWI)(如果已定义)
Semaphore_pend (semcmdlow_handle、BIOS_wait_forever);

#else
Hwi_disable();
#endif
bsp_pruss_cmd_intfc_write_word (命令、&pHost2PruIntfc->cmdlow);
bsp_pruss_cmd_intfc_write_word (param1、&pHost2PruIntfc->param1low);
bsp_pruss_cmd_intfc_write_word (param2、&pHost2PruIntfc->param2low);
#ifdef support_cmdac_poll_mode
bsp_pruss_cmd_intfc_write_word (1、&pHost2PruIntfc->cmdlow_ack);
#endif
PRUICSS_pruSendEvent (pruIcss1Handle、ARM_PRU_EVENT1);
ASSERT_DMB();
ASSERT_DSB();
{
#ifdef support_CMDACK_POLL_MODE
易失性 uint16 ack;
执行{
ACK = bsp_pruss_cmd_intfc_read_word (&pHost2PruIntfc->cmdlow_ack);
} while (ack);
#else
evtoutNum = HOST_CMD_LOW_ACK_EVENT - 20;
PRUICSS_pruWaitEvent ((PRUICSS_Handle) pruIcss1Handle、evtoutNum);
#endif
}
bsp_pruss_cmd_intfc_write_word (0xFF、&pHost2PruIntfc->cmdlow);
#if defined (enable_PDI_task)|| defined (enable_PDI_SWI)
Semaphore_post (semcmdlow_handle);
#else
Hwi_enable();
#endif
}
} 

1.为什么需要在中断模式下进行硬件锁定?

2.如果需要、在中断锁定中有一个重要的代码段是正确的吗?

由于此处的中断锁定、我们面临的问题是 CPU 完全被该函数单独使用、并且预期接收的应用任务中断丢失。  

希望您能提前回复。

谢谢、

Sunil。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    RTOS 团队已收到通知。 他们将在这里作出回应。
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    你(们)好,Sunil

    我已要求我们的专家作出澄清。

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

    很抱歉耽误你的时间。 默认情况下、该模式在软件中不启用。

    该模式最初是使用硬件锁开发的、因为 bsp_send_command_TO_firmware 应该被串行化(因为我们不支持到 PRU 固件的命令接口队列)、并且这可能会从多个任务/中断中调用。 但是、由于性能影响、我们不再使用此模式。 代码保持不变、但不再用于任何配置。

    为什么启用此选项而不是默认启用的配置?

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

    感谢您的回答。 我们将禁用此模式并验证功能。

    此致、
    Sunil。