AnsweredAssumed Answered

MQX 4.1 flashx driver hard fault on erase sector

Question asked by Erick Castillo on Mar 27, 2015
Latest reply on May 17, 2015 by Daniel Chen



I am currently trying to use the flashx driver to load a second firmware image to the second half of a 1MB flash only flavor of a K61. Everything through the driver seems to go fine until I enter the "ftfe_flash_command_sequence()" function. Right where this function tries to jump to RAM to execute the "ftfe_ram_function()", via a function pointer, I get an immediate hard fault. I have the following questions.


1. Since I'm programming a completely different bank from the one I'm currently executing in, I don't need to trigger the command from RAM right? (Also, it appears the driver is forcing the jump to ram since FLASH_IOCTL_WRITE_ERASE_CMD_FROM_FLASH_ENABLE does not seem to be a supported IOCTL command in this version of the driver).

2. Is there something I need to enable/disable before I attempt to execute a function in RAM? Is MQX getting upset?

My set-up is as follows:

Chip :K61F120M

Flash Configuration: 1MB (4 Banks)

MQX Version: 4.1

Compiler: Keil armcc