Hello!
While trying to implement a custom update facility, I have run startupAreaSelect of the r_flash_hp API, expecting to boot from the second block with the next reset. I have however been unable to get any code running from flash since then. I have of course tried linking with a start adress of 0x2000 but this did not work.
Every code I run crashes with a segfault while trying to execute some large adress far outside the code flash space.
Running a program from RAM (0x1FFE0000) works perfectly. I have also tried to reset the startup area by calling startupAreaSelect(... BLOCK0, false ...) in a program running from RAM but I still can not get any code from flash working, no matter the start offset.
I have also tried to flash the original out-of-the-box demo using jlink.exe directly, but it fails with the same message for all .bins I have tried to flash:
Programming failed @ address 0x00000000 (block verification error) -- End of flash programming -- Start of restoring -- Restore RAMCode -- Restore content of target memory -- Restore target -- Restore memory -- Restoring CPU registers -- End of restoring -- Restarting due to program error (possibly skipped erasure of half-way erased sector). -- Skip optimizations disabled for second try. -- Restarting flash programming due to program error (possibly skipped erasure of half-way erased sector).
The debugger reports both memory-mirror registers (MMSFR and MMEN) as 0x0, though I don't know if these are used at all.
Is there any other mechanism which could prevent me from writing to flash succesfully? Or which could manglecode execution from flash? I have already called accessWindowClear() from my in-RAM "rescue" program, but that did not help either.
Thank you for any support or ideas!