README: cleanup build and flashing instructions

This commit is contained in:
Sebastien Bourdeauducq 2020-12-09 10:16:40 +08:00
parent 35d1e2e205
commit 088bd6eb76
1 changed files with 12 additions and 10 deletions

View File

@ -1,11 +1,15 @@
# Firmware for the Sinara 8451 Thermostat # Firmware for the Sinara 8451 Thermostat
- [x] [Continuous Integration](https://nixbld.m-labs.hk/job/stm32/stm32/thermostat) - [x] [Continuous Integration](https://nixbld.m-labs.hk/job/stm32/stm32/thermostat)
- [x] [Download latest firmware build](https://nixbld.m-labs.hk/job/stm32/stm32/thermostat/latest/download-by-type/file/binary-dist) - [x] Download latest firmware build: [ELF](https://nixbld.m-labs.hk/job/stm32/stm32/thermostat/latest/download/1) [BIN](https://nixbld.m-labs.hk/job/stm32/stm32/thermostat/latest/download/2)
## Building ## Building
### Reproducible build with Nix
See the `stm32` folder of the [nix-scripts repository](https://git.m-labs.hk/M-Labs/nix-scripts).
### Debian-based systems (tested on Ubuntu 19.10) ### Debian-based systems (tested on Ubuntu 19.10)
- install git, clone this repository - install git, clone this repository
@ -37,22 +41,20 @@ gdb target/thumbv7em-none-eabihf/release/thermostat
``` ```
## Flashing ## Flashing
There are several options for performing device firmware upgrade (DFU) on Thermostat. The firmware is an .ELF file. There are several options for flashing Thermostat. DFU requires only a micro-USB connector, whereas OpenOCD needs a JTAG/SWD adapter.
### dfu-util ### dfu-util on Linux
This can be done from Linux machine using only micro-USB connector.
([Issue #10](https://git.m-labs.hk/M-Labs/thermostat/issues/10))
* Install the DFU USB tool (dfu-util). * Install the DFU USB tool (dfu-util).
* Convert firmware from ELF to BIN: ```arm-none-eabi-objcopy -O binary thermostat.elf thermostat.bin``` * Convert firmware from ELF to BIN: `arm-none-eabi-objcopy -O binary thermostat.elf thermostat.bin` (you can skip this step if using the BIN from Hydra)
* Connect to the Micro USB connector to Thermostat below the RJ45. * Connect to the Micro USB connector to Thermostat below the RJ45.
* Add jumper to Thermostat v2.0 across 2-pin jumper adjacent to JTAG connector. * Add jumper to Thermostat v2.0 across 2-pin jumper adjacent to JTAG connector.
* Cycle board power to put it in DFU update mode * Cycle board power to put it in DFU update mode
* Push firmware to flash: ```dfu-util -a 0 -s 0x08000000:leave -D thermostat.bin``` * Push firmware to flash: `dfu-util -a 0 -s 0x08000000:leave -D thermostat.bin`
* Remove jumper * Remove jumper
* Cycle power to leave DFU update mode * Cycle power to leave DFU update mode
### st.com DfuSe tool ### st.com DfuSe tool on Windows
On a Windows machine install [st.com](https://st.com) DfuSe USB device firmware upgrade (DFU) software. [link](https://www.st.com/en/development-tools/stsw-stm32080.html). On a Windows machine install [st.com](https://st.com) DfuSe USB device firmware upgrade (DFU) software. [link](https://www.st.com/en/development-tools/stsw-stm32080.html).
- add jumper to Thermostat v2.0 across 2-pin jumper adjacent to JTAG connector - add jumper to Thermostat v2.0 across 2-pin jumper adjacent to JTAG connector
- cycle board power to put it in DFU update mode - cycle board power to put it in DFU update mode
- connect micro-USB to PC - connect micro-USB to PC
@ -60,7 +62,7 @@ On a Windows machine install [st.com](https://st.com) DfuSe USB device firmware
- remove jumper - remove jumper
- cycle power to leave DFU update mode - cycle power to leave DFU update mode
### openocd ### OpenOCD
```shell ```shell
openocd -f interface/stlink-v2-1.cfg -f target/stm32f4x.cfg -c "program target/thumbv7em-none-eabihf/release/thermostat verify reset;exit" openocd -f interface/stlink-v2-1.cfg -f target/stm32f4x.cfg -c "program target/thumbv7em-none-eabihf/release/thermostat verify reset;exit"
``` ```