USB bootloader for the LPC17xx

1,231 views
Skip to first unread message

Casainho

unread,
Jul 17, 2010, 6:09:42 AM7/17/10
to MicropendousX, fmen...@gmail.com
Hello :-)

I were looking at USB bootloader provided from NXP, the "AN10866
LPC1700 secondary USB bootloader". I would like to have such
bootloader however the source files have this written:

/
*----------------------------------------------------------------------------

* Name: MEMORY.C

* Purpose: USB Mass Storage Demo

* Version: V1.10


*----------------------------------------------------------------------------

* This file is part of the uVision/ARM development tools.

* This software may only be used under the terms of a valid,
current,

* end user licence from KEIL for a compatible version of KEIL
software

* development tools. Nothing else gives you the right to use it.

*

* Copyright (c) 2005-2007 Keil Software.


*---------------------------------------------------------------------------
*/

Does anyone knows if there is another GPL alternative to this
bootloader? I am working on an OpenSource project.

BobC

unread,
Jul 17, 2010, 12:18:15 PM7/17/10
to MicropendousX
I thought that LPCUSB was the open stack to use for LPCs.

http://sourceforge.net/projects/lpcusb/

Opendous Inc.

unread,
Jul 17, 2010, 2:16:09 PM7/17/10
to MicropendousX
You cannot use the NXP Bootloader without a valid license for Keil.
It is written for Keil so it would take some porting to make it work
with GCC.

However, I just discovered that Code Red Tech has basically done
everything I had intended to do with my MicropendousX LPC17xx project
in a mostly Open Source way. They even switched to the LAN8720 and
have created a LPCUSB-based Mass Storage Bootloader demo!
http://support.code-red-tech.com/CodeRedWiki/RDB1768cmsisExampleProjects

You can purchase their RedSuite if you want everything to work out-
of-the-box or you can port their demos to the Open Source version of
CodeSourcery by using my makefile and startup files.
http://www.code-red-tech.com/red-suite-2.php

joshua wojnas

unread,
Jul 17, 2010, 11:52:07 PM7/17/10
to microp...@googlegroups.com
So would that ARM Code work with the leaflabs arm maple board so It
could use the virtual com port?

I am very interested in that would it work at a faster than normal com
port speed?

I am refering to the sourceforge project mentioned above... if not
that then the other???

--
thanks for your time,
Joshua Wojnas
315 5071070
My webpages on electronics
... comming soon

Casainho

unread,
Jul 18, 2010, 5:02:34 AM7/18/10
to microp...@googlegroups.com
On Sat, Jul 17, 2010 at 7:16 PM, Opendous Inc. <open...@gmail.com> wrote:
 You cannot use the NXP Bootloader without a valid license for Keil.
It is written for Keil so it would take some porting to make it work
with GCC.

 However, I just discovered that Code Red Tech has basically done
everything I had intended to do with my MicropendousX LPC17xx project
in a mostly Open Source way.  They even switched to the LAN8720 and
have created a LPCUSB-based Mass Storage Bootloader demo!
http://support.code-red-tech.com/CodeRedWiki/RDB1768cmsisExampleProjects

 You can purchase their RedSuite if you want everything to work out-
of-the-box or you can port their demos to the Open Source version of
CodeSourcery by using my makefile and startup files.
http://www.code-red-tech.com/red-suite-2.php

Thanks! I did download the code and I will now try to build it. I hope is just a matter to add the source files on makefile... If I have success, I will share the code Matt, in the intention of you sharing with with Micropendousx.

I were also looking for USB<->Serial code, Code Red Tech also share in OpenSource that demo :-)

Casainho

unread,
Jul 18, 2010, 12:56:58 PM7/18/10
to microp...@googlegroups.com
On Sat, Jul 17, 2010 at 7:16 PM, Opendous Inc. <open...@gmail.com> wrote:
 You cannot use the NXP Bootloader without a valid license for Keil.
