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.
高优先级中断,阻止低优先级中断状态更新,是BUG吗???
R5程序中,PRU和MMC中断,PRU优先级比MMC高,在PRU中断程序里,与MMC外设通讯,MMCSD1_NORMAL_INTR_STS(Normal Interrupt Status Register,0FA0 0030h)和MMCSD1_ERROR_INTR_STS(Error Interrupt Status Register,0FA0 0032h)寄存器,里面的中断状态没有更新,请问是怎么回事?所有中断,我都Enable了的。
请看下面e2e工程师的回复。
Whether the MMC generates interrupts to R5F/VIM should have nothing to do with whether the PRU also generates interrupts to R5F/VIM. This also has nothing to do with VIM, since you're saying the MMC peripheral itself isn't generating interrupts.
Does the MMC generate interrupts (flags set in MMCSD1_NORMAL_INTR_STS or MMCSD1_ERROR_INTR_STS) if PRU interrupts (no PRU ISR is executed) are disabled?
我使用的是TI的SDK,里面的中断,都是通过HwiP_irq_handler_c()函数来处理,同时,MMCSD1_NORMAL_INTR_STS_EN和MMCSD1_ERROR_INTR_STS_EN里面的中断都打开了的。当PRU ISR处理退出之后,是可以进入MMC ISR,关键是在PRU ISR里面,MMC通讯时,看到MMCSD1_NORMAL_INTR_STS和MMCSD1_ERROR_INTR_STS的中断标志,没有设置起来,完全被屏蔽阻断了,只有退出高优先级的PRU ISR之后,才能获得MMCSD1_NORMAL_INTR_STS和MMCSD1_ERROR_INTR_STS的中断标志。我想知道,如何才能在高优先级的中断ISR,获得低优先级的中断状态标志???或者说,有没有可能???
请看下面e2e工程师的回复。
I assume you're using IRQs and you're referring to the VIM PRU (ICSSG) vs MMC interrupt priority. Is this correct?
The VIM priority for an interrupt has no effect on the interrupt status bits generated in a peripherial register (here MMC).
Are you using No RTOS? According to the documentation, No RTOS support IRQ interrupt nesting: https://software-dl.ti.com/mcu-plus-sdk/esd/AM243X/08_05_00_24/exports/docs/api_guide_am243x/KERNEL_NORTOS_PAGE.html#autotoc_md490
Is the PRU ISR interrupting the MMC ISR (since it's lower priority) after MMC ISR has cleared the MMC status registers? After exiting the PRU ISR, the MMC ISR would resume.
不客气~
请看下面e2e工程师最新的回复。
What is the behavior if you disable PRU interrupts entirely and perform the MMC processing you're currently experimenting with in PRU ISR inside the MMC ISR? Do you see the behavior you expect?
What if you set the PRU & MMC ISRs to the same interrupt priority?
Can you send me a toy example that shows the behavior so I can better you you with debug?
这是MMC的SDIO配置,不在PRU ISR里面,MMC收发数据,是可以看到XFER_COMPLETE的状态改变
{
.ssBaseAddr = CSL_MMCSD1_SS_CFG_BASE,
.ctrlBaseAddr = CSL_MMCSD1_CTL_CFG_BASE,
.inputClkFreq = 200*1000000U,
.outputClkFreq = 4*1000000U,
.ClockEdge = SDIO_CLOCK_EDGE_FALLING,
.enableDma = TRUE,
.intrEnable = TRUE,
.intrNum = 166U,
.busWidth = SDIO_WIDTH_4BIT,
.busVoltage = SDIO_VOLT_3_3V,
.Callback = SDIO_IRQHandler,
},
MMCSD1_NORMAL_INTR_STS_ENA = 0xffff;
MMCSD1_ERROR_INTR_STS_ENA = 0xffff;
MMCSD1_NORMAL_INTR_SIG_ENA = 0xffff;
MMCSD1_ERROR_INTR_SIG_ENA = 0xffff;
static void SDIO_IRQHandler(void *arg)
{
const SDIO_Attrs *sdioAttrs = (const SDIO_Attrs *)arg;
const CSL_mmc_ctlcfgRegs *pReg = (const CSL_mmc_ctlcfgRegs *)(sdioAttrs->ctrlBaseAddr);
uint16_t regErr = 0U;
uint16_t regNor = 0U;
uint16_t respVal[8] = {0};
regErr = CSL_REG16_RD(&pReg->ERROR_INTR_STS);
regNor = CSL_REG16_RD(&pReg->NORMAL_INTR_STS);
if(regNor & CSL_MMC_CTLCFG_NORMAL_INTR_STS_CMD_COMPLETE_MASK)
{
flgResp=1;
}
if(regNor & CSL_MMC_CTLCFG_NORMAL_INTR_STS_BUF_RD_READY_MASK)
{
flgResp=2;
}
CSL_REG16_WR(&pReg->ERROR_INTR_STS, 0xffff);
CSL_REG16_WR(&pReg->NORMAL_INTR_STS, 0xffff);
}
static uint16_t SDIO_StateCode()
{
const CSL_mmc_ctlcfgRegs *pReg = (const CSL_mmc_ctlcfgRegs *)(gSdioAttrs->ctrlBaseAddr);
uint16_t regErr;
uint16_t regNor;
uint16_t resCode = 0;
regErr = CSL_REG16_RD(&pReg->ERROR_INTR_STS);
regNor = CSL_REG16_RD(&pReg->NORMAL_INTR_STS);
if(regNor & CSL_MMC_CTLCFG_NORMAL_INTR_STS_CMD_COMPLETE_MASK)
{
resCode=1;
}
if(regNor & CSL_MMC_CTLCFG_NORMAL_INTR_STS_BUF_RD_READY_MASK)
{
resCode=2;
}
/*
CSL_REG16_WR(&pReg->ERROR_INTR_STS, 0xffff);
CSL_REG16_WR(&pReg->NORMAL_INTR_STS, 0xffff);
*/
return resCode;
}
请看下面e2e工程师的回复。
I looked at the SDK 08.05 MMCSD driver. I'm not an expert in this driver, but from what I can determine, interrupt mode isn't supported.
Also, looking at the SDK release notes, I see the comment "Interrupt mode not tested" for the MMCSD R5F driver: https://software-dl.ti.com/mcu-plus-sdk/esd/AM243X/08_05_00_24/exports/docs/api_guide_am243x/RELEASE_NOTES_08_05_00_PAGE.html
I'm looping in an MMCSD driver expert for further comment in case I'm mistaken.
What SDK software is the customer using for MMCSD transfers? How is the customer enabling and registering interrupts for the MMCSD software?
I want to make sure I understand what the customer is trying to do. Can you please confirm my summary below is correct?
Summary:
How is the customer determining the MMCSD1_NORMAL_INTR_STS bits aren't set inside the PRU ISR?
Inside the PRU ISR, what are the values of these registers:
What is the value of these registers if the MMCSD read/write is invoked outside the PRU ISR?
Does the customer see the same behavior if another interrupt is used intead of PRU, e.g. DMTimer?
What SDK software is the customer using for MMCSD transfers?我用的SDK是8.5.0.24
How is the customer enabling and registering interrupts for the MMCSD software?
HwiP_Params hwiPrms;
if((sdioAttrs->intrEnable == TRUE) && (sdioAttrs->Callback != NULL))
{
HwiP_Params_init(&hwiPrms);
hwiPrms.intNum = sdioAttrs->intrNum;
hwiPrms.callback = sdioAttrs->Callback;
hwiPrms.args = (void *)sdioAttrs;
hwiPrms.priority = 0x03;
status = HwiP_construct(NULL, &hwiPrms);
}
How is the customer determining the MMCSD1_NORMAL_INTR_STS bits aren't set inside the PRU ISR?
MMC发送完数据后,直接连续读取MMCSD1_NORMAL_INTR_STS ,看XFER_COMPLETE是否置1.
What is the value of these registers if the MMCSD read/write is invoked outside the PRU ISR?
已更新,图片也可以右键在新标签页打开查看
请看下面e2e工程师的回复。
I understand the customer is using their own SDIO driver. Is that correct?
Can you please confirm my above summary is correct?
Thanks for sharing MMCSD1_NORMAL_INTR_SIG_ENA / MMCSD1_NORMAL_INTR_STS_ENA outside the PRU ISR. From your snapshot, I understand:
What are the values of these registers inside the PRU ISR?
Does the customer see the same behavior if another interrupt is used instead of PRU, e.g. DMTimer? This should be a simple experiment for them.
I can't think of a reason MMCSD status register updates would be masked (or not update) inside an ISR (PRU or otherwise). I don't think this has anything to do with PRU host interrupts, R5F VIM, or the SDK IRQ handler.
I'm reassigning this thread to a colleague with more expertise on MMCSD.
Summary:
PRU_ICSSG1_PR1_HOST_INTR_PEND_1,PRU_ICSSG1_PR1_HOST_INTR_PEND_2,PRU_ICSSG1_PR1_HOST_INTR_PEND_3,PRU_ICSSG1_PR1_HOST_INTR_PEND_4
是的,PRU=1,MMCSD=15。当MMCSD优先级改成其他,比如4,也是一样结果
MMCSD1_NORMAL_INTR_STS状态位XFER_COMPLETE,不能更新置1
请看下面e2e工程师的回复。
To analyze the problem more in depth, can the customer share the project where the problem is replicated ? This will save us some time in recreating the project. Customer can choose to remove all their proprietary SW and replicate the issue on a vanilla software from SDK code base.
This will really speed-up the debug by a few days.
请看下面e2e另外一位工程师的回复,最好能提供一个project方便工程师复现您的问题,谢谢!
Thanks for the response.
From your snapshot, I understand MMCSD1_NORMAL_INTR_SIG_ENA/MMCSD1_NORMAL_INTR_STS_ENA have these settings inside the PRU ISR:
These look normal.
Yes, DMTimer can run correctly.
To be clear, when you take the DMTimer ISR, you're able to use your MMCSD software inside the ISR and the MMCSD behaves correctly? I assume you've set the DMTimer interrupt priority to the same as the PRU ISR (when it's built into the code)? This suggests there is some issue with PRU interrupts.
I agree with Aakash and I'm again requesting an example demonstrating this behavior. I understand the customer has written custom MMCSD driver software. Also, it would be difficult for us to recreate this using SDK MMCSD APIs since they don't currently support interrupt mode (Aakash, please confirm).
请看下面e2e工程师的回复。
For starters, if we could get hands on an example that works with PRU and DMTimer that would be good start for us as well. We might need more information on how the MMCSD changes are required, but this will enable us to support better.
To be clear, when you take the DMTimer ISR, you're able to use your MMCSD software inside the ISR and the MMCSD behaves correctly?是的
I assume you've set the DMTimer interrupt priority to the same as the PRU ISR (when it's built into the code)? 优先级分别是,PRU=1,DMTimer=4,MMCSD-SDIO=0x0f