Hello,
I am using the KL02 in my design, and have produced a prototype board. I'm having issues connecting to the chip, however.
using JLink Commander, I am apparently able to erase the chip, but I cannot successfully do anything else from, e.g., IAR. Occasionally when trying to program the chip, but not always, I get the message that the chip is secured. I select "unsecure," but the process still fails. Here is the error message I've been getting:
Failed to prepare for programming.
Could not read target memory.
Please check your flash settings!
Besides selecting a device, there does not seem to be any other flash settings to check.
Has anyone seen this and successfully recovered from it?
Any ideas what I'm missing?
Solved! Go to Solution.
You should check some points:
1 Hardware
(1) RESET_b pin need external 4.7K to 10K pullup resistor, and have a 100nF capacitor connect to the ground
(2) NMI_b pin need external 4.7K to 10K pullup resistor
(3) SWD_DIO need 10K external pullup
Please check these points
2 unsecure your chip
Use JLink commander, and input: unlock kinetis
Whether it can be unsecured.
3 Test code
Give me your IAR project, I need to check it whether your code is correct.
Waiting for your reply!
Have a great day,
Jingjing
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
You should check some points:
1 Hardware
(1) RESET_b pin need external 4.7K to 10K pullup resistor, and have a 100nF capacitor connect to the ground
(2) NMI_b pin need external 4.7K to 10K pullup resistor
(3) SWD_DIO need 10K external pullup
Please check these points
2 unsecure your chip
Use JLink commander, and input: unlock kinetis
Whether it can be unsecured.
3 Test code
Give me your IAR project, I need to check it whether your code is correct.
Waiting for your reply!
Have a great day,
Jingjing
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
1. The hardware was not correct, but upon fixing it, the issue persists
2. The device can be unlocked. When starting up from scratch in JLink Commander, I can:
- connect to the device (device MKL02Z32xxx4)
- erase device (erase)
- read device configuration registers (rconf)
- and get hardware status (st)
From IAR, however, nothing...still the flash settings issue
3. I will set up a simpler project and try it, then send it if there's still an issue.
I re-generated the CPU code from processor expert, and now IAR happily targets and debugs the processor...I didn't expect an incorrect processor selection (same family, different package) to generate a flash settings error, but thank you for your assistance.