Preliminary LPC1347 Testing

LPC1347I received the LPC1347 boards just before Christmas and have completed the board build. So far I have two issues with the design. First I needed to increase the size of capacitor C4 on the boot-loader/reset pin to allow reliable enabling of the loader. The other issue was I swapped pins 1 and 3 on the LPC1347 schematic. The ROM boot loader defaults to using pin 3. This was easily fixed with a small jumper connecting the pins together. The corrected schematic is shown below.

After eliminating these hardware issues I began developing a new support library using the chips internal ROM drivers. What this means is the chips internal USB driver code is located in ROM which effectively reduces the amount of code you need in Flash. In short you get to use most of the 64K bytes of Flash for your code and the impact of my support library is significantly smaller. The difficulty with porting the ROM drivers is that NXP provides very poor documentation on this feature. In fact I am using an example for the LPC11Uxx which apparently uses the same ROM drivers.

I have the USB CDC to UART port working and after a lot of work I created a CDC only driver. The issue I was having with the CDC only code is; when you write to the Bulk In endpoint I was overwriting the data previously written. Without documentation it is a bit difficult to find an API call that would allow me to test if the EP was in use. This issue didn’t show up with the UART to CDC bridge because the UART is so slow the USB endpoint is always empty before the next write.

The lack of documentation for the NXP ROM driver is a serious disappointment for an otherwise great part. I tried to get the SOF interrupt to run however the interrupt handler never got called. I could manually write to the USB interrupt enable bit on the processor to force the ISR to run but the ROM driver code seems to undo that in some undocumented way. Instead of working in a vacuum I decided to use the documented Systick timer to generate 1ms interrupts that would allow me to feed the USB endpoint without over writing old data. Using Systick to generate a 1ms timer instead of the 1ms SOF start of frame interrupt is a kludge but it gets the job done. This allows me to move forward without the NXP documentation dependency. I’ll fix the code if the documentation ever becomes available.

Once the CDC was working it was straight forward to add “printf” to the library and start testing the sensors of the board. The availability of the ” STDIO ” feature will also allow me to get back to working on the support library drivers. The whole point in simplifying the environment starts with “STDIO” library support.

I love the USB MSC boot loader feature which really speeds up Flashing the part. The LPCXpresso ICE took ~30 seconds while the new loader takes 1-4seconds. I am still looking for a way to automatically start the application after the code is downloaded. Currently I need to press and hold the reset button to start the loader, then I download the code and finally reset the board again to start my application. I want to set it up so that I only need to press the boot loader button once to start the loader and have the application auto start once the code is downloaded. Of course since the code is in ROM this will be a bit tricky to manage.
LPC1347_Errata_fix

Leave a Reply

Your email address will not be published.