TI E2E Community
Hercules™ Safety Microcontrollers
Hercules™ Safety Microcontrollers Forum
TMS570 VIM Parity Error Handling
I am having a frustrating issue. I have initliatezed the VIM and have entered code to test the VIM Parity Correction routine that I created. I generate a parity error, which both the VIM and the ESM see. I have loaded the FBPARERR register with the location of the subroutine to recover from this. I see that the FIQVECREG properly displays this address to the CPU.
The problem is that the CPU never begins executing this code. It simply ignores the FIQ interrupt.
I have triple checked that the FIQ is being enabled in the CPSR. I have also double and triple checked all of the ESM and VIM registers that enable, map, etc. Is there something I'm missing?
Thanks for all you do!
I need additional information to answer your question.
What device are you using, and which board?
How do you check that the CPU does not enters FIQ?
In which mode are you using the VIM?1) The TMS470R1x legacy2) Vectored interrupts3) Hardware vectored interrupts (IRQ only)
If my reply answers your question please click on the green button "Verify Answer".
I am using the TMS570LS20216 board with a TMS570 chip.
I am using register vectored interrupts. By the way, I never saw a place to explicitly select 1,2, or 3 from your list above. I instead simply enabled the VIMs registers and initalized the VIM RAM. So far this seems to work because the FIQVECREG receives the correct ISR addresses.
I check the CPU to see it does not enter FIQ for the VIM Parity error by verifying that the VIM FIQVECREG is set to the FBPARERR address and the PARFLG is set to 1. I placed code in the ISR pointed to by FBPARERR that writes a RAM address with a known value that is different than its startup value (the startup value of this RAM address is set during startup). I also put an infinite loop into the service routine which is contained in the FBPARERR. Neither of these have anything to do with the actual ISR. I only added them to try and see if they were ever hit. The infinite loop is never reached, and the RAM is not written. I have done this while the debugger is attached and while it is not.
FYI, I have also turned off all of interrupt disables in the debug build options.
1) Legacy mode:
The CPU branches to 0x18 (IRQ) or 0x1C (FIQ) to execute the main ISR.The main ISR routine reads the offset register (IRQIVEC, FIQIVEC) todetermine the source of the interrupt.In this mode, it is easy to check if the CPU gets the IRQ or FIQ/NMI signal by setting a break point in 0x18 (IRQ) or 0x1C (FIQ/NMI)
2) Vectored interrupts:
The CPU executes the instruction placed at 0x18 or 0x1C (IRQ or FIQ/NMI vector). The instruction should be a LDR PC, [PC,#-0x1B0], the offset indicates the relative address of the interrupt vector register (IRQVECREG for IRQ interrupt, FIQVECREG for FIQ/NMI interrupt) within the vectored interrupt manager (VIM). This register will give the CPU the address of the Interrupt Service Routine (ISR) corresponding to the highest active interrupt request.In this mode, it is easy to check if the CPU gets the IRQ or FIQ/NMI signal by setting a break point in 0x18 (IRQ) or 0x1C (FIQ/NMI)
3) Hardware vectored interrupts (IRQ only)
If the vectored interrupt interface is enabled within the CPU CP15 R1register, the CPU reads the vector address as part of the IRQ interrupt entry, i.e. the CPU will read a vector address from interrupt vector interface instead of branching to 0x18. The VIM will provide directly to the vector interface of the CPU the address of the highest pending request.The CPU will branch directly to the ISR.In this mode, the processor state after an IRQ interrupt entry is determined by bit 0 of the interrupt vector (T flag = VECTOR), i.e. theLSB of the vector address will determine if the first instruction of the interrupt handler is an ARM or Thumb state instruction.In this mode, a break point at 0x18 cannot be used. The CPU will jump directly in your handler and will not stop on 0x18.
Will it be possible to receive your project so I can try to see what is going on.You can send your code directly to my email address if you don't want to post it on the forum.
What is the status on this question?
If it is answered, can you mark it as verified?
Thanks and Regards,
It was my mistake. I verified my code to turn on the FIQ interrupts in the CPSR, but another programmer's code was turning off the FIQ interrupts in the CPSR a moment before I triggered the interrupt. After discovering the "Registers" view, I was able to detect this and remedy it. Everything else I was doing was correct and lined up with what you said two posts above.
Thanks for your update.
Anyway, I have a concern about your problem description.
On this device family, FIQ interrupt are treated as NMI. That means, once FIQ are enable at the CPU level (via the CPSR) there is no way to disable FIQ anymore.Only a reset or entering FIQ/NMI mode will disable FIQ (set the FIQ disable bit in CPSR)
Can you check this point?
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.