I have a problem when run USBMem Keil Example for LPC2888. I got "device descriptor read/all, error -71". And sometimes with 10 trials, the device will run for 1 or two times, but fail most of the time. I know from NXP that with old version of LPC2888 can't run at high speed, so I just bought new version of LPC2888 and try for high speed again. My LPC2888 part number is lpc2888fet180 /01, and I want to know can it run at high speed?
"With 3 feets usb cable and using the given firmware Memory.axf in LPC2888/USBMem example for version 3.40. It gives error and usb can not run.
When change it to 1 feet usb cable, there is no error and usb works."
This symptom suggests noise problem, which should be handled with circuit design and board layout. For Hi-speed, more careful design is required than full-speed. With proper design, 3m cable will work.
a) Shield - GND connection The shield pin(s) of USB connector is connected to GND plane over a resistor in parallel with a capacitor.
These Cypress appnote shows a typical connection. "AN1196: EZ-USB FX2 PCB Design Recommendation" on Cypress " on Cypress Termination Resistors, USB Peninsula, and Crystal
c) VBUS line filter For bus-powered device, attach a VBUS line filter of a ferrite bead (or a choke coil) and a capacitor (1 - 10 micro-F, ceramic).
This USB ECN recommends capacitor larger than 1 micro-F on VBUS
USB 2.0 Specification www.usb.org/.../usb_20_122208.zip Device Capacitance ECN.pdf
Tsuneo
In this case, it wasn't a decrease but an increase in optimization levels that was needed? That is a lot better than the reverse, since a higher optimization level may be required to make critical sections fast enough.
Had it been the reverse, i.e. it fails at higher optimization levels, then I would not have liked the code and/or compiler.
A thing to think about. If optimization 0->1 is required, you may not have much safety margin so own changes to the code may push it to failure even at optimization level 1.