AnsweredAssumed Answered

Using flashx io_ioctl FLASH_IOCTL_SWAP_FLASH_AND_RESET for bootloader

Question asked by Nancy Jean Burkholder on Feb 11, 2013
Latest reply on Apr 5, 2013 by Artur Gyumushyan

I am implementing a bootloader for a K60FX512VLQ12 processor. For my initial effort I used the swap_demo code from application note AN4533. I successfully implemented a bootloader in a non-MQX environment. Next I sought to incorporate the lessons learned in my application that uses MQX 3.8.1. I could not even access the swap status with MQX; I assume MQX has enabled protection for these registers.


Then I found an MQX example demo dual_flash_update for a M51 processor that I adapted to my K60 processor. I can successfully update program flash bank 1 with the code from bank 0 but when I execute



_io_ioctl(flash_hdl,  FLASH_IOCTL_SWAP_FLASH_AND_RESET, NULL);



the swap and reset does not occur.



Is this capability supported for my processor and MQX version?



The swap demo code from AN4533 stepped through the swap process and it was easy to debug each step, including the erasure of bank 1 and the actual swap step. It's not clear to me what actually went wrong with my MQX example and how to proceed, so I thought I would check to see if there are any known problems or issues.


Also, is it possible to disable whatever MQX protection settings that are preventing me from implementing the bootloader developed using the AN4533 example in the context of MQX?