- Switch from simulated to real ADC readings in adc_sensor library
- Add GPIO control for VND7050AJ sensor selection (sen, s0, s1 pins)
- Implement proper ADC device and channel setup for voltage/current measurements
- Enable ADC driver in prj.conf (CONFIG_ADC=y)
- Disable simulation mode (CONFIG_ADC_SENSOR_SIMULATED=n)
- Add devicetree bindings for custom supply voltage and motor current sensors
- Update overlay with adc_sensors nodes using PB4, PB5, PB6 pins
- Integrate real ADC readings into Modbus server registers
- Support HSE/HSI clock source toggling in overlay configuration
Introduces device tree bindings for custom ADC voltage and current sensors,
allowing for flexible configuration of sensor inputs and associated GPIOs.
This enables proper hardware abstraction for ADC measurements.
The example overlay file
has been removed as its content is now integrated or superseded by the new
binding definitions.
Added Doxygen-style comments to all C source and header files in the
and directories. This improves
code documentation and enables VSCode tooltip help.
Additionally, short inline comments were added to all global variables
for better clarity.
Adds a new `adc_sensor` library to abstract reading analog values from ADC channels. The output of this library is currently simulated.
This library is now used by the `modbus_server` to read the motor current and the main supply voltage, replacing the previous implementation. This change improves modularity by centralizing ADC-related code into a dedicated module.
The build system has been updated to include the new library.
Adds a commented-out clock configuration to the file. This allows switching the clock source from the external high-speed oscillator (HSE) to the internal high-speed oscillator (HSI), which can be useful if an external crystal is not present.
Also, removes the debug log level for the settings subsystem from the project configuration.
This commit introduces application versioning, exposing version information through the Modbus server and logging it at startup.
- Add to provide version information
- Update to log the application version at startup
- Update to expose firmware version via Modbus
- Add file association for in
- Initialize RST pin as active to keep VND7050AJ out of reset state
- Clarify S0/S1 pins as output select pins with descriptive comments
- Add initialization logging to show configured max open/close times
- Ensure proper valve controller startup sequence
This commit enhances the Modbus server's configuration handling by:
- Loading saved baudrate and unit ID settings during initialization, ensuring persistence across reboots.
- Providing improved feedback during `modbus_reconfigure`, including logging for successful changes and informing the user when a device restart is required for changes to take effect.
- Saving new configuration settings even if immediate reinitialization fails, allowing them to be applied on the next boot.
This commit introduces a new Modbus input register for the system's supply voltage.
- The `modbus-registers.de.md` documentation is updated to include the `SUPPLY_VOLTAGE_MV` register at address `0x00F5` within the system block.
- The `modbus_server.h` header defines the new register.
- The `modbus_server.c` implementation provides a fixed value (12300 mV) for this register.
- The `modbus_tool.py` script is updated to read and display this new supply voltage value in the UI.
This lays the groundwork for integrating actual voltage measurements in the future.
This commit implements the real valve control using the GPIOs connected to the VND7050AJ driver.
- The `weact_stm32g431_core.overlay` is updated with a specific compatible string and a device tree label for the valve controller.
- `valve.h` is extended to include GPIO device specifications.
- `valve.c` now initializes and controls the GPIOs for opening and closing the valve, including the reset logic. The IN0 and IN1 pins are interlocked to prevent simultaneous activation. The RST pin is activated before each movement and deactivated afterward.
This replaces the previous virtual/simulated valve logic with actual hardware control.
Updated the weact_stm32g431_core.overlay to define the GPIO and ADC
pin assignments for the VND7050AJ driver. This includes:
- Digital I/O pins (IN0, IN1, RST, S0, S1, SEN) configured as GPIOs.
- Analog input pin (MULTISENSE/PA0) configured for ADC1.
This commit introduces a major refactoring of the project structure to align
with Zephyr's recommended multi-application and library organization.
Key changes include:
- Relocation of custom modules from 'software/modules/' to 'software/lib/'.
- Introduction of a central 'software/CMakeLists.txt' to manage application
and library subdirectories.
- Creation of new Kconfig files for 'software/' and 'software/apps/slave_node/'
to define project-wide and application-specific configurations.
- Removal of the 'gateway' and 'stm32g431_tests' applications.
- Removal of 'shell_modbus.c' and 'shell_system.c' from 'slave_node' application's
direct source files, indicating a shift towards library-based shell commands.
- Updates to 'software/apps/slave_node/CMakeLists.txt', 'prj.conf', and
'boards/bluepill_f103rb.conf' to reflect the new structure and dependencies.
- Implemented CDC-ACM (USB Virtual COM Port) support for the slave_node application.
- Removed the now obsolete 'hello_world' and 'stm32g431_tests' applications.
- Adjusted Device Tree Overlays for bluepill_f103rb and weact_stm32g431_core
to correctly define Modbus UART via 'modbus0' subnode with 'zephyr,modbus-serial'
compatibility, aligning with rtu_server sample.
- Prepared modbus_server.c to use the correct Device Tree node for Modbus UART.
Refactor slave_node application to support building for both bluepill_f103rb and
weact_stm32g431_core boards.
- Moved RTT-specific console and shell backend configurations from prj.conf
into board-specific .conf files (bluepill_f103rb.conf).
- Configured USART2 as console/shell for weact_stm32g431_core.
- Added Device Tree Overlay for weact_stm32g431_core to enable USART1 for Modbus
communication (PA9/PA10).
Add comprehensive Doxygen-style comments to all functions, enums, and macros in `main.c`. This improves code clarity and maintainability. The Doxygen configuration itself was removed after deciding against generating a separate HTML manual, but the in-code comments provide significant value on their own.
- Add Doxygen-compliant comments to functions, enums, and state variables in `main.c`.
- This provides a foundation for automatically generating source code documentation.
- Remove the separate, now redundant, `firmware-manual.de.md` file.
- Create a new firmware manual (`firmware-manual.de.md`) to document the current features of the slave node.
- Add a linked table of contents to the new manual.
- Update the main `README.de.md` to link to the new firmware manual and the existing Modbus tool README.
- Add a fail-safe watchdog using a Zephyr kernel timer.
- The timer is reset on any successful Modbus communication.
- If the timer expires (no communication within the configured timeout), the valve is automatically closed as a safety measure.
- The watchdog is enabled by writing a non-zero value to the `WATCHDOG_TIMEOUT_S` register and disabled by writing 0.
- Implement a simple, curses-based file browser to allow selecting firmware files from the filesystem.
- The selected file path is used for the firmware update process.
- Fix a visual bug where the progress bar would not reach 100% upon completion.
- Remove a leftover function that was causing a NameError.
- Add a new thread to handle the firmware update process, preventing the UI from freezing.
- The UI now displays a progress bar and status messages during the update.
- The tool reads a file and sends it to the slave in chunks.
- Add a dummy for testing purposes.
- Fix Modbus communication issues by reducing the chunk size to a safe value (248 bytes) and sending data in smaller bursts to improve stability.
- Update the README with the new features and instructions.
- Update the TUI to display all new registers from the slave, including digital I/O and system status.
- Add new menu buttons to control digital outputs and set the watchdog timer.
- Add a placeholder button for the firmware update process.
- Fix various bugs, including incorrect argument passing in Modbus calls and a module import error.
- Implement all remaining Modbus registers as defined in the documentation v1.0.
- Add support for digital I/O, system status, and a simulated watchdog.
- Implement a placeholder for the firmware update mechanism, including CRC calculation for received data chunks.
- Remove the input simulation timer; digital inputs are now static and ready for real hardware.
- Refactor the curses drawing loop to be state-based, eliminating screen flicker after user input.
- Add a helper function to format uptime from seconds into a human-readable string (d/h/m/s).
- Replace the basic command-line prompt with a full-screen, interactive TUI using the library.
- The new UI provides a real-time, tabular status display and intuitive, button-style menu navigation.
- Implement a consistent blue background theme for better aesthetics.
- Add a detailed with installation and usage instructions.
- Fix several bugs in the Modbus communication logic.