AnsweredAssumed Answered

How do I stop MIMXRT1050 debug from erasing unused sectors?

Question asked by Michael White on Apr 11, 2018
Latest reply on Apr 12, 2018 by LPCX presso support

I have a 27 kB "bootloader" project I place in the beginning of XIP flash (0x60000000); this image boots and run as expected.  I have a "runtime" image I place at 0x60008000 (flash start + 32 kB) that is to be copied to RAM by the bootloader project.  If I create a binary file containing both the bootloader and runtime images and manually flash the binary image, XIP flash looks correct - the bootloader image is present at 0x60000000 and the runtime image is present at 0x60008000.


However, if I debug bootloader with MCUExpresso (v10.1.1) both the bootloader flash area (0x60000000 - 0x60007fff) and the runtime flash area (0x60008000 - ?) are overwritten - bootloader flash area is overwritten with the bootloader image (expected) and the runtime flash area is erased (all 0xff's, unexpected).


I've tried reducing the flash memory size seen by the bootloader project to 32 kB in "Properties --> C/C++ Build --> MCU settings" but that causes errors accessing the flash when attempting to load the image via Debug.


How do I prevent debug of the bootloader image from erasing flash blocks not needed by the bootloader image?