Now I'm working on bootloader. I try to disable all mqx interrupt before I jump to the boot code using
int_disble()
cpsid i
bx lr
But still the mqx interrupt happen when in boot code. Can someone tell me how how to totally disbale all the mqx interrupt before I jumpto my boot code.
Hi shark,
quote from the MQX Reference manual : "The function _int_disable() disables all hardware interrupts at priorities up to and including the MQX disable-interrupt level." To disable all interrupts, use psp function cortext_int_disable in file cortex.c.
Regards,
MartinK
Hi MartinK,
Thank you for the reply. But which IRQ i need to disable? Can you give me exmple how to use this function. I'm still a newbie in the MQX and cortex so I don't know which interrupt use by MQX. I need to delete all the MQX app in the flash(including the vector) after I jump to the boot code. The hardware will hang when I delete the MQX data portion because the MQX still running. How I can totally stop the MQX when I jump to the boot code?
Regards,
Shark
Hi shark,
first of all, the cortex_int_disable() disables all interrupts in the core.
Then you have to jump to the boot address. At boot process, you have to make your own flash rutine running in the RAM- that is not easy, of course. That routine would read data from UART and program the flash. After the end of this routine, you will continue in the boot process.
If you want to flash in MQX, that is also possible, but again- you need your flash routine in the RAM. Note that any jump to the address located in the flash area will fail.
Regards,
MartinK
Hi MartinK,
Thanks for your reply. I already implement disable interrupt using cortex_int_disable(). But this finction only can disable IRQ more than 16. I'm not able to disable interupt for IRQ <16. This is for the ARM core system vector. From what I know, MQX use this (Systick,PendSV,SVCall,Debug Monitor) vector. Can I disable this interrupt and how?
Regards,
Shark
Hi shark,
that function is not in MQX . More information about possibility to disable all interrupts are on ARM website.
Follow this link and check Examples in the bottom of the page : http://infocenter.arm.com/help/topic/com.arm.doc.dui0552a/BABHBAAB.html
You need to execute this instruction : CPSID f ; Disable interrupts and all fault handlers (set FAULTMASK)
Regards,
MartinK