-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Building for FRDM-KL25Z on Kinetis Design Studio #3
Comments
I have been working an a C++ version for a stand-alone programmer and it looks like some of the changes have crept into this version. (https://github.com/podonoghue/usbdm-kinetis) I have fixed these and pushed an update. It now builds with KDS (and Eclipse I would expect) with the USBDM plugin. Finally - About your original problem. I suspect it is due to the bootloader code that is in the KL27. I confirmed use of a FRDM_KL25 programming an external device (not KL27!) with the firmware provided with the current USBDM version. I don't have a stand-alone KL27 to test this arrangement with however using a FRDM-KL27 board the software worked fine with the on-board chip so I would not expect any problems with the other arrangement. bye |
Peter, I still had problems with the usbdm-make. I am not doing something right, but got it to work by setting all the arm-none-eabi-xx binary files to "Run As Administator". My KDS is installed in C:\Freescale\KDS_v3, I suspect it doesn't run in the right environment from there. In any case, the code builds the elf file but usbdm-make fails on the post-build step. The makefile has the following for post-build
I think the dashes are the problem. So I manually run the command and get a binary. When I load it into the K20 and connect it to the PC (Windows 10) and I get a USB Composite Device with a "This device cannot start. (Code 10)" Device status. It shows a Hardware ID of USB\VID_16D0&PID_06A5&REV_004< As you know, working code gives me a hardware ID that has "&MI_00" and "&MI_01" on the end. BTW, I have lifted the SWD and reset pins on the KL25 processor to remove any interaction from it with my processor. Even with that the connection to the debugger is flaky. So I have something misconfigured in the build of the firmware. What do you think it is? Thanks, |
Peter, I have decided to spend a little time understanding the firmware and where I might try to make changes when I get working code set. When my processor is erased, the reset line has the oscillating waveform that others have seen. I have played around with changing the capacitance on the reset line which does influence the frequency. I suspect I can make this work by playing around with that. But I see that others have had this problem with new chips and I think we can make the firmware more robust and make it work when the reset line is misbehaving. According to the log, it fails when attempting a Mass Erase (Chip Detect seems to work most of the time even though the log shows "Target reset pin timeout (rise)" errors. BTW, I am using the "UsbdmFlashProgrammer-debug.exe" program for testing. It is very helpful having these tools, you are to be commended. Hopefully, I can help find where the firmware can be improved since I have a misbehaving system. For example, looking at the mass erase code in firmware I see that it toggles the Green LED. A clue is that the Green LED blinks once at about a one second interval before failing. BTW, this is a fresh from the factory IC. I have not loaded boot code into it. That is probably another way to solve my problem. So looking at the firmware, I see that the swd_readReg and swd_writeReg have no retries if the processor responds with anything other than a 1 (SWD_ACK_OK), 2 (SWD_ACK_WAIT) or 3 (SWD_ACK_FAULT). I am reading the debug documentation. It appears that something happens when the MASS_ERASE bit is set in the MDM-AP.Control register to cause the SWD to quit responding. Since it appears to only take one failure in the above functions it could be some timing issue. Steve |
Peter, I am thinking there is more happening here and the possibility of more information for you (and me). Steve Using any suitable USBDM interface ===================================== ===================== ===================================== ===================== |
Peter, Steve |
Peter, I am getting a little desperate. I am supposed to meet with my customer tomorrow. I want to show him some progress on his project. Unfortunately, he won't see fixing the debugger as progress. And I haven't even done that! Steve |
Peter, Thanks, |
Peter, Steve |
Peter, Thanks, |
Peter, Thanks, |
Peter, #define CDC_COMM_INTF_ID 0 to #define CDC_COMM_INTF_ID 1 and the USB is now registering correctly. Now to find out if the rest of my build acts like your code. Steve |
Peter, I downloaded a zip file from Github, instead of forking. Were the above defines wrong in the code I got? If we can understand why that happened, then maybe it will reveal where this other stuff is happening. I can fork the code if that is needed. Thanks, |
Peter, It appears that there is a problem with my Windows 10 environment and building your code. I had been playing around with various compatibility settings on the executables, but it didn't seem to work. I will try to figure out what is happening. With the Windows XP builds I have object files that work and Windows 10 ones that don't. I should be able to use some of the inspection tools for object files to see how they differ and maybe track down what is going on. Thank you for your help so far. I think I am kind of on my own at this point. I have a misbehaving processor and I should be able to track down why it doesn't want to maintain communication. I will keep you updated on my findings. You have a great system supporting a wide range of processors, programming environments and debuggers. You should be proud of your achievements! I hope I can contribute a little to your success. Steve |
Dear Steve, I have corrected a few more errors with the USB code and update the repository. I think I must not have tested the previous version properly (probably downloaded the wrong file to the board!) If you want to test this version from scratch you can follow the following steps:
As mentioned earlier, if you want to play around with the connection/reset sequence you should be looking at the TCL scripts and also the USBDM interface DLL code and that is where most of the work is done for the Kinetis targets. The firmware is mostly a dumb slave. bye |
Dear Steve, I have retested with an stand-alone MKL27Z64 device and have been unable to get it to miss-behave, bye |
Peter, With a working debugger, I have made great progress on my project, my customer is happy, I am happy. Your system is making it possible. I am very thankful for your work on this. It is not only the low cost, but that I have access to the entire system that makes this so valuable to me. I have been an engineer for many years and I have dealt with vendors that had bugs that took me many days to convince there was a problem and then a long time to get them to fix it. I love open source! Thank you very much for your work. |
I am using a modified FRDM-KL25Z board to debug a KL27Z design. The debugger is flaky and works sometimes, but mostly doesn't work. Using the debug log in the AppData I can see that it is talking to the processor but doesn't like that the reset line doesn't do what it is expecting. I can't fix the reset line, but it appears that the debugger should work even if the reset line is misbehaving. So I decide to "fix" the firmware. I try to import into KDS and build the USBDM_Kinetis firmware. There are multiple issues. One is that the complier won't work correctly when called by usbdm_make. I create a new project and start adding files to build. Another issue is that it appears that all "c" files need to be build as c++ files. On line 305 of USB.c there is an unterminated #if. That error alone makes me think that this code set does not build. I have managed to get it to build, but it connects to USB as a composite device and clearly is not the same code that my debugger is presently running. Where is the proper code? Am I doing something wrong setting up this code?
Thank you for your help. This is an awesome tool. I appreciate having it as an option. I try not to be a bother, but I am getting very little return on the hours I have spent and need to use my call a friend card.
Steve
usbdm.log.txt
The text was updated successfully, but these errors were encountered: