-- FIXED --  Code works via JTAG but not after USB DFU  -- FIXED --

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by ehughes on Sun Oct 26 10:09:26 MST 2014
I am working on a project with a client using the the LPC4357  We have a hard deadline of Nov 3 to ship the product to a first customer.  I’ll try to succinctly describe the issue and then I can supply more data to work through it.

Up until today, I have been using the debugger (LPC-LINK-2 and RedProbe) to load code.  All is well as I am just trying to get the 1st version of the application code ready.     Out hardware is setup for the DFU boot on USB0.    We were shipping the customers an initial version and will be providing them some updates down the road.   So,  this piece is important.

1.)  I have verified that our DFU boot circuit works but making a simple IO test program.    It simply toggles an IO on the M4 core.      I generate the BIN file w/ correct checksum and program with not issues using the DFUsec utility.
2.)As I am using both cores in the LPC4357,  I got a second bin file for the second core setup and it programs using another step in the DFUsec utility.  The other bin is generated in the M0 core project
3.)At this point I believe I am correctly generating BIN files with proper checksums as the test program boots up just fine
4.)When I tried to load my real application, I noticed that everything seemed to hang early in initialization.   (I have a buzzer and LCD on our hardware for output).   Keep in mind, my code works fine over a the JTAG debugger.   No issues what so ever.
5.)So,  I started using a bisect method on my code (commenting out init code to see where things were hanging).   I was able to find that calls to the USB libraries (I am using the ROM driver on USB 0 and USB host software driver on USB 1 from LPCOpen) were the issue.   It appears (hard to tell without debugger) that the program hangs around the clock/PLL routines.   I have not gotten to the exact problem as it it first seemed like USB1 but after removing that init call, USB1 and the SD card are also a problem.

6.)  There is something different about the DFU utility as when I use the JTAG,   the code runs just fine.   After it is loaded, it will restart fine after power up, etc.

Now,  I am able to keep working with the JTAG until the ship date but I really need to figure this one out.    I searched the forums and could not find a similar issue.

I will supply you with whatever you guys need to work this one out.  I am a bit frantic here (as evidence by my weekend work schedule). Any help would be appreciated.