jlab-sensing / ENTS-node-firmware

Firmware for STM32 and ESP32 microcontrollers on the Soil Power Sensor board
MIT License
0 stars 3 forks source link

Battery voltage reading nonfunctional #116

Open jmadden173 opened 4 months ago

jmadden173 commented 4 months ago

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.

jmadden173 commented 1 month ago

Wait until new battery circuity is implemented, see issue in hardware repo for progress: https://github.com/jlab-sensing/ENTS-node-hardware/issues/55

After we will evaluate if this is still needed.