Commits (3)
LPC1768 USB Bootloader
# Using the bootloader
For more information on installing and using the compiled bootloader, see [USAGE file](USAGE.md).
# Technical informations
This repository contains a USB bootloader compatible with the LPC17xx
microcontroller. The lineage of this bootloader:
......@@ -22,7 +28,7 @@ microcontroller. The lineage of this bootloader:
the specific workarounds).
* Small rewrite to make it compatible with mbed framework.
## Installing the Bootloader
## Installing the bootloader
$ script/bootstrap.sh
$ cd src
......@@ -41,7 +47,7 @@ If you are using an buspirate serial programmer, use the following command:
$ make PORT=COMx flash-nxp
## Building User Firmware
## Building user firmware
See the simple program in the `example` directory for an example of how to build
a program for the bootloader.
......@@ -65,7 +71,7 @@ interrupt vectors at startup:
This workaround doesn't have any negative effects if you use the same code
running on bare metal.
## Flashing User Code
## Flashing user code
Note that the `firmware.bin` file will always look the same (with an old
modification date and the same `firmware.bin` filename), even if you reflash and
......@@ -122,7 +128,7 @@ Mounting the USB disk drive, deleting firmware.bin and copying over the new file
works fine now (after some bug fixes in the [original version of this
## License
# License
The LPCUSB library is made available under the BSD license. It is linked to from
this project as a Git submodule.
EXM bootloader
This page describe how to use the released binary of the bootloader.
For more technical information on how to build the bootloader, refer to the
[README file](README.md)
The bootloader allows the end-user to update the main firmware without any tool.
For the current version of boards, minor modifications needs to be done in order
to enable this functionality.
# Flashing the bootloader onto the board
**Warning**: Not all boards support the bootloader, please check that the board is
listed on the compatible devices table:
| Board name | Revision | Instructions |
| :--------- | :------: | :------------------------------------------ |
| UMCB | Rev A3 | See [UMCB instructions](#umcb-rev-a3) |
| HSRV-ECS | Rev C1 | See [HSRV instructions](#hsrv-rev-c1) |
## Requirements
`nxp-flasher` is needed to upload the bootloader onto the board. For details on how to install `nxp-flasher`, go to the [NXP-flasher repository](https://gitlab.exmachina.fr/fw-tools/nxp-flasher).
## Flashing the bootloader
Connect the board to the BusPirate using the ICSP ribbon cable then power up the board.
Open a command shell inside the bootloader directory and run:
python3 PATH_TO_NXPPROG\\nxpprog.py -p buspirate --baud 115200 --control --cpu=lpc1768 --oscfreq=120000 COM_PORT .\\bootloader.bin
If have multiple versions of Python installed, you can select the correct version using:
py -3.7 PATH_TO_NXPPROG\\nxpprog.py -p buspirate --baud 115200 --control --cpu=lpc1768 --oscfreq=120000 COM_PORT .\\bootloader.bin
`-3.7` being the Python version you want to run
# Upload new firmware
**Warning**: In order to be able to use the bootloader, you need to make some modifications on the board first.
For more details, refer to the [relevant section](#board-instructions).
1. Connect an USB type B cable to the USB port on the board
2. Power on the board
3. To enter bootloader mode, simply hold `RESET` and `BOOT` onboard buttons
4. Release the `RESET` button
5. Release the `BOOT` button
6. A new mass storage device named `EXM DFU FW` will show up
7. Delete the firmware.bin file present on this
8. Copy the new firmware onto the mass storage device.
**Warning**: Be extremely careful to select the correct firwmare for the board.
Flashing a wrong firmware onto the board might lead to machine and/or board destruction
9. Press on `Eject` or unmount the device.
This ensure Data is correctly written onto the board
10. Press the `RESET` button. The new firmware will be launched automatically
# Board instructions
Some board needs hardware configuration before the bootloader can be used.
## UMCB - Rev A3
Unsolder the resistor marked as `P2_10` (`R14` on the schematics)
![UMCB modifications](res/UMCB - Board modifications.png)
## HSRV - Rev C1
Unsolder the resistor marked as `P2_10` (`R38` on the schematics)
![HSRV modifications](res/HSRV - Board modifications.png)