I have meet a problem, J-Link cannot read a sector of data flash .
Debugging the device in the IAR displays the contents of memory is "------ "As shown in the following figure.
It will cause a HardFault_Handler if the flash address is read.
What is the state of flash right now ?
What kind of operation might cause this and how to avoid it ?
Just to follow up wtih Kerry's question - what MCU are you using and which J-Link device are you using?
Could you also explain what you mean by "data flash". Is it regular flash above the program contents, "Flex Memory" (EEPROM) or ?
I am using my own designed board and my own code.
The Chip I am Using is MKW36Z512XXX4 which is match my code.
The “data flash” I wrote up here means FlexNVM ,which used as Data flash memory.
In my code ,after the device is reset or power on, the flash will be written to the specified data.
Under normal circumstances,the chip flash can be read back by JLINK,and displays the
contents of flash memory in the IAR is correct hex data .
There's some probability that it will case the problem what I said yesterday
My guess is that flash is protected ,but I'm not sure.
Hi JACK LIU
Thanks for your updated information, I checked your MKW36Z512XXX4 has:
• 256 KB program flash memory plus 256 KB FlexNVM on KW36Z
• 8 KB FlexRAM supporting EEPROM emulation on KW36Z
So, the FlexNVM area should can be read.
Do you use the SDK code which can be downloaded from this link:
Use the flash code to read the related FlexNVM instead of the IAR directly, whethet that method works or not?
If you suspect the flash project, you can check the related protect address, any protection on your side?
BTW, in the future, if you have any KW questions, you can create the question in this community: