Compare commits
No commits in common. "5e8bf0e765ccfbb6512eb354486ff46fca7a085b" and "af0d78237fc009a984f94c1b41011c52c0a0a86e" have entirely different histories.
5e8bf0e765
...
af0d78237f
22
README.md
22
README.md
|
@ -21,26 +21,6 @@ cargo build --release
|
||||||
|
|
||||||
The resulting ELF file will be located under `target/thumbv7em-none-eabihf/release/thermostat`
|
The resulting ELF file will be located under `target/thumbv7em-none-eabihf/release/thermostat`
|
||||||
|
|
||||||
## Debugging
|
|
||||||
|
|
||||||
Connect SWDIO/SWCLK/RST/GND to a programmer such as ST-Link v2.1. Run OpenOCD:
|
|
||||||
```shell
|
|
||||||
openocd -f interface/stlink-v2-1.cfg -f target/stm32f4x.cfg
|
|
||||||
```
|
|
||||||
|
|
||||||
You may need to power up the programmer before powering the device.
|
|
||||||
Leave OpenOCD running. Run the GNU debugger:
|
|
||||||
```shell
|
|
||||||
gdb target/thumbv7em-none-eabihf/release/thermostat
|
|
||||||
|
|
||||||
(gdb) source openocd.gdb
|
|
||||||
```
|
|
||||||
|
|
||||||
## Flashing
|
|
||||||
|
|
||||||
```shell
|
|
||||||
openocd -f interface/stlink-v2-1.cfg -f target/stm32f4x.cfg -c "program target/thumbv7em-none-eabihf/release/thermostat verify reset;exit"
|
|
||||||
```
|
|
||||||
|
|
||||||
## Network
|
## Network
|
||||||
|
|
||||||
|
@ -107,7 +87,7 @@ with logging via semihosting.)
|
||||||
|
|
||||||
**Caveat:** This logging does not flush its output. Doing so would
|
**Caveat:** This logging does not flush its output. Doing so would
|
||||||
hang indefinitely if the output is not read by the USB host. Therefore
|
hang indefinitely if the output is not read by the USB host. Therefore
|
||||||
output will be truncated when USB buffers are full.
|
output will be truncated once buffers are full.
|
||||||
|
|
||||||
|
|
||||||
## Temperature measurement
|
## Temperature measurement
|
||||||
|
|
|
@ -39,10 +39,10 @@ impl Channels {
|
||||||
adc.set_sync_enable(false).unwrap();
|
adc.set_sync_enable(false).unwrap();
|
||||||
|
|
||||||
// Setup channels and start ADC
|
// Setup channels and start ADC
|
||||||
adc.setup_channel(0, ad7172::Input::Ain2, ad7172::Input::Ain3).unwrap();
|
adc.setup_channel(0, ad7172::Input::Ain0, ad7172::Input::Ain1).unwrap();
|
||||||
let adc_calibration0 = adc.get_calibration(0)
|
let adc_calibration0 = adc.get_calibration(0)
|
||||||
.expect("adc_calibration0");
|
.expect("adc_calibration0");
|
||||||
adc.setup_channel(1, ad7172::Input::Ain0, ad7172::Input::Ain1).unwrap();
|
adc.setup_channel(1, ad7172::Input::Ain2, ad7172::Input::Ain3).unwrap();
|
||||||
let adc_calibration1 = adc.get_calibration(1)
|
let adc_calibration1 = adc.get_calibration(1)
|
||||||
.expect("adc_calibration1");
|
.expect("adc_calibration1");
|
||||||
adc.start_continuous_conversion().unwrap();
|
adc.start_continuous_conversion().unwrap();
|
||||||
|
|
Loading…
Reference in New Issue