器件型号: AM2432
尊敬的 TI 专家:
几个月前、我的同事问了这个问题、 AM2432:R5F 中的 Σ — Δ ISR 进入瞬间抖动 — 基于 Arm 的微控制器论坛 — 基于 Arm 的微控制器 — TI E2E 支持论坛
我进一步研究了这个问题。 SDK 中似乎有代码会禁用中断。
例如、在函数 bsp_send_command_to_firmware() 中、该函数由各种 EtherCAT 相关函数调用。
void bsp_send_command_to_firmware(PRUICSS_Handle pruIcssHandle,
uint32_t command,
uint16_t param1, uint16_t param2)
{
volatile t_host_interface *pHost2PruIntfc = (volatile t_host_interface *)
((((PRUICSS_HwAttrs *)(pruIcssHandle->hwAttrs))->baseAddr) +
PRUICSS_DATARAM(0));
{
#ifdef ENABLE_PDI_TASK
SemaphoreP_pend(&semcmdlow_object, SystemP_WAIT_FOREVER);
#else
uintptr_t key1 = HwiP_disable();
#endif
bsp_pruss_cmd_intfc_write_word(command, &pHost2PruIntfc->cmdlow);
bsp_pruss_cmd_intfc_write_word(param1, &pHost2PruIntfc->param1low);
bsp_pruss_cmd_intfc_write_word(param2, &pHost2PruIntfc->param2low);
#ifdef SUPPORT_CMDACK_POLL_MODE
bsp_pruss_cmd_intfc_write_word(1, &pHost2PruIntfc->cmdlow_ack);
#endif
PRUICSS_sendEvent((g_bsp_params.pruicss_handle), ARM_PRU_EVENT1);
ASSERT_DMB();
ASSERT_DSB();
{
#ifdef SUPPORT_CMDACK_POLL_MODE
volatile uint16_t ack;
do
{
ack = bsp_pruss_cmd_intfc_read_word(&pHost2PruIntfc->cmdlow_ack);
}
while(ack);
#ifndef ENABLE_PDI_TASK
HwiP_restore(key1);
#endif
#else
uint32_t evtoutNum = HOST_CMD_LOW_ACK_EVENT - 20;
#ifndef ENABLE_PDI_TASK
HwiP_restore(key1);
#endif
PRUICSS_waitEvent((PRUICSS_Handle)(g_bsp_params.pruicss_handle), evtoutNum);
#endif
}
bsp_pruss_cmd_intfc_write_word(0xFF, &pHost2PruIntfc->cmdlow);
#ifdef ENABLE_PDI_TASK
SemaphoreP_post(&semcmdlow_object);
#endif
}
}
当我使用 SDK 的 SDFM 3 通道示例时、ISR 的抖动会减少到 300ns。 因此、我认为抖动的原因是 4us。
我将尝试找到导致问题的所有代码段、正如我搜索 hwiP_disable 时、有很多匹配项、

都使用 SPI 和 UART、这也可能是原因。
对于测试,我有下来的是,我首先注释出一些函数,频率是从改进

最终目的

每次找到我们使用的代码段并禁用中断时、我都会更新线程。 并想知道是否有必要保留实施。