jlab-sensing / soil-power-sensor-firmware

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

Implement TX buffer for LoRaWAN #66

Closed jmadden173 closed 2 months ago

jmadden173 commented 2 months ago

Name/Affiliation/Title N/A, maintainer

Purpose of the PR This PR integrates a transmit buffer using the fram chip using a circular buffer that doesn't allow for overwriting of data. It also modifies the fram implementation to allow for more intuitive use of the address space. The available space can be modified with the FRAM_BUFFER_START and FRAM_BUFFER_END defines. I made it up to the user to allocate space for their libraries.

Development Environment Linux redwood 6.6.22-1-lts #1 SMP PREEMPT_DYNAMIC Sat, 16 Mar 2024 06:20:33 +0000 x86_64 GNU/Linux Debugger: ST-Link V3 PlatformIO Core, version 6.1.13

Pkg List

********************************************************************************
Obsolete PIO Core v6.1.13 is used (previous was 6.1.14)
Please remove multiple PIO Cores from a system:
https://docs.platformio.org/en/latest/core/installation/troubleshooting.html
********************************************************************************
Resolving stm32 dependencies...
Platform ststm32 @ 17.0.0+sha.7136ebc (required: git+https://github.com/jlab-sensing/platform-ststm32)
├── framework-stm32cubewl @ 1.26.2+sha.77fa61b (required: git+https://github.com/jlab-sensing/STM32CubeWL)
├── tool-dfuutil @ 1.11.0 (required: platformio/tool-dfuutil @ ~1.11.0)
├── tool-dfuutil-arduino @ 1.11.0 (required: platformio/tool-dfuutil-arduino @ ~1.11.0)
├── tool-ldscripts-ststm32 @ 0.2.0 (required: platformio/tool-ldscripts-ststm32 @ ~0.2.0)
├── tool-openocd @ 1.0.0+sha.0ecdfeb (required: git+https://github.com/jlab-sensing/tool-openocd.git)
├── tool-stm32duino @ 1.0.1 (required: platformio/tool-stm32duino @ ~1.0.1)
└── toolchain-gccarmnoneeabi @ 1.70201.0 (required: platformio/toolchain-gccarmnoneeabi @ >=1.60301.0,<1.80000.0)

Libraries
└── Soil Power Sensor Protocal Buffer @ 2.0.0 (required: symlink://../proto/c)

Resolving example_battery dependencies...
Platform ststm32 @ 17.0.0+sha.7136ebc (required: git+https://github.com/jlab-sensing/platform-ststm32)
├── framework-stm32cubewl @ 1.26.2+sha.77fa61b (required: git+https://github.com/jlab-sensing/STM32CubeWL)
├── tool-dfuutil @ 1.11.0 (required: platformio/tool-dfuutil @ ~1.11.0)
├── tool-dfuutil-arduino @ 1.11.0 (required: platformio/tool-dfuutil-arduino @ ~1.11.0)
├── tool-ldscripts-ststm32 @ 0.2.0 (required: platformio/tool-ldscripts-ststm32 @ ~0.2.0)
├── tool-openocd @ 1.0.0+sha.0ecdfeb (required: git+https://github.com/jlab-sensing/tool-openocd.git)
├── tool-stm32duino @ 1.0.1 (required: platformio/tool-stm32duino @ ~1.0.1)
└── toolchain-gccarmnoneeabi @ 1.70201.0 (required: platformio/toolchain-gccarmnoneeabi @ >=1.60301.0,<1.80000.0)

Libraries
└── Soil Power Sensor Protocal Buffer @ 2.0.0 (required: symlink://../proto/c)

Resolving example_adc dependencies...
Platform ststm32 @ 17.0.0+sha.7136ebc (required: git+https://github.com/jlab-sensing/platform-ststm32)
├── framework-stm32cubewl @ 1.26.2+sha.77fa61b (required: git+https://github.com/jlab-sensing/STM32CubeWL)
├── tool-dfuutil @ 1.11.0 (required: platformio/tool-dfuutil @ ~1.11.0)
├── tool-dfuutil-arduino @ 1.11.0 (required: platformio/tool-dfuutil-arduino @ ~1.11.0)
├── tool-ldscripts-ststm32 @ 0.2.0 (required: platformio/tool-ldscripts-ststm32 @ ~0.2.0)
├── tool-openocd @ 1.0.0+sha.0ecdfeb (required: git+https://github.com/jlab-sensing/tool-openocd.git)
├── tool-stm32duino @ 1.0.1 (required: platformio/tool-stm32duino @ ~1.0.1)
└── toolchain-gccarmnoneeabi @ 1.70201.0 (required: platformio/toolchain-gccarmnoneeabi @ >=1.60301.0,<1.80000.0)

Resolving tests dependencies...
Platform ststm32 @ 17.0.0+sha.7136ebc (required: git+https://github.com/jlab-sensing/platform-ststm32)
├── framework-stm32cubewl @ 1.26.2+sha.77fa61b (required: git+https://github.com/jlab-sensing/STM32CubeWL)
├── tool-dfuutil @ 1.11.0 (required: platformio/tool-dfuutil @ ~1.11.0)
├── tool-dfuutil-arduino @ 1.11.0 (required: platformio/tool-dfuutil-arduino @ ~1.11.0)
├── tool-ldscripts-ststm32 @ 0.2.0 (required: platformio/tool-ldscripts-ststm32 @ ~0.2.0)
├── tool-openocd @ 1.0.0+sha.0ecdfeb (required: git+https://github.com/jlab-sensing/tool-openocd.git)
├── tool-stm32duino @ 1.0.1 (required: platformio/tool-stm32duino @ ~1.0.1)
└── toolchain-gccarmnoneeabi @ 1.70201.0 (required: platformio/toolchain-gccarmnoneeabi @ >=1.60301.0,<1.80000.0)

Libraries
└── Soil Power Sensor Protocal Buffer @ 2.0.0 (required: symlink://../proto/c)

Test Procedure

Additional Context I am able to decode the measurements with the library, but there is an issue when enabling the webhook on TTN when uploading to Dirtviz. I am planning on addressing this when I write the protobuf implementation for the leaf wetness sensor where I have to modify Dirtviz anyways.

Closes #41