- 24th July 2017 at 9:23 am #64022
In my project, I work with the M5150 processor which has eight interrupt inputs in vector interrupt mode. In the Codescape GNU Tools for MIPS.MIPS HAL functions for interrupt servicing processing hw6-hw7 interrupts are not defined (MIPS_Toolchain_Codescape_GNU_Tools_for_MIPS_Programmers_Guide.docx Issue Date : 09 Jun 2016).
An error occurred while compiling the following definitions:
void __attribute__ ((interrupt(“vector=hw6”))) _mips_isr_hw6();
void __attribute__ ((interrupt(“vector=hw7”))) _mips_isr_hw7();
In the file ..mips-mti-elf2016.05-03mips-mti-elfincludemipsm32c0.h SR_HINT6 SR_HINT7 and other related bits fields not defined.24th July 2017 at 12:43 pm #64025
The compiler generated interrupt handler logic in the HAL currently does not offer support for the MCU ASE vectored interrupt extension, so it only supports up to HW5. The two highest priority MCU handlers can still be used, but the compiler generate code will not automatically disable the lower priority interrupts. Using the following attributes will allow you to use C generated interrupt handlers for HW6 and HW7:
void __attribute__ ((interrupt(“vector”), keep_interrupts_masked)) _mips_isr_hw6();
For HW6 it will not allow HW7 to nest during executions of the HW6 handler. To unmask HW7 during HW6 handling, the C code would need to preserve EPC and STATUS then update the STATUS register to clear HW6 to SW0 and enable the IE bit. Before returning it would also need to restore EPC and STATUS.
It is also necessary to build a custom version of the mips_excpt_isr.S file. You can find a template in share/mips/hal/mips_excpt_isr.S. Copy this to your project and amend the end of the file to add the text in bold below otherwise the additional HW interrupt entry points will not be located correctly. Build this file with the same options as the rest of your project and ensure it is included in the link by specifying it directly on the command line as a .o file (rather than within an archive).
Sean.25th July 2017 at 10:09 am #64024
Probably there is a copy/paste error in your code. I did as described below.
.org 7 * VEC_SPACE
LA k1, _mips_isr_hw5
beqz k1, 1f
.org 8 * VEC_SPACE
LA k1, _mips_isr_hw6
beqz k1, 1f
.org 9 * VEC_SPACE
LA k1, _mips_isr_hw7
beqz k1, 1f
After correcting the code, Interrupt handlers appeared in the output file.
Thank you.25th July 2017 at 10:48 am #64023
Sure, sorry about that copy and paste error.
Thanks for re-posting.
You must be logged in to reply to this topic.