I have run into an issue with flashing to the LPC54S018J4M spifi flash on the NXP eval board. The IDE is MCUXpresso v11.3.0. Here is the error from the GUI flash tool console:
Opening flash driver LPC540xx_SPIFI_SFDP.cfx (already resident)
Using SOFT reset to run the flash driver
Flash variant 'JEDEC_SFDP_EF4016' detected (4MB = 64*64K at 0x10000000)
Writing 15112 bytes to address 0x10000000 in Flash
1 of 1 ( 0) Writing sectors 0-0 at 0x10000000 with 15112 bytes
( 0) at 10000000: 0 bytes - 0/15112
Unable to perform operation!
Command failed with exit code -1073741819
It had been working fine for weeks, and all I did was add some code to update some housekeeping data in a struct in .data that is 0x50 in size at address 0x18. It consistently fails to flash when I compile in the code that updates the data in my main loop. When I remove this block of code, it consistently succeeds in flashing the program. I don't think my code has anything to do with the error, and would like to understand more about exit code -1073741819. Does anyone know what might have caused this error?
Additional information: The same code compiled with -O2 flashes to the MCU fine, but fails when compiled with -Os. -1073741819 could be 0xC0000005, which is access violation on Windows, the host OS I am running on.