jlab-sensing / jlab-sensing/ENTS-node-firmware
Battery voltage reading nonfunctional
- Dominant language
- C
- Stars
- 4
- Forks
- 7
- Avg merge
- 5d 20h
- Merged PRs (30d)
- 5
Description
**Describe the Bug**
The battery test (`test_battery.c`) hangs.
**To Reproduce**
Steps to reproduce the behavior:
1. `pio test -e tests -f test_battery`
2. Observe that the code hangs even after trying to reset
```
...
[stm32wlx.cpu0] halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08003b8c msp: 0x20008000
** Programming Started **
Warn : Adding extra erase range, 0x08009ea0 .. 0x08009fff
** Programming Finished **
** Verify Started **
** Verified OK **
** Resetting Target **
shutdown command invoked
Testing...
If you don't see any output for the first 10 secs, please reset board (press reset button)
```
**Expected Behavior**
The test code should pass. When running the example code it appears to be reading two separate values. The code is fairly old and I believe that there is some hardware conflict between the LoRa and battery code. When trying to add `SysApp_Init` to start the clock and RTC that's used for `HAL_Delay` the code returns error. The way to read the values may have changed after playing around with the LoRa firmware.
**Screenshots**
Example output from `example_battery`. Should read a constant voltage
```
Battery Voltage: 8295 mV
Battery Voltage: 3947 mV
Battery Voltage: 2418 mV
Battery Voltage: 8298 mV
```
**Environment**
`Linux spruce 6.8.2-arch2-1 #1 SMP PREEMPT_DYNAMIC Thu, 28 Mar 2024 17:06:35 +0000 x86_64 GNU/Linux`
PlatformIO Core, version 6.1.7
Used ST-Link V3 MINIE
Done via remote development
**Additional Context**
Battery tests for remote development are currently disabled and should be enabled in the `stm32.yaml` workflow once fixed.
Contributor guide
Assessment
This issue has not been assessed yet.