diff --git a/arch/mips/src/pic32mz/pic32mz-head.S b/arch/mips/src/pic32mz/pic32mz-head.S index 32197a8f532..84c4ed9e082 100644 --- a/arch/mips/src/pic32mz/pic32mz-head.S +++ b/arch/mips/src/pic32mz/pic32mz-head.S @@ -539,6 +539,16 @@ __start: and t0, t0, ~CP0_STATUS_BEV /* Clear BEV */ mtc0 t0, PIC32MZ_CP0_STATUS +#ifdef CONFIG_MIPS_MICROMIPS + /* Exception handlers are also being compiled for microMIPS, so enable + * config3ISAOnExc now that exception vectors have been [re]located. + */ + + mfc0 t0, MICROAPTIV_CP0_CONFIG3 /* Load CONFIG3 register */ + or t0, t0, CP0_CONFIG3_ISAONEXC /* Specify microMIPS mode on exceptions */ + mtc0 t0, MICROAPTIV_CP0_CONFIG3 /* Update CONFIG3 register */ +#endif + /* Start NuttX. We do this via a thunk in the text section so that * a normal jump and link can be used, enabling the startup code * to work properly whether main is written in MIPS16 or MIPS32