Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
7 years, 8 months ago.
KL05Z problem programming external devices
I designed a battery powered device using the KL05 chip and developed the code using mbed and the FRDM-KL05Z board. Once my own boards were complete, I modified a KL25Z board to be a programmer (cut the trace, installed the connector) and began programming my own device. The KL05Z board can also be used, but there is a mistake in the wiring of the socket (http://mcuoneclipse.com/2013/04/27/debug-external-processors-with-usbdm-and-freedom-board/). The first board I programmed worked fine and I used that board for a few weeks fine tuning the program.
When I started programming additional boards that had never been programmed, 3 of the first 7 failed to program. There was no indication of this from mbed as the bin file appeared to copy to the part. I had already observed this limitation of the mbed programming method. You can have nothing connected and it still thinks the part is programmed. I then moved the program over to Keil uVision4 and in the process of programming boards have gotten a variety of errors: - Cannot access memory - Download failed - Kinetis locked - Device cannot be powered up
After a few tries clicking the load button, it works and I was able to program all of my parts. I had never observed this problem during development, but I did all of the development in mbed, not Keil so it is quite possible that in some cases where I thought I had downloaded a new program, nothing had happened and the previous program was still loaded.
Possible relevant information: My PC is running Windows 8. The ribbon cable from the mbed board to my board is 6" long. I got the same results using a J-Link Lite programmer in place of the KL25Z board. My reset pin has a 10k pullup and a 100nF capacitor to ground (the mbed board actually has 1uF). My 32kHz crystal has no capacitors, just like the KL05Z board.
I was able to duplicate the error about not being able to power the device using Keil and just the Freedom board and I suspect this happens when the device is in deep sleep which I do use in my code.
So, what is my question? Can anyone help me in resolving or at least explaining this problem. In addition, I think the CMSIS-DAP firmware needs to change so that an error is generated if programming did not succeed when using the drag and drop method of programming.