CubeMon-Vue-Demo-STM32F407VGT6U
|
Demonstration video:
This project is a part of a larger project CubeMonitor+Vue Demo. This part contains the code for MCU created with HAL libraries, in this for STM32F407 evaluation board. In case you do not have STM32F407 evaluation board, you can port the program to any STM32 MCU as the Cube Monitor only cares about variable names/addresses.
The CubeMonitor tool enables program runtime monitoring using NodeRed. With the NodeRed 'function-block-like' programming and preconfigured elements (like LEDs for input status or dial for analog input and even a write table for variable setting) you can create simple dashboards. As long as you want only few inputs and you do not really care about setting a lot of variables manually, this is completely fine.
I did not really like the dashboard (it got pretty full and laggy after a while) and the way how it is created (I guess a lot of C/C++ programmers somehow dislike visual programing and wiring function blocks with mouse). I was also missing a simple way how to set variables using graphical elements like toggle switching.
That is why I decided to use the NodeRed ui-builder plugin to create a custom UI with all the inputs/outputs/information I want.
You will need:
Steps (option 1 - importing the project): 1) Fork and clone this repository 2) Import the project into STM IDE 3) Build and flash the board. The project setting should be imported as well but just to be sure those are the gcc
options I have used
``` -mcpu=cortex-m4 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32F407xx -c -I../Core/Inc -I../Drivers/STM32F4xx_HAL_Driver/Inc -I../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy -I../Drivers/CMSIS/Device/ST/STM32F4xx/Include -I../Drivers/CMSIS/Include -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb ```
Steps (option 2 - just flashing the board): 1) Fork and clone this repository 2) Use the Release.hex file in the /Release folder to flash the board (using for example ST-link)
There are two main parts of the program
A seamingly nonsence logic is defined, but bear with me, it demonstrates the CubeMonitors functions quite well.
The STM32F407 Discovery board user button actions changes a counter variable programData.mx_counter:
Two digital inputs are defined:
If both of them are in ON state, DO_LED_RED is on.
Two analog inputs are defined
Two analog outputs are defined
The program utilize the STM32F407 Discovery board LED