Hello,
is it possible to combine bare metal and MQX code? We developed a bare metal application for Kinetis K60 and now we realised that some MQX parts would be useful for us - task management, RTCS. We don't want to edit our bare metal code. Will we be able to call our bare metal drivers (some are interrupt driven) from MQX tasks?
Thanks
Yes, you can use pieces of bare metal code inside MQX tasks. However you have to take care about different programming approach (endless loop versus tasks) and carefully synchronize.
You can use also your own drivers, but you have to take care also about hardware initialization (some hw is already initialized in BSP code therefore you probably cannot simply copy-paste your bare metal code).
If you want handle interrupts outside of MQX, you have to update vector table:
For example:
_int_install_kernel_isr(Vector, isr_ptr); /* works only for vector table located in the RAM */
_bsp_int_init(vector, priority, subpriority, enable);
3. MQX managed isr are initialized by commands:
_int_install_isr(vector, isr_ptr, isr_data);
_bsp_int_init(vector, priority, subpriority, enable);
Best Regards,
RadekS
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------