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 ?
Hi Jack,
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 ?
myke
Hi JACK LIU ,
Please tell me which board you are using? Your own designed board or the NXP official board?
If you are using the NXP official board, do you use the related SDK code:
https://mcuxpresso.nxp.com/en/select
Please also check the chip you are using, is it match your code?
Wish it helps you!
If you still have questions about it, please kindly let me know.
Kerry
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
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:
Welcome | MCUXpresso SDK Builder
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:
If you still have questions about it, please kindly let me know.
Kerry
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------