Updated Debug Serial (markdown)

Candas1
2022-04-21 10:16:03 +02:00
parent c14d2ac98f
commit 039ee41419

@@ -9,16 +9,16 @@ Use a [FTDI adapter](https://s.click.aliexpress.com/e/_AqPOBr) or a [Bluetooth m
[HC-06](https://www.aliexpress.com/af/HC-06.html) works, connected to USART2 at 9600 bauds (define DEBUG_SERIAL_USART2 and USART2_BAUD=9600). [HC-06](https://www.aliexpress.com/af/HC-06.html) works, connected to USART2 at 9600 bauds (define DEBUG_SERIAL_USART2 and USART2_BAUD=9600).
## Configuration: ## :gear: Configuration:
Use DEBUG_SERIAL_USART2 for the left cable or DEBUG_SERIAL_USART3 for the right cable.<br> Use DEBUG_SERIAL_USART2 for the left cable or DEBUG_SERIAL_USART3 for the right cable.<br>
Different variants can have it already enabled on a different cable depending on which cable is use by this variant by default. Different variants can have it already enabled on a different cable depending on which cable is use by this variant by default.
## Wiring: ## :electric_plug: Wiring:
* Connect GND and RX of a 3.3v FTDI adapter/Bluetooth module to the blue wire on left (DEBUG_SERIAL_USART2) or right sensor board cable (DEBUG_SERIAL_USART3) depending on config.h settings * Connect GND and RX of a 3.3v FTDI adapter/Bluetooth module to the blue wire on left (DEBUG_SERIAL_USART2) or right sensor board cable (DEBUG_SERIAL_USART3) depending on config.h settings
⚠ Red wire from sensor cable delivers 15v !!! ⚠ Red wire from sensor cable delivers 15v !!!
## Output: ## :desktop_computer: Output:
Use a serial terminal/monitor to read the output at 115200 bauds (could be 38400 bauds if you use a previous version of the firmware).<br /> Use a serial terminal/monitor to read the output at 115200 bauds (could be 38400 bauds if you use a previous version of the firmware).<br />
DEBUG_SERIAL_ASCII output is: DEBUG_SERIAL_ASCII output is:
@@ -37,7 +37,7 @@ DEBUG_SERIAL_ASCII output is:
The above is done in `main.c`, see [lines 440](https://github.com/EFeru/hoverboard-firmware-hack-FOC/blob/cf7b1d0de1da34612b056c316480f47702a15cbe/Src/main.c#L440) and [line 225](https://github.com/EFeru/hoverboard-firmware-hack-FOC/blob/cf7b1d0de1da34612b056c316480f47702a15cbe/Src/main.c#L225) by using printf statements, wrapped in ```#if defined(DEBUG_SERIAL_USART2) || defined(DEBUG_SERIAL_USART3)```. More printf statements with same wrapping can be added in other places for monitoring purposes. The above is done in `main.c`, see [lines 440](https://github.com/EFeru/hoverboard-firmware-hack-FOC/blob/cf7b1d0de1da34612b056c316480f47702a15cbe/Src/main.c#L440) and [line 225](https://github.com/EFeru/hoverboard-firmware-hack-FOC/blob/cf7b1d0de1da34612b056c316480f47702a15cbe/Src/main.c#L225) by using printf statements, wrapped in ```#if defined(DEBUG_SERIAL_USART2) || defined(DEBUG_SERIAL_USART3)```. More printf statements with same wrapping can be added in other places for monitoring purposes.
## Debug Protocol: ## :keyboard: Debug Protocol:
If enabled with parameter DEBUG_SERIAL_PROTOCOL in [config.h](https://github.com/EmanuelFeru/hoverboard-firmware-hack-FOC/blob/master/Inc/config.h), in combination with DEBUG_SERIAL_USART2 or DEBUG_SERIAL_USART3 for selecting the right cable, debug protocol lets you send Ascii commands.<br> If enabled with parameter DEBUG_SERIAL_PROTOCOL in [config.h](https://github.com/EmanuelFeru/hoverboard-firmware-hack-FOC/blob/master/Inc/config.h), in combination with DEBUG_SERIAL_USART2 or DEBUG_SERIAL_USART3 for selecting the right cable, debug protocol lets you send Ascii commands.<br>
### Commands ### Commands
@@ -93,7 +93,7 @@ Values are being translated to external<>internal format automatically.
|Variable|BATV|Calibrated Battery Voltage *100|No|No| |Variable|BATV|Calibrated Battery Voltage *100|No|No|
|Variable|TEMP|Calibrated Temperature °C *10|No|No| |Variable|TEMP|Calibrated Temperature °C *10|No|No|
## Troubleshooting: ## :toolbox: Troubleshooting:
* Make sure the baud rate is 115200 * Make sure the baud rate is 115200
* Make sure you are using the sensor cable(left=DEBUG_SERIAL_USART2 or right=DEBUG_SERIAL_USART3) selected in config.h * Make sure you are using the sensor cable(left=DEBUG_SERIAL_USART2 or right=DEBUG_SERIAL_USART3) selected in config.h
* TX can be defective on your mainboard, you can switch to other sensor cable if not used already in config.h * TX can be defective on your mainboard, you can switch to other sensor cable if not used already in config.h