It is written for Keil so it would take some porting to make it work
with GCC.

 However, I just discovered that Code Red Tech has basically done
everything I had intended to do with my MicropendousX LPC17xx project
in a mostly Open Source way.  They even switched to the LAN8720 and
have created a LPCUSB-based Mass Storage Bootloader demo!
http://support.code-red-tech.com/CodeRedWiki/RDB1768cmsisExampleProjects

 You can purchase their RedSuite if you want everything to work out-
of-the-box or you can port their demos to the Open Source version of
CodeSourcery by using my makefile and startup files.
http://www.code-red-tech.com/red-suite-2.php

Ok, I were able to build the code :-) -- I didn't have yet free time to run/debug it.

There is a folder named "checksum" with a text file saying:

"checksum.exe is an executable that can be used to add checksum data
to a binary image, which can be used by the bootloader to determine
that the image is valid.
 
You will only need the copy of checksum.exe from this directory
if your version of the Code Red tools does not already have it 
installed.
 
For more information please see the main 
RDB1768cmsis_usb_bootloader "readme.txt". "

Since I do not want to use MS Windows and even that folder don't have any "checksum.exe" file, I may change the firmware code to ignore the checksum on firmware bin file.

Matt, did you already made some tool to add this checksum? I think you did mention something before... something in Python, no?
LPC17xx_USB_bootloader.tar.bz2

Casainho

unread,
Jul 18, 2010, 1:00:42 PM7/18/10
to microp...@googlegroups.com
There is a define :-)

// If COMPUTE_BINARY_CHECKSUM is defined, then code will check that checksum
// contained within binary image is valid.
#define COMPUTE_BINARY_CHECKSUM

Casainho

unread,
Jul 18, 2010, 4:07:49 PM7/18/10
to microp...@googlegroups.com
Looks like the firmware/hardware do not works :-(

I builded the code and did run/debug it as you can see on the screenshots I am sending.

I get this errors:

[ 1261.621189] usb 2-1: new full speed USB device using uhci_hcd and address 65
[ 1262.036255] usb 2-1: device not accepting address 65, error -71
[ 1262.036305] hub 2-0:1.0: unable to enumerate USB device on port 1

I do not have luck with LPC and USB on Opendous boards... last time I tested LPC1343 I couldn't also getting the factory USB bootloader working :-( -- right now, only the AVR and i.MX233 Opendous boards were the only working for me with USB...
LPC17xx_USB_bootloader.tar.bz2
CapturaEcra.png
CapturaEcra-1.png

Opendous Support

unread,
Jul 18, 2010, 10:26:59 AM7/18/10
to MicropendousX
It should work up to about 1Mbit/s, the theoretical limit. Both
processors are fast enough that this should be attainable.

Casainho

unread,
Aug 23, 2010, 6:21:14 PM8/23/10
to MicropendousX, mth...@rhrk.uni-kl.de, fabio sousa
Ok, the USB bootloader for LPC17xx now works. I did run it on LPC1768
on a NGX BlueBoard from a friend :-)

I tested the binary file for USB bootloader from CodeRed and it worked
on the board, next I went to build the code and try. The Makefile from
Opendous produce a code that don't work and so I decided to use
another Makefile from some other working code/project -- I ended up to
use one Makefile from Martin Thomas, which share a lot of project
files for ARMs, using GCC, OpenOCD and Eclipse :-)
http://www.siwawi.arubi.uni-kl.de/avr_projects/arm_projects/arm_memcards/index.html#chanfat_lpc_cm3

Next I will test the same code on Opendous board I have with the same
LPC1768 - before I thought the code didn't worked on that board
because hardware problems, but now I know there was a firmware
problem.

I am sharing the code - Matt, please update your Makefiles and code :-)

lpc17xx_chanfat_mthomas-usb_bootloader.tar.bz2
Reply all
Reply to author
Forward
0 new messages