paparazzi-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re: [Paparazzi-de =?ISO-8859-1?Q?vel] USB bootloader?=


From: martin
Subject: Re: Re: [Paparazzi-de =?ISO-8859-1?Q?vel] USB bootloader?=
Date: Sun, 18 May 2008 09:52:50 +0200 (CEST)

Hi Scott,

> So one procedure for putting on the bootloader (windows) is:
> -use the serial bootloader (lpc21isp) and put on the rom version.
> -the computer now detects a "libusb\bootloader" device. Install the
> libusb driver for it.
> -now use  lpc21iap to put on the bl_ram.elf, then use lpc21iap to put
on
> bl.elf in that order, restart the chip with the boot pin high
> I did this and now I can use the bootloader to load on my own
> applications correct?

that should work - but as described in the wiki just loading the ROM
(bl.elf) version with lpc21isp once should do. The RAM version
(bl_ram.elf) is there to flash sw at address 0 to upgrade the ROM
bootloader (make bl_upgrade).

> I changed the boot pin from vbus to another with a jumper (0.13) so I
> can run my own USB app code after bootloading.

Make sure you set P0.23 high internally to get the USB module working
(usbhw_lpc.c) in your sw.

    /* turn on Vbus as not connected in hardware */
    IOPIN0 |= (1 << 23);

> I have tried to put on the example lpcusb applications with lpc21iap
so
> far.  I changed them like this so they would start at flash address
0x4000:
> in the Makefile I added -n to the linker parameters,
> in the linker script file "lpc2148-rom.ld" I changed the following
>
>     MEMORY
>     {
>         flash                 : ORIGIN = *0x00004000, LENGTH = 496K*
>     /* FLASH ROM     *  changed from 0x00000000, Length 512K*
>                             */
>         ram_isp_low(A)        : ORIGIN = 0x40000120, LENGTH = 223
>     /* variables used by Philips ISP bootloader    */
>         ram                   : ORIGIN = 0x40000200, LENGTH = 32513  
/*
>     free RAM area                            */
>         ram_isp_high(A)        : ORIGIN = 0x40007FE0, LENGTH = 32
>     /* variables used by Philips ISP bootloader    */
>         ram_usb_dma            : ORIGIN = 0x7FD00000, LENGTH = 8192
>     /* on-chip USB DMA RAM area (not used)      */
>     }
>
>     and
>
>     SECTIONS
>     {
>         . = 0x00004000;                                /* set location
>     counter to address zero, changed from *0x00000000* */
>         ...
>     }
>
>
> Without these modifications and with the serial bootloader the 4
lpcusb
> demo applications work ok.

You might look at sw/airborne/arm7/LPC2148-ROM-bl.ld for an example.

> When I try to bootload the demo apps with the above modifications I
get
> this:
>
>     C:\data\source code\LPCBootloaderHost\debug>LPCBootloader.exe
"C:\data
>     \lpcUSB\trunk\target\examples\hid.elf"
>     .
>     Found USB device
>     BootROM code: 2.12
>     Part ID: 0x0402FF25 (LPC2148, 512k Flash, 32k+8k RAM)
>     BootLoader version: 1.3
>     #
>     Starting software at 0x00004000
>
>     C:\data\source code\LPCBootloaderHost\debug>
>
> I cant tell if this means it successfully wrote the elf file or not?

Looks good. Do you see any serial port debug messages?

> When I plug in the USB device it windows detects it as "USB device not
> recognized" which seems to indicate the code isn't working properly.

It is a good idea to wait some hundred milliseconds before reconnecting
the 1.5k pullup when you start another USB device to give the USB host
stack the chance to detect it as new device.

Martin







reply via email to

[Prev in Thread] Current Thread [Next in Thread]