Dear Sirs,
Refer to https://community.nxp.com/message/1168364 , the timer0 interrupt is triggered continuously. The interrupt did not stopped no matter start by vAHI_TimerStartSingleShot function.
How to explain this situation? please.
Thanks!
Solved! Go to Solution.
Hi Alan,
I am sorry. Please look at the information below.
SPI Master
If enabled, a SPI interrupt is generated when each transfer has completed. There is no API function to clear down this interrupt and therefore a workaround is needed:
u32Data=u32REG_SpiRead(REG_SPIM_IS);
u32REG_SpiWrite(REG_SPIM_IS,u32Data);
These register access functions are not described in the JN516x Integrated Peripherals API User Guide (JN-UG-3087) but are available in the header file PeripheralRegs.h, which is included in the SDK.
https://www.nxp.com/docs/en/user-guide/JN-UG-3075.pdf
Regards,
Mario
Hi Mario,
Just like my timer 0 interrupt can not be stopped.
Why is my SPI interrupt triggered non-stop?
Hi Alan,
The interrupt will be generated depend if the device finished the transmit or received.
Please look at the 14.6 SPI Interrupts
Regards,
Mario
Hi Mario,
Maybe I did not explain my problem clearly.
My SPI problem is the interrupt triggered infinitely.
The "vAHI_SpiStartTransfer8()" was run only one time, but the interrupt callback (vSpiIntCb) was triggered continuously.
Captured the debug logs as below lines.
vSpiIntCb(Id=0x00082541, Bitmap=0x00000004)u8Data=0xff
vSpiIntCb(Id=0x00082541, Bitmap=0x00000004)u8Data=0xff
vSpiIntCb(Id=0x00082541, Bitmap=0x00000004)u8Data=0xff
vSpiIntCb(Id=0x00082541, Bitmap=0x00000004)u8Data=0xff
vSpiIntCb(Id=0x00082541, Bitmap=0x00000004)u8Data=0xff
vSpiIntCb(Id=0x00082541, Bitmap=0x00000004)u8Data=0xff
vSpiIntCb(Id=0x00082541, Bitmap=0x00000004)u8Data=0xff
vSpiIntCb(Id=0x00082541, Bitmap=0x00000004)u8Data=0xff
vSpiIntCb(Id=0x00082541, Bitmap=0x00000004)u8Data=0xff
vSpiIntCb(Id=0x00082541, Bitmap=0x00000004)u8Data=0xff
vSpiIntCb(Id=0x00082541, Bitmap=0x00000004)u8Data=0xff
vSpiIntCb(Id=0x00082541, Bitmap=0x00000004)u8Data=0xff
vSpiIntCb(Id=0x00082541, Bitmap=0x00000004)u8Data=0xff
vSpiIntCb(Id=0x00082541, Bitmap=0x00000004)u8Data=0xff
vSpiIntCb(Id=0x00082541, Bitmap=0x00000004)u8Data=0xff
It seems the interrupt flag ("Bitmap") is not cleared and cause the interrupt happened continuous.
How to solve this kind of problem?
Hi Alan,
I am not sure if your device is the Master or the Slave.
However, please look at the B. Interrupt Enumerations and Masks and the vAHI_SpiStartTransfer8 API that are described in the next link. https://www.nxp.com/docs/en/user-guide/JN-UG-3087.pdf
Regards,
Mario
Hi Mario,
My device is Master.
Once the "vAHI_SpiStartTransfer(7, 0x04)" was run, the interrupt callback (vSpiIntCb) was triggered continuously.
Not only an interrupt was triggered, but also lots of interrupts were triggered by SPI.
How to fix this issue?
Hi Alan,
Just to confirm, did you follow the 14.5.1 Performing a Data Transfer?
https://www.nxp.com/docs/en/user-guide/JN-UG-3087.pdf
Do you have any other interrupts enabled? Are you seeing the SPI commands using a logic analyzer?
Regards,
Mario
Hi Mario,
Based on JN-AH-1218, I only add the SPI interrupt settings.
The firmware is load to run on Carrier Board (DR1174+DR1175).
I follow the 14.5.1 perform a data transfer.
It works fine if interrupt is disabled. And, SPI flash can be read/write normally.
However, the interrupts are triggered continuously if interrupt is enabled.
Is there any API to clear the interrupt register/flag?
Thanks!
Hi Alan,
I am sorry. Please look at the information below.
SPI Master
If enabled, a SPI interrupt is generated when each transfer has completed. There is no API function to clear down this interrupt and therefore a workaround is needed:
u32Data=u32REG_SpiRead(REG_SPIM_IS);
u32REG_SpiWrite(REG_SPIM_IS,u32Data);
These register access functions are not described in the JN516x Integrated Peripherals API User Guide (JN-UG-3087) but are available in the header file PeripheralRegs.h, which is included in the SDK.
https://www.nxp.com/docs/en/user-guide/JN-UG-3075.pdf
Regards,
Mario
Hi Mario,
To replace the "u32REG_SpiWrite" with "vREG_SpiWrite", it works.
Thanks a lot!
Hi Alan,
Are you cleaning the flag?
The u8AHI_TimerFired API clears the interrupt flag.
(void) u8AHI_TimerFired(E_AHI_TIMER_0);
Regards,
Mario
Dear Mario,
Yes, it seems the interrupt stopped after cleaning the flag.
But, is it really true let application to clear the interrupt flag?
How to clear the other peripherals' (ex: UART, SPI and I2C) interrupt fllags?
Thanks!
Hi Dear,
In this case, the timer interrupt needs to be clear by the application.
The UART module an interrupt is normally automatically cleared before the callback function is invoked.
Please look at the JN516x Integrated Peripherals API User Guide for a better reference for the other modules.
Regards,
Mario