I'm using the DK6 / K32W061. I am building a simple bootloader program, starting from the standard blinky demo. When I attempt to read a flash area that is empty, the BusFault_Handler is called, which has a while(1) {} endless loop.
When I write data to that segment by loading another program at that address, or by using the FLASH_Write function, I can read from that address without BusFault.
What is the mechanism that prohibits reading from empty flash pages and how do I get read access to these flash pages? I do not know in advance if it is empty or not. Using FLASH_Read did not solve the problem. It doesn't hit a BusFault, but it returns 16 bytes of 0x00 instead of the expected 0xFF. By the way, why would I prefer to use FLASH_Read instead of addressing the memory directly? I don't get it.
Hi,
Hope you are doing well. I answered to you in your private case.
Best Regards,
Ricardo