From af703eaea3b947c5817b40a0e445831763e9820c Mon Sep 17 00:00:00 2001 From: CarlWachter Date: Sun, 10 Dec 2023 14:59:05 +0100 Subject: [PATCH] Working CAN sending on TACOS via user space --- .DS_Store | Bin 6148 -> 6148 bytes .cproject | 26 +- .gitmodules | 7 +- .mxproject | 30 +- App/.DS_Store | Bin 0 -> 6148 bytes App/Inc/.DS_Store | Bin 0 -> 6148 bytes App/Inc/sta/config.hpp | 41 + App/Inc/tasks/can_task.hpp | 32 + App/Src/startup.cpp | 43 + App/Src/tasks/can_task.cpp | 42 + CAN-Demo.ioc | 51 +- Core/Inc/FreeRTOSConfig.h | 175 + Core/Inc/can.h | 52 + Core/Inc/gpio.h | 49 + Core/Inc/sta/config.hpp | 20 - Core/Inc/stm32f4xx_it.h | 2 - Core/Inc/usart.h | 52 + Core/Src/can.c | 125 + Core/Src/freertos.c | 143 + Core/Src/gpio.c | 89 + Core/Src/main.c | 149 +- Core/Src/stm32f4xx_hal_msp.c | 140 +- Core/Src/stm32f4xx_it.c | 36 +- Core/Src/usart.c | 113 + Debug/App/Src/subdir.mk | 7 +- Debug/App/Src/test.cyclo | 4 +- Debug/App/Src/test.d | 6 +- Debug/App/Src/test.o | Bin 1083684 -> 1084336 bytes Debug/App/Src/test.su | 4 +- Debug/Core/Src/main.cyclo | 11 +- Debug/Core/Src/main.d | 30 +- Debug/Core/Src/main.o | Bin 1077000 -> 1113708 bytes Debug/Core/Src/main.su | 11 +- Debug/Core/Src/stm32f4xx_hal_msp.cyclo | 4 - Debug/Core/Src/stm32f4xx_hal_msp.o | Bin 1073956 -> 1065708 bytes Debug/Core/Src/stm32f4xx_hal_msp.su | 4 - Debug/Core/Src/stm32f4xx_it.cyclo | 20 +- Debug/Core/Src/stm32f4xx_it.d | 20 +- Debug/Core/Src/stm32f4xx_it.o | Bin 1067468 -> 1104136 bytes Debug/Core/Src/stm32f4xx_it.su | 20 +- Debug/Core/Src/subdir.mk | 22 +- Debug/Core/Startup/startup_stm32f407zgtx.o | Bin 7264 -> 7232 bytes .../STM32F4xx_HAL_Driver/Src/subdir.mk | 10 +- Debug/Libs/sta-core/src/atomic/mutex.d | 6 +- Debug/Libs/sta-core/src/atomic/mutex.o | Bin 21984 -> 22736 bytes Debug/Libs/sta-core/src/atomic/signal.d | 6 +- Debug/Libs/sta-core/src/atomic/signal.o | Bin 21992 -> 22740 bytes Debug/Libs/sta-core/src/atomic/subdir.mk | 2 +- Debug/Libs/sta-core/src/bus/device.d | 6 +- Debug/Libs/sta-core/src/bus/device.o | Bin 54964 -> 55712 bytes Debug/Libs/sta-core/src/bus/i2c/device.d | 6 +- Debug/Libs/sta-core/src/bus/i2c/device.o | Bin 52872 -> 53624 bytes Debug/Libs/sta-core/src/bus/i2c/subdir.mk | 2 +- Debug/Libs/sta-core/src/bus/interface.d | 6 +- Debug/Libs/sta-core/src/bus/interface.o | Bin 51760 -> 52508 bytes Debug/Libs/sta-core/src/bus/spi/device.d | 6 +- Debug/Libs/sta-core/src/bus/spi/device.o | Bin 54956 -> 55704 bytes Debug/Libs/sta-core/src/bus/spi/settings.d | 6 +- Debug/Libs/sta-core/src/bus/spi/settings.o | Bin 48660 -> 49412 bytes Debug/Libs/sta-core/src/bus/spi/subdir.mk | 2 +- Debug/Libs/sta-core/src/bus/subdir.mk | 2 +- Debug/Libs/sta-core/src/bus/uart/subdir.mk | 2 +- Debug/Libs/sta-core/src/can/iter.d | 6 +- Debug/Libs/sta-core/src/can/iter.o | Bin 53616 -> 54364 bytes Debug/Libs/sta-core/src/can/subdir.mk | 2 +- Debug/Libs/sta-core/src/debug/assert.d | 8 +- Debug/Libs/sta-core/src/debug/assert.o | Bin 79284 -> 81988 bytes .../sta-core/src/debug/printing/printable.d | 6 +- .../sta-core/src/debug/printing/printable.o | Bin 103248 -> 103996 bytes .../src/debug/printing/printable_printf.d | 6 +- .../src/debug/printing/printable_printf.o | Bin 84020 -> 84772 bytes .../src/debug/printing/printable_uart.d | 6 +- .../src/debug/printing/printable_uart.o | Bin 95096 -> 95844 bytes .../sta-core/src/debug/printing/subdir.mk | 2 +- Debug/Libs/sta-core/src/debug/subdir.mk | 2 +- .../sta-core/src/devices/arduino/bus/i2c.d | 6 +- .../sta-core/src/devices/arduino/bus/i2c.o | Bin 22016 -> 22768 bytes .../src/devices/arduino/bus/subdir.mk | 2 +- .../Libs/sta-core/src/devices/arduino/delay.d | 6 +- .../Libs/sta-core/src/devices/arduino/delay.o | Bin 22012 -> 22764 bytes .../sta-core/src/devices/arduino/gpio_pin.d | 6 +- .../sta-core/src/devices/arduino/gpio_pin.o | Bin 22028 -> 22780 bytes .../sta-core/src/devices/arduino/subdir.mk | 2 +- .../Libs/sta-core/src/devices/raspi/bus/i2c.d | 6 +- .../Libs/sta-core/src/devices/raspi/bus/i2c.o | Bin 22004 -> 22756 bytes .../Libs/sta-core/src/devices/raspi/bus/spi.d | 6 +- .../Libs/sta-core/src/devices/raspi/bus/spi.o | Bin 22008 -> 22760 bytes .../sta-core/src/devices/raspi/bus/subdir.mk | 2 +- Debug/Libs/sta-core/src/devices/raspi/delay.d | 6 +- Debug/Libs/sta-core/src/devices/raspi/delay.o | Bin 22004 -> 22756 bytes .../sta-core/src/devices/raspi/gpio_pin.d | 6 +- .../sta-core/src/devices/raspi/gpio_pin.o | Bin 22020 -> 22772 bytes .../Libs/sta-core/src/devices/raspi/subdir.mk | 2 +- Debug/Libs/sta-core/src/devices/stm32/adc.d | 6 +- Debug/Libs/sta-core/src/devices/stm32/adc.o | Bin 1063684 -> 1064456 bytes .../Libs/sta-core/src/devices/stm32/bus/i2c.d | 6 +- .../Libs/sta-core/src/devices/stm32/bus/i2c.o | Bin 1100120 -> 1100896 bytes .../Libs/sta-core/src/devices/stm32/bus/spi.d | 6 +- .../Libs/sta-core/src/devices/stm32/bus/spi.o | Bin 1063788 -> 1064560 bytes .../sta-core/src/devices/stm32/bus/subdir.mk | 2 +- .../sta-core/src/devices/stm32/bus/uart.d | 6 +- .../sta-core/src/devices/stm32/bus/uart.o | Bin 1111576 -> 1112352 bytes Debug/Libs/sta-core/src/devices/stm32/can.d | 6 +- Debug/Libs/sta-core/src/devices/stm32/can.o | Bin 1101140 -> 1101916 bytes Debug/Libs/sta-core/src/devices/stm32/delay.d | 6 +- Debug/Libs/sta-core/src/devices/stm32/delay.o | Bin 1080112 -> 1080888 bytes .../sta-core/src/devices/stm32/gpio_pin.d | 6 +- .../sta-core/src/devices/stm32/gpio_pin.o | Bin 1087824 -> 1088600 bytes Debug/Libs/sta-core/src/devices/stm32/init.d | 6 +- Debug/Libs/sta-core/src/devices/stm32/init.o | Bin 45384 -> 46136 bytes .../Libs/sta-core/src/devices/stm32/subdir.mk | 2 +- .../src/devices/template/custom_printable.d | 6 +- .../src/devices/template/custom_printable.o | Bin 22076 -> 22828 bytes .../sta-core/src/devices/template/delay.d | 6 +- .../sta-core/src/devices/template/delay.o | Bin 22020 -> 22772 bytes .../sta-core/src/devices/template/subdir.mk | 2 +- Debug/Libs/sta-core/src/subdir.mk | 2 +- Debug/makefile | 9 + Debug/objects.list | 35 + Debug/sources.mk | 9 + .../Inc/stm32f4xx_hal_tim.h | 2146 +++++ .../Inc/stm32f4xx_hal_tim_ex.h | 354 + .../Src/stm32f4xx_hal_tim.c | 7621 +++++++++++++++++ .../Src/stm32f4xx_hal_tim_ex.c | 2428 ++++++ Libs/.DS_Store | Bin 6148 -> 6148 bytes Libs/rtos2-utils | 1 + .../FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os.h | 846 ++ .../FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os2.c | 2482 ++++++ .../FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os2.h | 734 ++ .../Source/CMSIS_RTOS_V2/freertos_mpool.h | 63 + .../Source/CMSIS_RTOS_V2/freertos_os2.h | 310 + .../Third_Party/FreeRTOS/Source/LICENSE | 18 + .../Third_Party/FreeRTOS/Source/croutine.c | 353 + .../FreeRTOS/Source/event_groups.c | 753 ++ .../FreeRTOS/Source/include/FreeRTOS.h | 1295 +++ .../FreeRTOS/Source/include/StackMacros.h | 133 + .../FreeRTOS/Source/include/atomic.h | 414 + .../FreeRTOS/Source/include/croutine.h | 720 ++ .../Source/include/deprecated_definitions.h | 279 + .../FreeRTOS/Source/include/event_groups.h | 757 ++ .../FreeRTOS/Source/include/list.h | 412 + .../FreeRTOS/Source/include/message_buffer.h | 803 ++ .../FreeRTOS/Source/include/mpu_prototypes.h | 160 + .../FreeRTOS/Source/include/mpu_wrappers.h | 189 + .../FreeRTOS/Source/include/portable.h | 199 + .../FreeRTOS/Source/include/projdefs.h | 124 + .../FreeRTOS/Source/include/queue.h | 1655 ++++ .../FreeRTOS/Source/include/semphr.h | 1140 +++ .../FreeRTOS/Source/include/stack_macros.h | 129 + .../FreeRTOS/Source/include/stream_buffer.h | 859 ++ .../FreeRTOS/Source/include/task.h | 2543 ++++++ .../FreeRTOS/Source/include/timers.h | 1309 +++ .../Third_Party/FreeRTOS/Source/list.c | 198 + .../Source/portable/GCC/ARM_CM4F/port.c | 775 ++ .../Source/portable/GCC/ARM_CM4F/portmacro.h | 243 + .../FreeRTOS/Source/portable/MemMang/heap_4.c | 492 ++ .../Third_Party/FreeRTOS/Source/queue.c | 2945 +++++++ .../FreeRTOS/Source/stream_buffer.c | 1263 +++ .../Third_Party/FreeRTOS/Source/tasks.c | 5310 ++++++++++++ .../Third_Party/FreeRTOS/Source/timers.c | 1127 +++ Tacos/include/sta/tacos/manager.hpp | 87 + Tacos/include/sta/tacos/startup.hpp | 31 + Tacos/include/sta/tacos/statemachine.hpp | 158 + Tacos/include/sta/tacos/thread.hpp | 90 + Tacos/src/manager.cpp | 105 + Tacos/src/startup.cpp | 91 + Tacos/src/statemachine.cpp | 107 + Tacos/src/thread.cpp | 127 + 168 files changed, 45744 insertions(+), 485 deletions(-) create mode 100644 App/.DS_Store create mode 100644 App/Inc/.DS_Store create mode 100644 App/Inc/sta/config.hpp create mode 100644 App/Inc/tasks/can_task.hpp create mode 100644 App/Src/startup.cpp create mode 100644 App/Src/tasks/can_task.cpp create mode 100644 Core/Inc/FreeRTOSConfig.h create mode 100644 Core/Inc/can.h create mode 100644 Core/Inc/gpio.h delete mode 100644 Core/Inc/sta/config.hpp create mode 100644 Core/Inc/usart.h create mode 100644 Core/Src/can.c create mode 100644 Core/Src/freertos.c create mode 100644 Core/Src/gpio.c create mode 100644 Core/Src/usart.c create mode 100644 Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim.h create mode 100644 Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_tim_ex.h create mode 100644 Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c create mode 100644 Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c create mode 160000 Libs/rtos2-utils create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os.h create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os2.c create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os2.h create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/freertos_mpool.h create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/freertos_os2.h create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/LICENSE create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/croutine.c create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/event_groups.c create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/include/FreeRTOS.h create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/include/StackMacros.h create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/include/atomic.h create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/include/croutine.h create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/include/deprecated_definitions.h create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/include/event_groups.h create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/include/list.h create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/include/message_buffer.h create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/include/mpu_prototypes.h create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/include/mpu_wrappers.h create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/include/portable.h create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/include/projdefs.h create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/include/queue.h create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/include/semphr.h create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/include/stack_macros.h create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/include/stream_buffer.h create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/include/task.h create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/include/timers.h create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/list.c create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F/port.c create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F/portmacro.h create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/portable/MemMang/heap_4.c create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/queue.c create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/stream_buffer.c create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/tasks.c create mode 100644 Middlewares/Third_Party/FreeRTOS/Source/timers.c create mode 100644 Tacos/include/sta/tacos/manager.hpp create mode 100644 Tacos/include/sta/tacos/startup.hpp create mode 100644 Tacos/include/sta/tacos/statemachine.hpp create mode 100644 Tacos/include/sta/tacos/thread.hpp create mode 100644 Tacos/src/manager.cpp create mode 100644 Tacos/src/startup.cpp create mode 100644 Tacos/src/statemachine.cpp create mode 100644 Tacos/src/thread.cpp diff --git a/.DS_Store b/.DS_Store index bd4e70961f3734476483b546225fd03eab7a5f4d..f7b5150d03c7ec6ce40e78fd69475e3d3dfcf799 100644 GIT binary patch delta 225 zcmZoMXfc=|#>B!ku~2NHo}wrl0|Nsi1A_oVaY0f}eiD$kBdK6BBhzwbZjcl+gCj!$ zL&0PT#s(2XOG6z6BV*HA9ffL3BLf`;6HBAXYZ#4%p^D0ai}G^v^U^^kPUd0k!KJ~Q zla(QaA(0`OA%C(MV-qfA#t3DbpD_k9Zf57;=Kwk!=(z99lles~1%U1bA~3-OqBlo~ HtYHQKozgD| delta 125 zcmZoMXfc=|#>B`mu~2NHo}wrd0|Nsi1A_oVQh9MfQcivnkiTPM;qu7_A}o_Xvvi6W z8Jg)R7?~Q@>L^rO8X4#)n3`Bjp1|t8`8b;c<7Nd8c9w|^CpWWm@N)nS-7LuQoq009 Vh@}9~7?8Oj<3Tjb<_M8B%mA#{9JBxc diff --git a/.cproject b/.cproject index ef84f4f..9a195ef 100644 --- a/.cproject +++ b/.cproject @@ -23,7 +23,7 @@ @@ -64,6 +69,12 @@ + + + + + +