From cf3c6366c51076871c2781bc1cc7f62280c3a7b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C5=82a=C5=BCej=20Sowa?= Date: Mon, 25 Jul 2022 15:27:45 +0200 Subject: [PATCH 01/23] Add stm32cube framework --- library.json | 2 +- platform_code/stm32cube/clock_gettime.cpp | 34 +++++++++++++++++++ .../stm32cube/custom/micro_ros_transport.h | 0 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 platform_code/stm32cube/clock_gettime.cpp create mode 100644 platform_code/stm32cube/custom/micro_ros_transport.h diff --git a/library.json b/library.json index 2ca60302..53775d16 100755 --- a/library.json +++ b/library.json @@ -25,6 +25,6 @@ "extraScript": "./extra_script.py" }, - "frameworks": "arduino", + "frameworks": "arduino, stm32cube", "platforms": "teensy, https://github.com/platformio/platform-espressif32.git#feature/arduino-upstream, atmelsam, raspberrypi, ststm32" } \ No newline at end of file diff --git a/platform_code/stm32cube/clock_gettime.cpp b/platform_code/stm32cube/clock_gettime.cpp new file mode 100644 index 00000000..64b39fdb --- /dev/null +++ b/platform_code/stm32cube/clock_gettime.cpp @@ -0,0 +1,34 @@ +#include + +#if defined(STM32F0xx) +#include "stm32f0xx_hal.h" +#elif defined(STM32F1xx) +#include "stm32f1xx_hal.h" +#elif defined(STM32F2xx) +#include "stm32f2xx_hal.h" +#elif defined(STM32F3xx) +#include "stm32f3xx_hal.h" +#elif defined(STM32F4xx) +#include "stm32f4xx_hal.h" +#elif defined(STM32F7xx) +#include "stm32f7xx_hal.h" +#endif + +constexpr uint64_t GETTICK_ROLLOVER_USECONDS = 4294967296000UL; + +extern "C" int clock_gettime(clockid_t unused, struct timespec *tp) { + (void)unused; + static uint32_t rollover = 0; + static uint32_t last_measure = 0; + + uint32_t m = HAL_GetTick(); + rollover += (m < last_measure) ? 1 : 0; + + uint64_t real_us = + (uint64_t)(m * 1000 + rollover * GETTICK_ROLLOVER_USECONDS); + tp->tv_sec = real_us / 1000000; + tp->tv_nsec = (real_us % 1000000) * 1000; + last_measure = m; + + return 0; +} \ No newline at end of file diff --git a/platform_code/stm32cube/custom/micro_ros_transport.h b/platform_code/stm32cube/custom/micro_ros_transport.h new file mode 100644 index 00000000..e69de29b From a1bb2d7545a12cd4767b84eba4bb419098b88696 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C5=82a=C5=BCej=20Sowa?= Date: Tue, 26 Jul 2022 14:13:28 +0200 Subject: [PATCH 02/23] Add stm32cube serial transport --- .../stm32cube/serial/micro_ros_transport.cpp | 107 ++++++++++++++++++ .../stm32cube/serial/micro_ros_transport.h | 31 +++++ 2 files changed, 138 insertions(+) create mode 100644 platform_code/stm32cube/serial/micro_ros_transport.cpp create mode 100644 platform_code/stm32cube/serial/micro_ros_transport.h diff --git a/platform_code/stm32cube/serial/micro_ros_transport.cpp b/platform_code/stm32cube/serial/micro_ros_transport.cpp new file mode 100644 index 00000000..503ab2c0 --- /dev/null +++ b/platform_code/stm32cube/serial/micro_ros_transport.cpp @@ -0,0 +1,107 @@ +#include + +static uint16_t rhead, rtail; +static volatile uint16_t thead, thead_next, ttail; +static uint32_t open_count = 0; + +static void stream_flush(DMAStream *stream) { + static volatile bool mutex = false; + + if ((stream->uart->gState == HAL_UART_STATE_READY) && !mutex) { + mutex = true; + + if (thead != ttail) { + uint16_t len = + thead < ttail ? ttail - thead : stream->tbuffer_size - thead; + thead_next = (thead + len) & (stream->tbuffer_size - 1); + HAL_UART_Transmit_DMA(stream->uart, stream->tbuffer + thead, len); + } + mutex = false; + } +} + +void uart_transfer_complete_callback(DMAStream *stream) { + thead = thead_next; + stream_flush(stream); +} + +extern "C" { + +bool platformio_transport_open(struct uxrCustomTransport *transport) { + DMAStream *stream = (DMAStream *)transport->args; + + if (open_count == 0) { + rhead = rtail = thead = thead_next = ttail = 0; + HAL_UART_Receive_DMA(stream->uart, stream->rbuffer, stream->rbuffer_size); + } + open_count++; + + return true; +} + +bool platformio_transport_close(struct uxrCustomTransport *transport) { + DMAStream *stream = (DMAStream *)transport->args; + + open_count--; + if (open_count == 0) { + HAL_UART_DMAStop(stream->uart); + } + + return true; +} + +size_t platformio_transport_write(struct uxrCustomTransport *transport, + const uint8_t *buf, size_t len, + uint8_t *errcode) { + DMAStream *stream = (DMAStream *)transport->args; + + uint16_t n = len; + uint16_t buffer_available = + thead <= ttail ? stream->tbuffer_size - ttail + thead : thead - ttail; + if (n > buffer_available) n = buffer_available; + + uint16_t n_tail = + n <= stream->tbuffer_size - ttail ? n : stream->tbuffer_size - ttail; + + memcpy(stream->tbuffer + ttail, buf, n_tail); + + if (n != n_tail) { + memcpy(stream->tbuffer, buf + n_tail, n - n_tail); + } + + ttail = (ttail + n) & (stream->tbuffer_size - 1); + + stream_flush(stream); + + return n; +} + +size_t platformio_transport_read(struct uxrCustomTransport *transport, + uint8_t *buf, size_t len, int timeout, + uint8_t *errcode) { + DMAStream *stream = (DMAStream *)transport->args; + + int ms_used = 0; + do { + __disable_irq(); + rtail = stream->rbuffer_size - __HAL_DMA_GET_COUNTER(stream->uart->hdmarx); + __enable_irq(); + + uint16_t data_available = + rhead <= rtail ? rtail - rhead : stream->rbuffer_size - rhead + rtail; + + if (data_available >= len) break; + + HAL_Delay(1); + ms_used++; + } while (ms_used < timeout); + + size_t wrote = 0; + while ((rhead != rtail) && (wrote < len)) { + buf[wrote++] = stream->rbuffer[rhead]; + rhead = (rhead + 1) & (stream->rbuffer_size - 1); + } + + return wrote; +} +} \ No newline at end of file diff --git a/platform_code/stm32cube/serial/micro_ros_transport.h b/platform_code/stm32cube/serial/micro_ros_transport.h new file mode 100644 index 00000000..84e6e9bc --- /dev/null +++ b/platform_code/stm32cube/serial/micro_ros_transport.h @@ -0,0 +1,31 @@ +#include + +#if defined(STM32F0xx) +#include "stm32f0xx_hal.h" +#elif defined(STM32F1xx) +#include "stm32f1xx_hal.h" +#elif defined(STM32F2xx) +#include "stm32f2xx_hal.h" +#elif defined(STM32F3xx) +#include "stm32f3xx_hal.h" +#elif defined(STM32F4xx) +#include "stm32f4xx_hal.h" +#elif defined(STM32F7xx) +#include "stm32f7xx_hal.h" +#endif + +struct DMAStream { + UART_HandleTypeDef* uart; + uint16_t rbuffer_size; + uint8_t* rbuffer; + uint16_t tbuffer_size; + uint8_t* tbuffer; +}; + +static inline void set_microros_serial_transports(DMAStream& stream) { + rmw_uros_set_custom_transport( + true, &stream, platformio_transport_open, platformio_transport_close, + platformio_transport_write, platformio_transport_read); +} + +void uart_transfer_complete_callback(DMAStream* stream); From a27c890472b529124c4ce992b3f6aedddef5ccc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C5=82a=C5=BCej=20Sowa?= Date: Tue, 26 Jul 2022 14:47:44 +0200 Subject: [PATCH 03/23] Allow nonblocking read --- platform_code/stm32cube/serial/micro_ros_transport.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platform_code/stm32cube/serial/micro_ros_transport.cpp b/platform_code/stm32cube/serial/micro_ros_transport.cpp index 503ab2c0..2e581e4d 100644 --- a/platform_code/stm32cube/serial/micro_ros_transport.cpp +++ b/platform_code/stm32cube/serial/micro_ros_transport.cpp @@ -82,7 +82,7 @@ size_t platformio_transport_read(struct uxrCustomTransport *transport, DMAStream *stream = (DMAStream *)transport->args; int ms_used = 0; - do { + while (true) { __disable_irq(); rtail = stream->rbuffer_size - __HAL_DMA_GET_COUNTER(stream->uart->hdmarx); __enable_irq(); @@ -90,11 +90,11 @@ size_t platformio_transport_read(struct uxrCustomTransport *transport, uint16_t data_available = rhead <= rtail ? rtail - rhead : stream->rbuffer_size - rhead + rtail; - if (data_available >= len) break; + if (data_available >= len || ms_used >= timeout) break; HAL_Delay(1); ms_used++; - } while (ms_used < timeout); + } size_t wrote = 0; while ((rhead != rtail) && (wrote < len)) { From f33a16e5f7bf8343793e920534dd7f21591f7faf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C5=82a=C5=BCej=20Sowa?= Date: Tue, 26 Jul 2022 15:20:07 +0200 Subject: [PATCH 04/23] Add some comments --- platform_code/stm32cube/serial/micro_ros_transport.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/platform_code/stm32cube/serial/micro_ros_transport.h b/platform_code/stm32cube/serial/micro_ros_transport.h index 84e6e9bc..64ac88b8 100644 --- a/platform_code/stm32cube/serial/micro_ros_transport.h +++ b/platform_code/stm32cube/serial/micro_ros_transport.h @@ -15,10 +15,19 @@ #endif struct DMAStream { + /// UART handle to use for transport. UART_HandleTypeDef* uart; + + /// Size of the read buffer, must be a power of 2. uint16_t rbuffer_size; + + /// Pointer to read buffer. uint8_t* rbuffer; + + /// Size of the transmit buffer, must be a power of 2. uint16_t tbuffer_size; + + /// Pointer to transmit buffer. uint8_t* tbuffer; }; @@ -28,4 +37,6 @@ static inline void set_microros_serial_transports(DMAStream& stream) { platformio_transport_write, platformio_transport_read); } +/// This function should be called from HAL_UART_TxCpltCallback. Otherwise the +/// transform won't work properly. void uart_transfer_complete_callback(DMAStream* stream); From 35fbb64cd89e839be6ece0edefdc3e07a79c206b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C5=82a=C5=BCej=20Sowa?= Date: Tue, 26 Jul 2022 15:30:04 +0200 Subject: [PATCH 05/23] Don't wait until len bytes of data is available to read --- platform_code/stm32cube/serial/micro_ros_transport.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/platform_code/stm32cube/serial/micro_ros_transport.cpp b/platform_code/stm32cube/serial/micro_ros_transport.cpp index 2e581e4d..56696290 100644 --- a/platform_code/stm32cube/serial/micro_ros_transport.cpp +++ b/platform_code/stm32cube/serial/micro_ros_transport.cpp @@ -87,10 +87,7 @@ size_t platformio_transport_read(struct uxrCustomTransport *transport, rtail = stream->rbuffer_size - __HAL_DMA_GET_COUNTER(stream->uart->hdmarx); __enable_irq(); - uint16_t data_available = - rhead <= rtail ? rtail - rhead : stream->rbuffer_size - rhead + rtail; - - if (data_available >= len || ms_used >= timeout) break; + if (rhead != rtail || ms_used >= timeout) break; HAL_Delay(1); ms_used++; From 09be1ecaacb0cc8665a5b1d834bec6bb794ec4f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C5=82a=C5=BCej=20Sowa?= Date: Wed, 3 Aug 2022 18:04:27 +0200 Subject: [PATCH 06/23] Move arduino CI package into subdirectory --- ci/{ => arduino}/.gitignore | 0 ci/{ => arduino}/custom.meta | 0 .../extra_packages/extra_packages.repos | 0 .../my_custom_message/CMakeLists.txt | 0 .../my_custom_message/msg/MyCustomMessage.msg | 0 .../my_custom_message/package.xml | 0 ci/{ => arduino}/platformio.ini | 40 +++++++++---------- ci/{ => arduino}/src/main.cpp | 0 8 files changed, 20 insertions(+), 20 deletions(-) rename ci/{ => arduino}/.gitignore (100%) rename ci/{ => arduino}/custom.meta (100%) rename ci/{ => arduino}/extra_packages/extra_packages.repos (100%) rename ci/{ => arduino}/extra_packages/my_custom_message/CMakeLists.txt (100%) rename ci/{ => arduino}/extra_packages/my_custom_message/msg/MyCustomMessage.msg (100%) rename ci/{ => arduino}/extra_packages/my_custom_message/package.xml (100%) rename ci/{ => arduino}/platformio.ini (92%) rename ci/{ => arduino}/src/main.cpp (100%) diff --git a/ci/.gitignore b/ci/arduino/.gitignore similarity index 100% rename from ci/.gitignore rename to ci/arduino/.gitignore diff --git a/ci/custom.meta b/ci/arduino/custom.meta similarity index 100% rename from ci/custom.meta rename to ci/arduino/custom.meta diff --git a/ci/extra_packages/extra_packages.repos b/ci/arduino/extra_packages/extra_packages.repos similarity index 100% rename from ci/extra_packages/extra_packages.repos rename to ci/arduino/extra_packages/extra_packages.repos diff --git a/ci/extra_packages/my_custom_message/CMakeLists.txt b/ci/arduino/extra_packages/my_custom_message/CMakeLists.txt similarity index 100% rename from ci/extra_packages/my_custom_message/CMakeLists.txt rename to ci/arduino/extra_packages/my_custom_message/CMakeLists.txt diff --git a/ci/extra_packages/my_custom_message/msg/MyCustomMessage.msg b/ci/arduino/extra_packages/my_custom_message/msg/MyCustomMessage.msg similarity index 100% rename from ci/extra_packages/my_custom_message/msg/MyCustomMessage.msg rename to ci/arduino/extra_packages/my_custom_message/msg/MyCustomMessage.msg diff --git a/ci/extra_packages/my_custom_message/package.xml b/ci/arduino/extra_packages/my_custom_message/package.xml similarity index 100% rename from ci/extra_packages/my_custom_message/package.xml rename to ci/arduino/extra_packages/my_custom_message/package.xml diff --git a/ci/platformio.ini b/ci/arduino/platformio.ini similarity index 92% rename from ci/platformio.ini rename to ci/arduino/platformio.ini index c7becb18..59b02b1f 100644 --- a/ci/platformio.ini +++ b/ci/arduino/platformio.ini @@ -6,7 +6,7 @@ framework = arduino board_microros_transport = serial board_microros_distro = galactic lib_deps = - ../ + ../../ ; Foxy test [env:portenta_h7_m7_foxy] @@ -16,7 +16,7 @@ framework = arduino board_microros_transport = serial board_microros_distro = foxy lib_deps = - ../ + ../../ ; Rolling test [env:portenta_h7_m7_rolling] @@ -26,7 +26,7 @@ framework = arduino board_microros_transport = serial board_microros_distro = rolling lib_deps = - ../ + ../../ ; Serial platforms @@ -36,7 +36,7 @@ board = portenta_h7_m7 framework = arduino board_microros_transport = serial lib_deps = - ../ + ../../ [env:teensy41] platform = teensy @@ -44,7 +44,7 @@ board = teensy41 framework = arduino board_microros_transport = serial lib_deps = - ../ + ../../ [env:teensy40] platform = teensy @@ -52,7 +52,7 @@ board = teensy40 framework = arduino board_microros_transport = serial lib_deps = - ../ + ../../ [env:teensy36] platform = teensy @@ -60,7 +60,7 @@ board = teensy36 framework = arduino board_microros_transport = serial lib_deps = - ../ + ../../ [env:teensy35] platform = teensy @@ -68,7 +68,7 @@ board = teensy35 framework = arduino board_microros_transport = serial lib_deps = - ../ + ../../ [env:teensy31] platform = teensy @@ -76,7 +76,7 @@ board = teensy31 framework = arduino board_microros_transport = serial lib_deps = - ../ + ../../ [env:due] platform = atmelsam @@ -84,7 +84,7 @@ board = due framework = arduino board_microros_transport = serial lib_deps = - ../ + ../../ [env:zero] platform = atmelsam @@ -92,7 +92,7 @@ board = zero framework = arduino board_microros_transport = serial lib_deps = - ../ + ../../ [env:olimex_e407] platform = ststm32 @@ -100,7 +100,7 @@ board = olimex_e407 framework = arduino board_microros_transport = serial lib_deps = - ../ + ../../ [env:esp32dev] platform = espressif32 @@ -108,7 +108,7 @@ board = esp32dev framework = arduino board_microros_transport = serial lib_deps = - ../ + ../../ [env:nanorp2040connect] platform = raspberrypi @@ -117,7 +117,7 @@ framework = arduino lib_ldf_mode = chain+ board_microros_transport = serial lib_deps = - ../ + ../../ [env:pico] platform = raspberrypi @@ -126,7 +126,7 @@ framework = arduino lib_ldf_mode = chain+ board_microros_transport = serial lib_deps = - ../ + ../../ ; Ethernet platforms @@ -136,7 +136,7 @@ board = teensy41 framework = arduino board_microros_transport = native_ethernet lib_deps = - ../ + ../../ ; WiFi platforms @@ -146,7 +146,7 @@ board = portenta_h7_m7 framework = arduino board_microros_transport = wifi lib_deps = - ../ + ../../ [env:esp32dev_wifi] platform = espressif32 @@ -154,7 +154,7 @@ board = esp32dev framework = arduino board_microros_transport = wifi lib_deps = - ../ + ../../ [env:nanorp2040connect_wifi] platform = raspberrypi @@ -163,7 +163,7 @@ framework = arduino board_microros_transport = wifi_nina lib_deps = arduino-libraries/WiFiNINA@^1.8.13 - ../ + ../../ ; Custom transports @@ -173,4 +173,4 @@ board = teensy41 framework = arduino board_microros_transport = custom lib_deps = - ../ + ../../ diff --git a/ci/src/main.cpp b/ci/arduino/src/main.cpp similarity index 100% rename from ci/src/main.cpp rename to ci/arduino/src/main.cpp From a114a7171cd4cc0f9755549eeaad7310b4859cb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C5=82a=C5=BCej=20Sowa?= Date: Wed, 3 Aug 2022 18:46:39 +0200 Subject: [PATCH 07/23] Make the transport header compatible with C language --- .../stm32cube/serial/micro_ros_transport.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/platform_code/stm32cube/serial/micro_ros_transport.h b/platform_code/stm32cube/serial/micro_ros_transport.h index 64ac88b8..2922788b 100644 --- a/platform_code/stm32cube/serial/micro_ros_transport.h +++ b/platform_code/stm32cube/serial/micro_ros_transport.h @@ -1,5 +1,9 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + #if defined(STM32F0xx) #include "stm32f0xx_hal.h" #elif defined(STM32F1xx) @@ -31,12 +35,16 @@ struct DMAStream { uint8_t* tbuffer; }; -static inline void set_microros_serial_transports(DMAStream& stream) { +static inline void set_microros_serial_transports(struct DMAStream* stream) { rmw_uros_set_custom_transport( - true, &stream, platformio_transport_open, platformio_transport_close, + true, stream, platformio_transport_open, platformio_transport_close, platformio_transport_write, platformio_transport_read); } /// This function should be called from HAL_UART_TxCpltCallback. Otherwise the /// transform won't work properly. -void uart_transfer_complete_callback(DMAStream* stream); +void uart_transfer_complete_callback(struct DMAStream* stream); + +#ifdef __cplusplus +} +#endif From 3fdcc1cb80cfb21cd4db37f0b7a2758f960a75f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C5=82a=C5=BCej=20Sowa?= Date: Wed, 3 Aug 2022 18:48:33 +0200 Subject: [PATCH 08/23] Add example project for stm32cube framework --- ci/stm32cube/.gitignore | 1 + ci/stm32cube/.vscode/c_cpp_properties.json | 198 +++++++++ ci/stm32cube/.vscode/extensions.json | 10 + ci/stm32cube/.vscode/launch.json | 47 ++ ci/stm32cube/Inc/dma.h | 52 +++ ci/stm32cube/Inc/gpio.h | 49 ++ ci/stm32cube/Inc/main.h | 71 +++ ci/stm32cube/Inc/stm32f4xx_hal_conf.h | 492 +++++++++++++++++++++ ci/stm32cube/Inc/stm32f4xx_it.h | 72 +++ ci/stm32cube/Inc/usart.h | 52 +++ ci/stm32cube/STM32F401RC.ioc | 146 ++++++ ci/stm32cube/Src/dma.c | 58 +++ ci/stm32cube/Src/gpio.c | 54 +++ ci/stm32cube/Src/main.c | 259 +++++++++++ ci/stm32cube/Src/stm32f4xx_hal_msp.c | 84 ++++ ci/stm32cube/Src/stm32f4xx_it.c | 249 +++++++++++ ci/stm32cube/Src/usart.c | 164 +++++++ ci/stm32cube/platformio.ini | 14 + ci/stm32cube/stm32pio.ini | 18 + 19 files changed, 2090 insertions(+) create mode 100644 ci/stm32cube/.gitignore create mode 100644 ci/stm32cube/.vscode/c_cpp_properties.json create mode 100644 ci/stm32cube/.vscode/extensions.json create mode 100644 ci/stm32cube/.vscode/launch.json create mode 100644 ci/stm32cube/Inc/dma.h create mode 100644 ci/stm32cube/Inc/gpio.h create mode 100644 ci/stm32cube/Inc/main.h create mode 100644 ci/stm32cube/Inc/stm32f4xx_hal_conf.h create mode 100644 ci/stm32cube/Inc/stm32f4xx_it.h create mode 100644 ci/stm32cube/Inc/usart.h create mode 100644 ci/stm32cube/STM32F401RC.ioc create mode 100644 ci/stm32cube/Src/dma.c create mode 100644 ci/stm32cube/Src/gpio.c create mode 100644 ci/stm32cube/Src/main.c create mode 100644 ci/stm32cube/Src/stm32f4xx_hal_msp.c create mode 100644 ci/stm32cube/Src/stm32f4xx_it.c create mode 100644 ci/stm32cube/Src/usart.c create mode 100644 ci/stm32cube/platformio.ini create mode 100644 ci/stm32cube/stm32pio.ini diff --git a/ci/stm32cube/.gitignore b/ci/stm32cube/.gitignore new file mode 100644 index 00000000..03f4a3c1 --- /dev/null +++ b/ci/stm32cube/.gitignore @@ -0,0 +1 @@ +.pio diff --git a/ci/stm32cube/.vscode/c_cpp_properties.json b/ci/stm32cube/.vscode/c_cpp_properties.json new file mode 100644 index 00000000..55dc02f1 --- /dev/null +++ b/ci/stm32cube/.vscode/c_cpp_properties.json @@ -0,0 +1,198 @@ +// +// !!! WARNING !!! AUTO-GENERATED FILE! +// PLEASE DO NOT MODIFY IT AND USE "platformio.ini": +// https://docs.platformio.org/page/projectconf/section_env_build.html#build-flags +// +{ + "configurations": [ + { + "name": "PlatformIO", + "includePath": [ + "/home/blazej/lazik/leo/leocore_firmware_ros2/Lib/micro_ros_platformio/ci/stm32cube/Inc", + "/home/blazej/lazik/leo/leocore_firmware_ros2/Lib/micro_ros_platformio/ci/stm32cube/Src", + "/home/blazej/lazik/leo/leocore_firmware_ros2/Lib/micro_ros_platformio/ci/stm32cube/.pio/libdeps/genericSTM32F401RC/micro_ros_platformio", + "/home/blazej/lazik/leo/leocore_firmware_ros2/Lib/micro_ros_platformio/ci/stm32cube/.pio/libdeps/genericSTM32F401RC/micro_ros_platformio/libmicroros/include", + "/home/blazej/lazik/leo/leocore_firmware_ros2/Lib/micro_ros_platformio/ci/stm32cube/.pio/libdeps/genericSTM32F401RC/micro_ros_platformio/platform_code", + "/home/blazej/lazik/leo/leocore_firmware_ros2/Lib/micro_ros_platformio/ci/stm32cube/.pio/libdeps/genericSTM32F401RC/micro_ros_platformio/platform_code/stm32cube/serial", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/CMSIS/Include", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/CMSIS/Device/ST/STM32F4xx/Include", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/STM32F4xx_HAL_Driver/Inc", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/STM32F4xx_HAL_Driver/Src", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/CMSIS/DSP/Include", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/n25q128a", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/nt35510", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/lsm303dlhc", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/ls016b8uy", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/ov2640", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/n25q256a", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/ampire480272", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/i3g4250d", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/lsm303agr", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/ili9341", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/st7735", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/stmpe1600", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/ts3510", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/n25q512a", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/Common", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/lis3dsh", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/otm8009a", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/cs43l22", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/l3gd20", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/exc7200", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/mfxstm32l152", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/lis302dl", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/stmpe811", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/wm8994", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/st7789h2", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/ft6x06", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/ampire640480", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/s5k5cag", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/ili9325", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/ov5640", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/s25fl512s", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Adafruit_Shield", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Utilities/CPU", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Utilities/Log", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Utilities/Fonts", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Core/Inc", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Core/Src", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/MSC/Inc", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/MSC/Src", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/DFU/Inc", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/DFU/Src", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/CDC_ECM/Inc", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/CDC_ECM/Src", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/AUDIO/Inc", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/AUDIO/Src", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/CDC_RNDIS/Inc", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/CDC_RNDIS/Src", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/BillBoard/Inc", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/BillBoard/Src", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/CustomHID/Inc", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/CustomHID/Src", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/VIDEO/Inc", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/VIDEO/Src", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Src", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/HID/Inc", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/HID/Src", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Host_Library/Core/Inc", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Host_Library/Core/Src", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Host_Library/Class/MSC/Inc", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Host_Library/Class/MSC/Src", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Host_Library/Class/AUDIO/Inc", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Host_Library/Class/AUDIO/Src", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Host_Library/Class/MTP/Inc", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Host_Library/Class/MTP/Src", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Host_Library/Class/CDC/Inc", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Host_Library/Class/CDC/Src", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Host_Library/Class/HID/Inc", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Host_Library/Class/HID/Src", + "" + ], + "browse": { + "limitSymbolsToIncludedHeaders": true, + "path": [ + "/home/blazej/lazik/leo/leocore_firmware_ros2/Lib/micro_ros_platformio/ci/stm32cube/Inc", + "/home/blazej/lazik/leo/leocore_firmware_ros2/Lib/micro_ros_platformio/ci/stm32cube/Src", + "/home/blazej/lazik/leo/leocore_firmware_ros2/Lib/micro_ros_platformio/ci/stm32cube/.pio/libdeps/genericSTM32F401RC/micro_ros_platformio", + "/home/blazej/lazik/leo/leocore_firmware_ros2/Lib/micro_ros_platformio/ci/stm32cube/.pio/libdeps/genericSTM32F401RC/micro_ros_platformio/libmicroros/include", + "/home/blazej/lazik/leo/leocore_firmware_ros2/Lib/micro_ros_platformio/ci/stm32cube/.pio/libdeps/genericSTM32F401RC/micro_ros_platformio/platform_code", + "/home/blazej/lazik/leo/leocore_firmware_ros2/Lib/micro_ros_platformio/ci/stm32cube/.pio/libdeps/genericSTM32F401RC/micro_ros_platformio/platform_code/stm32cube/serial", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/CMSIS/Include", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/CMSIS/Device/ST/STM32F4xx/Include", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/STM32F4xx_HAL_Driver/Inc", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/STM32F4xx_HAL_Driver/Src", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/CMSIS/DSP/Include", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/n25q128a", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/nt35510", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/lsm303dlhc", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/ls016b8uy", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/ov2640", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/n25q256a", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/ampire480272", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/i3g4250d", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/lsm303agr", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/ili9341", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/st7735", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/stmpe1600", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/ts3510", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/n25q512a", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/Common", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/lis3dsh", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/otm8009a", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/cs43l22", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/l3gd20", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/exc7200", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/mfxstm32l152", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/lis302dl", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/stmpe811", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/wm8994", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/st7789h2", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/ft6x06", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/ampire640480", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/s5k5cag", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/ili9325", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/ov5640", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/s25fl512s", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Adafruit_Shield", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Utilities/CPU", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Utilities/Log", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Utilities/Fonts", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Core/Inc", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Core/Src", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/MSC/Inc", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/MSC/Src", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/DFU/Inc", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/DFU/Src", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/CDC_ECM/Inc", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/CDC_ECM/Src", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/AUDIO/Inc", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/AUDIO/Src", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/CDC_RNDIS/Inc", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/CDC_RNDIS/Src", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/BillBoard/Inc", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/BillBoard/Src", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/CustomHID/Inc", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/CustomHID/Src", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/VIDEO/Inc", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/VIDEO/Src", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Src", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/HID/Inc", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/HID/Src", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Host_Library/Core/Inc", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Host_Library/Core/Src", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Host_Library/Class/MSC/Inc", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Host_Library/Class/MSC/Src", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Host_Library/Class/AUDIO/Inc", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Host_Library/Class/AUDIO/Src", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Host_Library/Class/MTP/Inc", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Host_Library/Class/MTP/Src", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Host_Library/Class/CDC/Inc", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Host_Library/Class/CDC/Src", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Host_Library/Class/HID/Inc", + "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Host_Library/Class/HID/Src", + "" + ] + }, + "defines": [ + "PLATFORMIO=60103", + "STM32F401xC", + "STM32F4xx", + "USE_HAL_DRIVER", + "F_CPU=84000000L", + "MICRO_ROS_TRANSPORT_STM32CUBE_SERIAL=1", + "MICRO_ROS_DISTRO_HUMBLE =1", + "" + ], + "compilerPath": "/home/blazej/.platformio/packages/toolchain-gccarmnoneeabi@1.70201.0/bin/arm-none-eabi-gcc", + "compilerArgs": [ + "-mthumb", + "-mcpu=cortex-m4", + "" + ] + } + ], + "version": 4 +} diff --git a/ci/stm32cube/.vscode/extensions.json b/ci/stm32cube/.vscode/extensions.json new file mode 100644 index 00000000..080e70d0 --- /dev/null +++ b/ci/stm32cube/.vscode/extensions.json @@ -0,0 +1,10 @@ +{ + // See http://go.microsoft.com/fwlink/?LinkId=827846 + // for the documentation about the extensions.json format + "recommendations": [ + "platformio.platformio-ide" + ], + "unwantedRecommendations": [ + "ms-vscode.cpptools-extension-pack" + ] +} diff --git a/ci/stm32cube/.vscode/launch.json b/ci/stm32cube/.vscode/launch.json new file mode 100644 index 00000000..53b0a953 --- /dev/null +++ b/ci/stm32cube/.vscode/launch.json @@ -0,0 +1,47 @@ +// AUTOMATICALLY GENERATED FILE. PLEASE DO NOT MODIFY IT MANUALLY +// +// PIO Unified Debugger +// +// Documentation: https://docs.platformio.org/page/plus/debugging.html +// Configuration: https://docs.platformio.org/page/projectconf/section_env_debug.html + +{ + "version": "0.2.0", + "configurations": [ + { + "type": "platformio-debug", + "request": "launch", + "name": "PIO Debug", + "executable": "/home/blazej/lazik/leo/leocore_firmware_ros2/Lib/micro_ros_platformio/ci/stm32cube/.pio/build/genericSTM32F401RC/firmware.elf", + "projectEnvName": "genericSTM32F401RC", + "toolchainBinDir": "/home/blazej/.platformio/packages/toolchain-gccarmnoneeabi@1.70201.0/bin", + "internalConsoleOptions": "openOnSessionStart", + "svdPath": "/home/blazej/.platformio/platforms/ststm32/misc/svd/STM32F401x.svd", + "preLaunchTask": { + "type": "PlatformIO", + "task": "Pre-Debug" + } + }, + { + "type": "platformio-debug", + "request": "launch", + "name": "PIO Debug (skip Pre-Debug)", + "executable": "/home/blazej/lazik/leo/leocore_firmware_ros2/Lib/micro_ros_platformio/ci/stm32cube/.pio/build/genericSTM32F401RC/firmware.elf", + "projectEnvName": "genericSTM32F401RC", + "toolchainBinDir": "/home/blazej/.platformio/packages/toolchain-gccarmnoneeabi@1.70201.0/bin", + "internalConsoleOptions": "openOnSessionStart", + "svdPath": "/home/blazej/.platformio/platforms/ststm32/misc/svd/STM32F401x.svd" + }, + { + "type": "platformio-debug", + "request": "launch", + "name": "PIO Debug (without uploading)", + "executable": "/home/blazej/lazik/leo/leocore_firmware_ros2/Lib/micro_ros_platformio/ci/stm32cube/.pio/build/genericSTM32F401RC/firmware.elf", + "projectEnvName": "genericSTM32F401RC", + "toolchainBinDir": "/home/blazej/.platformio/packages/toolchain-gccarmnoneeabi@1.70201.0/bin", + "internalConsoleOptions": "openOnSessionStart", + "svdPath": "/home/blazej/.platformio/platforms/ststm32/misc/svd/STM32F401x.svd", + "loadMode": "manual" + } + ] +} diff --git a/ci/stm32cube/Inc/dma.h b/ci/stm32cube/Inc/dma.h new file mode 100644 index 00000000..34808188 --- /dev/null +++ b/ci/stm32cube/Inc/dma.h @@ -0,0 +1,52 @@ +/** + ****************************************************************************** + * @file dma.h + * @brief This file contains all the function prototypes for + * the dma.c file + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2022 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __DMA_H__ +#define __DMA_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "main.h" + +/* DMA memory to memory transfer handles -------------------------------------*/ + +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +/* USER CODE BEGIN Private defines */ + +/* USER CODE END Private defines */ + +void MX_DMA_Init(void); + +/* USER CODE BEGIN Prototypes */ + +/* USER CODE END Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif /* __DMA_H__ */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ci/stm32cube/Inc/gpio.h b/ci/stm32cube/Inc/gpio.h new file mode 100644 index 00000000..1fa69006 --- /dev/null +++ b/ci/stm32cube/Inc/gpio.h @@ -0,0 +1,49 @@ +/** + ****************************************************************************** + * @file gpio.h + * @brief This file contains all the function prototypes for + * the gpio.c file + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2022 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __GPIO_H__ +#define __GPIO_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "main.h" + +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +/* USER CODE BEGIN Private defines */ + +/* USER CODE END Private defines */ + +void MX_GPIO_Init(void); + +/* USER CODE BEGIN Prototypes */ + +/* USER CODE END Prototypes */ + +#ifdef __cplusplus +} +#endif +#endif /*__ GPIO_H__ */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ci/stm32cube/Inc/main.h b/ci/stm32cube/Inc/main.h new file mode 100644 index 00000000..edfdf455 --- /dev/null +++ b/ci/stm32cube/Inc/main.h @@ -0,0 +1,71 @@ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file : main.h + * @brief : Header for main.c file. + * This file contains the common defines of the application. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2022 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __MAIN_H +#define __MAIN_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f4xx_hal.h" + +/* Private includes ----------------------------------------------------------*/ +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +/* Exported types ------------------------------------------------------------*/ +/* USER CODE BEGIN ET */ + +/* USER CODE END ET */ + +/* Exported constants --------------------------------------------------------*/ +/* USER CODE BEGIN EC */ + +/* USER CODE END EC */ + +/* Exported macro ------------------------------------------------------------*/ +/* USER CODE BEGIN EM */ + +/* USER CODE END EM */ + +/* Exported functions prototypes ---------------------------------------------*/ +void Error_Handler(void); + +/* USER CODE BEGIN EFP */ + +/* USER CODE END EFP */ + +/* Private defines -----------------------------------------------------------*/ +/* USER CODE BEGIN Private defines */ + +/* USER CODE END Private defines */ + +#ifdef __cplusplus +} +#endif + +#endif /* __MAIN_H */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ci/stm32cube/Inc/stm32f4xx_hal_conf.h b/ci/stm32cube/Inc/stm32f4xx_hal_conf.h new file mode 100644 index 00000000..b13cce81 --- /dev/null +++ b/ci/stm32cube/Inc/stm32f4xx_hal_conf.h @@ -0,0 +1,492 @@ +/** + ****************************************************************************** + * @file stm32f4xx_hal_conf_template.h + * @author MCD Application Team + * @brief HAL configuration template file. + * This file should be copied to the application folder and renamed + * to stm32f4xx_hal_conf.h. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2017 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F4xx_HAL_CONF_H +#define __STM32F4xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED + + /* #define HAL_ADC_MODULE_ENABLED */ +/* #define HAL_CRYP_MODULE_ENABLED */ +/* #define HAL_CAN_MODULE_ENABLED */ +/* #define HAL_CRC_MODULE_ENABLED */ +/* #define HAL_CAN_LEGACY_MODULE_ENABLED */ +/* #define HAL_CRYP_MODULE_ENABLED */ +/* #define HAL_DAC_MODULE_ENABLED */ +/* #define HAL_DCMI_MODULE_ENABLED */ +/* #define HAL_DMA2D_MODULE_ENABLED */ +/* #define HAL_ETH_MODULE_ENABLED */ +/* #define HAL_NAND_MODULE_ENABLED */ +/* #define HAL_NOR_MODULE_ENABLED */ +/* #define HAL_PCCARD_MODULE_ENABLED */ +/* #define HAL_SRAM_MODULE_ENABLED */ +/* #define HAL_SDRAM_MODULE_ENABLED */ +/* #define HAL_HASH_MODULE_ENABLED */ +/* #define HAL_I2C_MODULE_ENABLED */ +/* #define HAL_I2S_MODULE_ENABLED */ +/* #define HAL_IWDG_MODULE_ENABLED */ +/* #define HAL_LTDC_MODULE_ENABLED */ +/* #define HAL_RNG_MODULE_ENABLED */ +/* #define HAL_RTC_MODULE_ENABLED */ +/* #define HAL_SAI_MODULE_ENABLED */ +/* #define HAL_SD_MODULE_ENABLED */ +/* #define HAL_MMC_MODULE_ENABLED */ +/* #define HAL_SPI_MODULE_ENABLED */ +/* #define HAL_TIM_MODULE_ENABLED */ +#define HAL_UART_MODULE_ENABLED +/* #define HAL_USART_MODULE_ENABLED */ +/* #define HAL_IRDA_MODULE_ENABLED */ +/* #define HAL_SMARTCARD_MODULE_ENABLED */ +/* #define HAL_SMBUS_MODULE_ENABLED */ +/* #define HAL_WWDG_MODULE_ENABLED */ +/* #define HAL_PCD_MODULE_ENABLED */ +/* #define HAL_HCD_MODULE_ENABLED */ +/* #define HAL_DSI_MODULE_ENABLED */ +/* #define HAL_QSPI_MODULE_ENABLED */ +/* #define HAL_QSPI_MODULE_ENABLED */ +/* #define HAL_CEC_MODULE_ENABLED */ +/* #define HAL_FMPI2C_MODULE_ENABLED */ +/* #define HAL_FMPSMBUS_MODULE_ENABLED */ +/* #define HAL_SPDIFRX_MODULE_ENABLED */ +/* #define HAL_DFSDM_MODULE_ENABLED */ +/* #define HAL_LPTIM_MODULE_ENABLED */ +#define HAL_GPIO_MODULE_ENABLED +#define HAL_EXTI_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED + +/* ########################## HSE/HSI Values adaptation ##################### */ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) + #define HSE_VALUE 8000000U /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT 100U /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) + #define LSI_VALUE 32000U /*!< LSI Typical Value in Hz*/ +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature.*/ +/** + * @brief External Low Speed oscillator (LSE) value. + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE 32768U /*!< Value of the External Low Speed oscillator in Hz */ +#endif /* LSE_VALUE */ + +#if !defined (LSE_STARTUP_TIMEOUT) + #define LSE_STARTUP_TIMEOUT 5000U /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + +/** + * @brief External clock source for I2S peripheral + * This value is used by the I2S HAL module to compute the I2S clock source + * frequency, this source is inserted directly through I2S_CKIN pad. + */ +#if !defined (EXTERNAL_CLOCK_VALUE) + #define EXTERNAL_CLOCK_VALUE 12288000U /*!< Value of the External audio frequency in Hz*/ +#endif /* EXTERNAL_CLOCK_VALUE */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE 3300U /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY 15U /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 1U +#define INSTRUCTION_CACHE_ENABLE 1U +#define DATA_CACHE_ENABLE 1U + +#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */ +#define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */ +#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */ +#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U /* CRYP register callback disabled */ +#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */ +#define USE_HAL_DCMI_REGISTER_CALLBACKS 0U /* DCMI register callback disabled */ +#define USE_HAL_DFSDM_REGISTER_CALLBACKS 0U /* DFSDM register callback disabled */ +#define USE_HAL_DMA2D_REGISTER_CALLBACKS 0U /* DMA2D register callback disabled */ +#define USE_HAL_DSI_REGISTER_CALLBACKS 0U /* DSI register callback disabled */ +#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */ +#define USE_HAL_HASH_REGISTER_CALLBACKS 0U /* HASH register callback disabled */ +#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */ +#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */ +#define USE_HAL_FMPI2C_REGISTER_CALLBACKS 0U /* FMPI2C register callback disabled */ +#define USE_HAL_FMPSMBUS_REGISTER_CALLBACKS 0U /* FMPSMBUS register callback disabled */ +#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */ +#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */ +#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U /* LPTIM register callback disabled */ +#define USE_HAL_LTDC_REGISTER_CALLBACKS 0U /* LTDC register callback disabled */ +#define USE_HAL_MMC_REGISTER_CALLBACKS 0U /* MMC register callback disabled */ +#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */ +#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */ +#define USE_HAL_PCCARD_REGISTER_CALLBACKS 0U /* PCCARD register callback disabled */ +#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */ +#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U /* QSPI register callback disabled */ +#define USE_HAL_RNG_REGISTER_CALLBACKS 0U /* RNG register callback disabled */ +#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */ +#define USE_HAL_SAI_REGISTER_CALLBACKS 0U /* SAI register callback disabled */ +#define USE_HAL_SD_REGISTER_CALLBACKS 0U /* SD register callback disabled */ +#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */ +#define USE_HAL_SDRAM_REGISTER_CALLBACKS 0U /* SDRAM register callback disabled */ +#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */ +#define USE_HAL_SPDIFRX_REGISTER_CALLBACKS 0U /* SPDIFRX register callback disabled */ +#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */ +#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */ +#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */ +#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */ +#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */ +#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */ + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1U */ + +/* ################## Ethernet peripheral configuration ##################### */ + +/* Section 1 : Ethernet peripheral configuration */ + +/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ +#define MAC_ADDR0 2U +#define MAC_ADDR1 0U +#define MAC_ADDR2 0U +#define MAC_ADDR3 0U +#define MAC_ADDR4 0U +#define MAC_ADDR5 0U + +/* Definition of the Ethernet driver buffers size and count */ +#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ +#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ +#define ETH_RXBUFNB 4U /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ +#define ETH_TXBUFNB 4U /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ + +/* Section 2: PHY configuration section */ + +/* DP83848_PHY_ADDRESS Address*/ +#define DP83848_PHY_ADDRESS 0x01U +/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ +#define PHY_RESET_DELAY 0x000000FFU +/* PHY Configuration delay */ +#define PHY_CONFIG_DELAY 0x00000FFFU + +#define PHY_READ_TO 0x0000FFFFU +#define PHY_WRITE_TO 0x0000FFFFU + +/* Section 3: Common PHY Registers */ + +#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ +#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ + +#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ +#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ +#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ +#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ +#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ +#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ +#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ +#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ +#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ +#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ + +#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ +#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ +#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ + +/* Section 4: Extended PHY Registers */ +#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ + +#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ +#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ + +/* ################## SPI peripheral configuration ########################## */ + +/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver +* Activated: CRC code is present inside driver +* Deactivated: CRC code cleaned from driver +*/ + +#define USE_SPI_CRC 0U + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32f4xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32f4xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_EXTI_MODULE_ENABLED + #include "stm32f4xx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32f4xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32f4xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32f4xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_CAN_MODULE_ENABLED + #include "stm32f4xx_hal_can.h" +#endif /* HAL_CAN_MODULE_ENABLED */ + +#ifdef HAL_CAN_LEGACY_MODULE_ENABLED + #include "stm32f4xx_hal_can_legacy.h" +#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32f4xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED + #include "stm32f4xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DMA2D_MODULE_ENABLED + #include "stm32f4xx_hal_dma2d.h" +#endif /* HAL_DMA2D_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32f4xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_DCMI_MODULE_ENABLED + #include "stm32f4xx_hal_dcmi.h" +#endif /* HAL_DCMI_MODULE_ENABLED */ + +#ifdef HAL_ETH_MODULE_ENABLED + #include "stm32f4xx_hal_eth.h" +#endif /* HAL_ETH_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32f4xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_SRAM_MODULE_ENABLED + #include "stm32f4xx_hal_sram.h" +#endif /* HAL_SRAM_MODULE_ENABLED */ + +#ifdef HAL_NOR_MODULE_ENABLED + #include "stm32f4xx_hal_nor.h" +#endif /* HAL_NOR_MODULE_ENABLED */ + +#ifdef HAL_NAND_MODULE_ENABLED + #include "stm32f4xx_hal_nand.h" +#endif /* HAL_NAND_MODULE_ENABLED */ + +#ifdef HAL_PCCARD_MODULE_ENABLED + #include "stm32f4xx_hal_pccard.h" +#endif /* HAL_PCCARD_MODULE_ENABLED */ + +#ifdef HAL_SDRAM_MODULE_ENABLED + #include "stm32f4xx_hal_sdram.h" +#endif /* HAL_SDRAM_MODULE_ENABLED */ + +#ifdef HAL_HASH_MODULE_ENABLED + #include "stm32f4xx_hal_hash.h" +#endif /* HAL_HASH_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32f4xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_SMBUS_MODULE_ENABLED + #include "stm32f4xx_hal_smbus.h" +#endif /* HAL_SMBUS_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED + #include "stm32f4xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32f4xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_LTDC_MODULE_ENABLED + #include "stm32f4xx_hal_ltdc.h" +#endif /* HAL_LTDC_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32f4xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED + #include "stm32f4xx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32f4xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SAI_MODULE_ENABLED + #include "stm32f4xx_hal_sai.h" +#endif /* HAL_SAI_MODULE_ENABLED */ + +#ifdef HAL_SD_MODULE_ENABLED + #include "stm32f4xx_hal_sd.h" +#endif /* HAL_SD_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32f4xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32f4xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32f4xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32f4xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32f4xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32f4xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32f4xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32f4xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_HCD_MODULE_ENABLED + #include "stm32f4xx_hal_hcd.h" +#endif /* HAL_HCD_MODULE_ENABLED */ + +#ifdef HAL_DSI_MODULE_ENABLED + #include "stm32f4xx_hal_dsi.h" +#endif /* HAL_DSI_MODULE_ENABLED */ + +#ifdef HAL_QSPI_MODULE_ENABLED + #include "stm32f4xx_hal_qspi.h" +#endif /* HAL_QSPI_MODULE_ENABLED */ + +#ifdef HAL_CEC_MODULE_ENABLED + #include "stm32f4xx_hal_cec.h" +#endif /* HAL_CEC_MODULE_ENABLED */ + +#ifdef HAL_FMPI2C_MODULE_ENABLED + #include "stm32f4xx_hal_fmpi2c.h" +#endif /* HAL_FMPI2C_MODULE_ENABLED */ + +#ifdef HAL_FMPSMBUS_MODULE_ENABLED + #include "stm32f4xx_hal_fmpsmbus.h" +#endif /* HAL_FMPSMBUS_MODULE_ENABLED */ + +#ifdef HAL_SPDIFRX_MODULE_ENABLED + #include "stm32f4xx_hal_spdifrx.h" +#endif /* HAL_SPDIFRX_MODULE_ENABLED */ + +#ifdef HAL_DFSDM_MODULE_ENABLED + #include "stm32f4xx_hal_dfsdm.h" +#endif /* HAL_DFSDM_MODULE_ENABLED */ + +#ifdef HAL_LPTIM_MODULE_ENABLED + #include "stm32f4xx_hal_lptim.h" +#endif /* HAL_LPTIM_MODULE_ENABLED */ + +#ifdef HAL_MMC_MODULE_ENABLED + #include "stm32f4xx_hal_mmc.h" +#endif /* HAL_MMC_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F4xx_HAL_CONF_H */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ci/stm32cube/Inc/stm32f4xx_it.h b/ci/stm32cube/Inc/stm32f4xx_it.h new file mode 100644 index 00000000..368929ba --- /dev/null +++ b/ci/stm32cube/Inc/stm32f4xx_it.h @@ -0,0 +1,72 @@ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file stm32f4xx_it.h + * @brief This file contains the headers of the interrupt handlers. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2022 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F4xx_IT_H +#define __STM32F4xx_IT_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Private includes ----------------------------------------------------------*/ +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +/* Exported types ------------------------------------------------------------*/ +/* USER CODE BEGIN ET */ + +/* USER CODE END ET */ + +/* Exported constants --------------------------------------------------------*/ +/* USER CODE BEGIN EC */ + +/* USER CODE END EC */ + +/* Exported macro ------------------------------------------------------------*/ +/* USER CODE BEGIN EM */ + +/* USER CODE END EM */ + +/* Exported functions prototypes ---------------------------------------------*/ +void NMI_Handler(void); +void HardFault_Handler(void); +void MemManage_Handler(void); +void BusFault_Handler(void); +void UsageFault_Handler(void); +void SVC_Handler(void); +void DebugMon_Handler(void); +void PendSV_Handler(void); +void SysTick_Handler(void); +void USART1_IRQHandler(void); +void DMA2_Stream2_IRQHandler(void); +void DMA2_Stream7_IRQHandler(void); +/* USER CODE BEGIN EFP */ + +/* USER CODE END EFP */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F4xx_IT_H */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ci/stm32cube/Inc/usart.h b/ci/stm32cube/Inc/usart.h new file mode 100644 index 00000000..e519d518 --- /dev/null +++ b/ci/stm32cube/Inc/usart.h @@ -0,0 +1,52 @@ +/** + ****************************************************************************** + * @file usart.h + * @brief This file contains all the function prototypes for + * the usart.c file + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2022 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __USART_H__ +#define __USART_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "main.h" + +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +extern UART_HandleTypeDef huart1; + +/* USER CODE BEGIN Private defines */ + +/* USER CODE END Private defines */ + +void MX_USART1_UART_Init(void); + +/* USER CODE BEGIN Prototypes */ + +/* USER CODE END Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif /* __USART_H__ */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ci/stm32cube/STM32F401RC.ioc b/ci/stm32cube/STM32F401RC.ioc new file mode 100644 index 00000000..9693df03 --- /dev/null +++ b/ci/stm32cube/STM32F401RC.ioc @@ -0,0 +1,146 @@ +#MicroXplorer Configuration settings - do not modify +Dma.Request0=USART1_RX +Dma.Request1=USART1_TX +Dma.RequestsNb=2 +Dma.USART1_RX.0.Direction=DMA_PERIPH_TO_MEMORY +Dma.USART1_RX.0.FIFOMode=DMA_FIFOMODE_DISABLE +Dma.USART1_RX.0.Instance=DMA2_Stream2 +Dma.USART1_RX.0.MemDataAlignment=DMA_MDATAALIGN_BYTE +Dma.USART1_RX.0.MemInc=DMA_MINC_ENABLE +Dma.USART1_RX.0.Mode=DMA_CIRCULAR +Dma.USART1_RX.0.PeriphDataAlignment=DMA_PDATAALIGN_BYTE +Dma.USART1_RX.0.PeriphInc=DMA_PINC_DISABLE +Dma.USART1_RX.0.Priority=DMA_PRIORITY_VERY_HIGH +Dma.USART1_RX.0.RequestParameters=Instance,Direction,PeriphInc,MemInc,PeriphDataAlignment,MemDataAlignment,Mode,Priority,FIFOMode +Dma.USART1_TX.1.Direction=DMA_MEMORY_TO_PERIPH +Dma.USART1_TX.1.FIFOMode=DMA_FIFOMODE_DISABLE +Dma.USART1_TX.1.Instance=DMA2_Stream7 +Dma.USART1_TX.1.MemDataAlignment=DMA_MDATAALIGN_BYTE +Dma.USART1_TX.1.MemInc=DMA_MINC_ENABLE +Dma.USART1_TX.1.Mode=DMA_NORMAL +Dma.USART1_TX.1.PeriphDataAlignment=DMA_PDATAALIGN_BYTE +Dma.USART1_TX.1.PeriphInc=DMA_PINC_DISABLE +Dma.USART1_TX.1.Priority=DMA_PRIORITY_VERY_HIGH +Dma.USART1_TX.1.RequestParameters=Instance,Direction,PeriphInc,MemInc,PeriphDataAlignment,MemDataAlignment,Mode,Priority,FIFOMode +File.Version=6 +GPIO.groupedBy=Group By Peripherals +KeepUserPlacement=false +Mcu.Family=STM32F4 +Mcu.IP0=DMA +Mcu.IP1=NVIC +Mcu.IP2=RCC +Mcu.IP3=SYS +Mcu.IP4=USART1 +Mcu.IPNb=5 +Mcu.Name=STM32F401R(B-C)Tx +Mcu.Package=LQFP64 +Mcu.Pin0=PH0 - OSC_IN +Mcu.Pin1=PH1 - OSC_OUT +Mcu.Pin2=PA9 +Mcu.Pin3=PA10 +Mcu.Pin4=PA13 +Mcu.Pin5=PA14 +Mcu.Pin6=VP_SYS_VS_Systick +Mcu.PinsNb=7 +Mcu.ThirdPartyNb=0 +Mcu.UserConstants= +Mcu.UserName=STM32F401RCTx +MxCube.Version=6.3.0 +MxDb.Version=DB.6.0.30 +NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false +NVIC.DMA2_Stream2_IRQn=true\:5\:0\:true\:false\:true\:false\:true +NVIC.DMA2_Stream7_IRQn=true\:5\:0\:true\:false\:true\:false\:true +NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false +NVIC.ForceEnableDMAVector=true +NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false +NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:false\:false +NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:false\:false +NVIC.PendSV_IRQn=true\:0\:0\:false\:false\:true\:false\:false +NVIC.PriorityGroup=NVIC_PRIORITYGROUP_4 +NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:true\:false\:false +NVIC.SysTick_IRQn=true\:15\:0\:false\:false\:true\:false\:true +NVIC.USART1_IRQn=true\:5\:0\:true\:false\:true\:true\:true +NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false +PA10.Locked=true +PA10.Mode=Asynchronous +PA10.Signal=USART1_RX +PA13.Locked=true +PA13.Mode=Serial_Wire +PA13.Signal=SYS_JTMS-SWDIO +PA14.Locked=true +PA14.Mode=Serial_Wire +PA14.Signal=SYS_JTCK-SWCLK +PA9.Locked=true +PA9.Mode=Asynchronous +PA9.Signal=USART1_TX +PH0\ -\ OSC_IN.Locked=true +PH0\ -\ OSC_IN.Mode=HSE-External-Oscillator +PH0\ -\ OSC_IN.Signal=RCC_OSC_IN +PH1\ -\ OSC_OUT.Locked=true +PH1\ -\ OSC_OUT.Mode=HSE-External-Oscillator +PH1\ -\ OSC_OUT.Signal=RCC_OSC_OUT +PinOutPanel.RotationAngle=0 +ProjectManager.AskForMigrate=true +ProjectManager.BackupPrevious=false +ProjectManager.CompilerOptimize=6 +ProjectManager.ComputerToolchain=false +ProjectManager.CoupleFile=true +ProjectManager.CustomerFirmwarePackage= +ProjectManager.DefaultFWLocation=true +ProjectManager.DeletePrevious=true +ProjectManager.DeviceId=STM32F401RCTx +ProjectManager.FirmwarePackage=STM32Cube FW_F4 V1.26.2 +ProjectManager.FreePins=false +ProjectManager.HalAssertFull=false +ProjectManager.HeapSize=0x200 +ProjectManager.KeepUserCode=true +ProjectManager.LastFirmware=true +ProjectManager.LibraryCopy=1 +ProjectManager.MainLocation=Core/Src +ProjectManager.NoMain=false +ProjectManager.PreviousToolchain= +ProjectManager.ProjectBuild=false +ProjectManager.ProjectFileName=STM32F401RC.ioc +ProjectManager.ProjectName=STM32F401RC +ProjectManager.RegisterCallBack= +ProjectManager.StackSize=0x400 +ProjectManager.TargetToolchain=Other Toolchains (GPDSC) +ProjectManager.ToolChainLocation= +ProjectManager.UnderRoot=false +ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-MX_DMA_Init-DMA-false-HAL-true,3-SystemClock_Config-RCC-false-HAL-false,4-MX_USART1_UART_Init-USART1-false-HAL-true +RCC.48MHZClocksFreq_Value=42000000 +RCC.AHBFreq_Value=84000000 +RCC.APB1CLKDivider=RCC_HCLK_DIV2 +RCC.APB1Freq_Value=42000000 +RCC.APB1TimFreq_Value=84000000 +RCC.APB2Freq_Value=84000000 +RCC.APB2TimFreq_Value=84000000 +RCC.CortexFreq_Value=84000000 +RCC.FCLKCortexFreq_Value=84000000 +RCC.HCLKFreq_Value=84000000 +RCC.HSE_VALUE=8000000 +RCC.HSI_VALUE=16000000 +RCC.I2SClocksFreq_Value=96000000 +RCC.IPParameters=48MHZClocksFreq_Value,AHBFreq_Value,APB1CLKDivider,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,CortexFreq_Value,FCLKCortexFreq_Value,HCLKFreq_Value,HSE_VALUE,HSI_VALUE,I2SClocksFreq_Value,LSE_VALUE,LSI_VALUE,MCO2PinFreq_Value,PLLCLKFreq_Value,PLLM,PLLN,PLLQCLKFreq_Value,PLLSourceVirtual,RTCFreq_Value,RTCHSEDivFreq_Value,SYSCLKFreq_VALUE,SYSCLKSource,VCOI2SOutputFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VcooutputI2S +RCC.LSE_VALUE=32768 +RCC.LSI_VALUE=32000 +RCC.MCO2PinFreq_Value=84000000 +RCC.PLLCLKFreq_Value=84000000 +RCC.PLLM=8 +RCC.PLLN=168 +RCC.PLLQCLKFreq_Value=42000000 +RCC.PLLSourceVirtual=RCC_PLLSOURCE_HSE +RCC.RTCFreq_Value=32000 +RCC.RTCHSEDivFreq_Value=4000000 +RCC.SYSCLKFreq_VALUE=84000000 +RCC.SYSCLKSource=RCC_SYSCLKSOURCE_PLLCLK +RCC.VCOI2SOutputFreq_Value=192000000 +RCC.VCOInputFreq_Value=1000000 +RCC.VCOOutputFreq_Value=168000000 +RCC.VcooutputI2S=96000000 +USART1.BaudRate=460800 +USART1.IPParameters=VirtualMode,BaudRate +USART1.VirtualMode=VM_ASYNC +VP_SYS_VS_Systick.Mode=SysTick +VP_SYS_VS_Systick.Signal=SYS_VS_Systick +board=custom diff --git a/ci/stm32cube/Src/dma.c b/ci/stm32cube/Src/dma.c new file mode 100644 index 00000000..8f6a2e43 --- /dev/null +++ b/ci/stm32cube/Src/dma.c @@ -0,0 +1,58 @@ +/** + ****************************************************************************** + * @file dma.c + * @brief This file provides code for the configuration + * of all the requested memory to memory DMA transfers. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2022 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "dma.h" + +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ + +/*----------------------------------------------------------------------------*/ +/* Configure DMA */ +/*----------------------------------------------------------------------------*/ + +/* USER CODE BEGIN 1 */ + +/* USER CODE END 1 */ + +/** + * Enable DMA controller clock + */ +void MX_DMA_Init(void) +{ + + /* DMA controller clock enable */ + __HAL_RCC_DMA2_CLK_ENABLE(); + + /* DMA interrupt init */ + /* DMA2_Stream2_IRQn interrupt configuration */ + HAL_NVIC_SetPriority(DMA2_Stream2_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(DMA2_Stream2_IRQn); + /* DMA2_Stream7_IRQn interrupt configuration */ + HAL_NVIC_SetPriority(DMA2_Stream7_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(DMA2_Stream7_IRQn); + +} + +/* USER CODE BEGIN 2 */ + +/* USER CODE END 2 */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ci/stm32cube/Src/gpio.c b/ci/stm32cube/Src/gpio.c new file mode 100644 index 00000000..ba1f675a --- /dev/null +++ b/ci/stm32cube/Src/gpio.c @@ -0,0 +1,54 @@ +/** + ****************************************************************************** + * @file gpio.c + * @brief This file provides code for the configuration + * of all used GPIO pins. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2022 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "gpio.h" + +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ + +/*----------------------------------------------------------------------------*/ +/* Configure GPIO */ +/*----------------------------------------------------------------------------*/ +/* USER CODE BEGIN 1 */ + +/* USER CODE END 1 */ + +/** Configure pins as + * Analog + * Input + * Output + * EVENT_OUT + * EXTI +*/ +void MX_GPIO_Init(void) +{ + + /* GPIO Ports Clock Enable */ + __HAL_RCC_GPIOH_CLK_ENABLE(); + __HAL_RCC_GPIOA_CLK_ENABLE(); + +} + +/* USER CODE BEGIN 2 */ + +/* USER CODE END 2 */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ci/stm32cube/Src/main.c b/ci/stm32cube/Src/main.c new file mode 100644 index 00000000..7ebd5b95 --- /dev/null +++ b/ci/stm32cube/Src/main.c @@ -0,0 +1,259 @@ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file : main.c + * @brief : Main program body + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2022 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ +/* USER CODE END Header */ +/* Includes ------------------------------------------------------------------*/ +#include "main.h" +#include "dma.h" +#include "usart.h" +#include "gpio.h" + +/* Private includes ----------------------------------------------------------*/ +/* USER CODE BEGIN Includes */ +#include + +#include +#include +#include +#include +#include + +#include +/* USER CODE END Includes */ + +/* Private typedef -----------------------------------------------------------*/ +/* USER CODE BEGIN PTD */ + +/* USER CODE END PTD */ + +/* Private define ------------------------------------------------------------*/ +/* USER CODE BEGIN PD */ +#define RCCHECK(fn) \ + { \ + rcl_ret_t temp_rc = fn; \ + if ((temp_rc != RCL_RET_OK)) { \ + Error_Handler(); \ + } \ + } +#define RCSOFTCHECK(fn) \ + { \ + rcl_ret_t temp_rc = fn; \ + if ((temp_rc != RCL_RET_OK)) { \ + } \ + } +/* USER CODE END PD */ + +/* Private macro -------------------------------------------------------------*/ +/* USER CODE BEGIN PM */ + +/* USER CODE END PM */ + +/* Private variables ---------------------------------------------------------*/ + +/* USER CODE BEGIN PV */ +static rcl_publisher_t publisher; +static std_msgs__msg__Int32 msg; +static rclc_executor_t executor; +static rclc_support_t support; +static rcl_allocator_t allocator; +static rcl_node_t node; +static rcl_timer_t timer; + +static uint8_t uart_rbuffer[2048]; +static uint8_t uart_tbuffer[2048]; +static struct DMAStream stream = { + .uart = &huart1, + .rbuffer_size = 2048, + .rbuffer = uart_rbuffer, + .tbuffer_size = 2048, + .tbuffer = uart_tbuffer, +}; +/* USER CODE END PV */ + +/* Private function prototypes -----------------------------------------------*/ +void SystemClock_Config(void); +/* USER CODE BEGIN PFP */ + +/* USER CODE END PFP */ + +/* Private user code ---------------------------------------------------------*/ +/* USER CODE BEGIN 0 */ +void timer_callback(rcl_timer_t* timer, int64_t last_call_time) { + RCLC_UNUSED(last_call_time); + if (timer != NULL) { + RCSOFTCHECK(rcl_publish(&publisher, &msg, NULL)); + msg.data++; + } +} + +void HAL_UART_TxCpltCallback(UART_HandleTypeDef* huart) { + if (huart == &huart1) { + uart_transfer_complete_callback(&stream); + } +} +/* USER CODE END 0 */ + +/** + * @brief The application entry point. + * @retval int + */ +int main(void) +{ + /* USER CODE BEGIN 1 */ + + /* USER CODE END 1 */ + + /* MCU Configuration--------------------------------------------------------*/ + + /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ + HAL_Init(); + + /* USER CODE BEGIN Init */ + + /* USER CODE END Init */ + + /* Configure the system clock */ + SystemClock_Config(); + + /* USER CODE BEGIN SysInit */ + + /* USER CODE END SysInit */ + + /* Initialize all configured peripherals */ + MX_GPIO_Init(); + MX_DMA_Init(); + MX_USART1_UART_Init(); + /* USER CODE BEGIN 2 */ + set_microros_serial_transports(&stream); + + allocator = rcl_get_default_allocator(); + + // create init_options + RCCHECK(rclc_support_init(&support, 0, NULL, &allocator)); + + // create node + RCCHECK( + rclc_node_init_default(&node, "microros_platformio_node", "", &support)); + + // create publisher + RCCHECK(rclc_publisher_init_default( + &publisher, &node, ROSIDL_GET_MSG_TYPE_SUPPORT(std_msgs, msg, Int32), + "microros_platformio_publisher")); + + // create timer, + RCCHECK(rclc_timer_init_default(&timer, &support, RCL_MS_TO_NS(100), + timer_callback)); + + // create executor + RCCHECK(rclc_executor_init(&executor, &support.context, 1, &allocator)); + RCCHECK(rclc_executor_add_timer(&executor, &timer)); + + msg.data = 0; + /* USER CODE END 2 */ + + /* Infinite loop */ + /* USER CODE BEGIN WHILE */ + while (1) { + RCSOFTCHECK(rclc_executor_spin_some(&executor, RCL_MS_TO_NS(100))); + /* USER CODE END WHILE */ + + /* USER CODE BEGIN 3 */ + } + /* USER CODE END 3 */ +} + +/** + * @brief System Clock Configuration + * @retval None + */ +void SystemClock_Config(void) +{ + RCC_OscInitTypeDef RCC_OscInitStruct = {0}; + RCC_ClkInitTypeDef RCC_ClkInitStruct = {0}; + + /** Configure the main internal regulator output voltage + */ + __HAL_RCC_PWR_CLK_ENABLE(); + __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE2); + /** Initializes the RCC Oscillators according to the specified parameters + * in the RCC_OscInitTypeDef structure. + */ + RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; + RCC_OscInitStruct.HSEState = RCC_HSE_ON; + RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; + RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; + RCC_OscInitStruct.PLL.PLLM = 8; + RCC_OscInitStruct.PLL.PLLN = 168; + RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; + RCC_OscInitStruct.PLL.PLLQ = 4; + if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) + { + Error_Handler(); + } + /** Initializes the CPU, AHB and APB buses clocks + */ + RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK + |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2; + RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; + RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; + RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2; + RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; + + if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK) + { + Error_Handler(); + } +} + +/* USER CODE BEGIN 4 */ + +/* USER CODE END 4 */ + +/** + * @brief This function is executed in case of error occurrence. + * @retval None + */ +void Error_Handler(void) +{ + /* USER CODE BEGIN Error_Handler_Debug */ + /* User can add his own implementation to report the HAL error return state */ + __disable_irq(); + while (1) { + } + /* USER CODE END Error_Handler_Debug */ +} + +#ifdef USE_FULL_ASSERT +/** + * @brief Reports the name of the source file and the source line number + * where the assert_param error has occurred. + * @param file: pointer to the source file name + * @param line: assert_param error line source number + * @retval None + */ +void assert_failed(uint8_t *file, uint32_t line) +{ + /* USER CODE BEGIN 6 */ + /* User can add his own implementation to report the file name and line + number, ex: printf("Wrong parameters value: file %s on line %d\r\n", file, + line) */ + /* USER CODE END 6 */ +} +#endif /* USE_FULL_ASSERT */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ci/stm32cube/Src/stm32f4xx_hal_msp.c b/ci/stm32cube/Src/stm32f4xx_hal_msp.c new file mode 100644 index 00000000..bf3bb8ac --- /dev/null +++ b/ci/stm32cube/Src/stm32f4xx_hal_msp.c @@ -0,0 +1,84 @@ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file stm32f4xx_hal_msp.c + * @brief This file provides code for the MSP Initialization + * and de-Initialization codes. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2022 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Includes ------------------------------------------------------------------*/ +#include "main.h" +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +/* Private typedef -----------------------------------------------------------*/ +/* USER CODE BEGIN TD */ + +/* USER CODE END TD */ + +/* Private define ------------------------------------------------------------*/ +/* USER CODE BEGIN Define */ + +/* USER CODE END Define */ + +/* Private macro -------------------------------------------------------------*/ +/* USER CODE BEGIN Macro */ + +/* USER CODE END Macro */ + +/* Private variables ---------------------------------------------------------*/ +/* USER CODE BEGIN PV */ + +/* USER CODE END PV */ + +/* Private function prototypes -----------------------------------------------*/ +/* USER CODE BEGIN PFP */ + +/* USER CODE END PFP */ + +/* External functions --------------------------------------------------------*/ +/* USER CODE BEGIN ExternalFunctions */ + +/* USER CODE END ExternalFunctions */ + +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ +/** + * Initializes the Global MSP. + */ +void HAL_MspInit(void) +{ + /* USER CODE BEGIN MspInit 0 */ + + /* USER CODE END MspInit 0 */ + + __HAL_RCC_SYSCFG_CLK_ENABLE(); + __HAL_RCC_PWR_CLK_ENABLE(); + + /* System interrupt init*/ + + /* USER CODE BEGIN MspInit 1 */ + + /* USER CODE END MspInit 1 */ +} + +/* USER CODE BEGIN 1 */ + +/* USER CODE END 1 */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ci/stm32cube/Src/stm32f4xx_it.c b/ci/stm32cube/Src/stm32f4xx_it.c new file mode 100644 index 00000000..9d815ec8 --- /dev/null +++ b/ci/stm32cube/Src/stm32f4xx_it.c @@ -0,0 +1,249 @@ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file stm32f4xx_it.c + * @brief Interrupt Service Routines. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2022 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Includes ------------------------------------------------------------------*/ +#include "main.h" +#include "stm32f4xx_it.h" +/* Private includes ----------------------------------------------------------*/ +/* USER CODE BEGIN Includes */ +/* USER CODE END Includes */ + +/* Private typedef -----------------------------------------------------------*/ +/* USER CODE BEGIN TD */ + +/* USER CODE END TD */ + +/* Private define ------------------------------------------------------------*/ +/* USER CODE BEGIN PD */ + +/* USER CODE END PD */ + +/* Private macro -------------------------------------------------------------*/ +/* USER CODE BEGIN PM */ + +/* USER CODE END PM */ + +/* Private variables ---------------------------------------------------------*/ +/* USER CODE BEGIN PV */ + +/* USER CODE END PV */ + +/* Private function prototypes -----------------------------------------------*/ +/* USER CODE BEGIN PFP */ + +/* USER CODE END PFP */ + +/* Private user code ---------------------------------------------------------*/ +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ + +/* External variables --------------------------------------------------------*/ +extern DMA_HandleTypeDef hdma_usart1_rx; +extern DMA_HandleTypeDef hdma_usart1_tx; +extern UART_HandleTypeDef huart1; +/* USER CODE BEGIN EV */ + +/* USER CODE END EV */ + +/******************************************************************************/ +/* Cortex-M4 Processor Interruption and Exception Handlers */ +/******************************************************************************/ +/** + * @brief This function handles Non maskable interrupt. + */ +void NMI_Handler(void) +{ + /* USER CODE BEGIN NonMaskableInt_IRQn 0 */ + + /* USER CODE END NonMaskableInt_IRQn 0 */ + /* USER CODE BEGIN NonMaskableInt_IRQn 1 */ + while (1) + { + } + /* USER CODE END NonMaskableInt_IRQn 1 */ +} + +/** + * @brief This function handles Hard fault interrupt. + */ +void HardFault_Handler(void) +{ + /* USER CODE BEGIN HardFault_IRQn 0 */ + + /* USER CODE END HardFault_IRQn 0 */ + while (1) + { + /* USER CODE BEGIN W1_HardFault_IRQn 0 */ + /* USER CODE END W1_HardFault_IRQn 0 */ + } +} + +/** + * @brief This function handles Memory management fault. + */ +void MemManage_Handler(void) +{ + /* USER CODE BEGIN MemoryManagement_IRQn 0 */ + + /* USER CODE END MemoryManagement_IRQn 0 */ + while (1) + { + /* USER CODE BEGIN W1_MemoryManagement_IRQn 0 */ + /* USER CODE END W1_MemoryManagement_IRQn 0 */ + } +} + +/** + * @brief This function handles Pre-fetch fault, memory access fault. + */ +void BusFault_Handler(void) +{ + /* USER CODE BEGIN BusFault_IRQn 0 */ + + /* USER CODE END BusFault_IRQn 0 */ + while (1) + { + /* USER CODE BEGIN W1_BusFault_IRQn 0 */ + /* USER CODE END W1_BusFault_IRQn 0 */ + } +} + +/** + * @brief This function handles Undefined instruction or illegal state. + */ +void UsageFault_Handler(void) +{ + /* USER CODE BEGIN UsageFault_IRQn 0 */ + + /* USER CODE END UsageFault_IRQn 0 */ + while (1) + { + /* USER CODE BEGIN W1_UsageFault_IRQn 0 */ + /* USER CODE END W1_UsageFault_IRQn 0 */ + } +} + +/** + * @brief This function handles System service call via SWI instruction. + */ +void SVC_Handler(void) +{ + /* USER CODE BEGIN SVCall_IRQn 0 */ + + /* USER CODE END SVCall_IRQn 0 */ + /* USER CODE BEGIN SVCall_IRQn 1 */ + + /* USER CODE END SVCall_IRQn 1 */ +} + +/** + * @brief This function handles Debug monitor. + */ +void DebugMon_Handler(void) +{ + /* USER CODE BEGIN DebugMonitor_IRQn 0 */ + + /* USER CODE END DebugMonitor_IRQn 0 */ + /* USER CODE BEGIN DebugMonitor_IRQn 1 */ + + /* USER CODE END DebugMonitor_IRQn 1 */ +} + +/** + * @brief This function handles Pendable request for system service. + */ +void PendSV_Handler(void) +{ + /* USER CODE BEGIN PendSV_IRQn 0 */ + + /* USER CODE END PendSV_IRQn 0 */ + /* USER CODE BEGIN PendSV_IRQn 1 */ + + /* USER CODE END PendSV_IRQn 1 */ +} + +/** + * @brief This function handles System tick timer. + */ +void SysTick_Handler(void) +{ + /* USER CODE BEGIN SysTick_IRQn 0 */ + + /* USER CODE END SysTick_IRQn 0 */ + HAL_IncTick(); + /* USER CODE BEGIN SysTick_IRQn 1 */ + + /* USER CODE END SysTick_IRQn 1 */ +} + +/******************************************************************************/ +/* STM32F4xx Peripheral Interrupt Handlers */ +/* Add here the Interrupt Handlers for the used peripherals. */ +/* For the available peripheral interrupt handler names, */ +/* please refer to the startup file (startup_stm32f4xx.s). */ +/******************************************************************************/ + +/** + * @brief This function handles USART1 global interrupt. + */ +void USART1_IRQHandler(void) +{ + /* USER CODE BEGIN USART1_IRQn 0 */ + + /* USER CODE END USART1_IRQn 0 */ + HAL_UART_IRQHandler(&huart1); + /* USER CODE BEGIN USART1_IRQn 1 */ + + /* USER CODE END USART1_IRQn 1 */ +} + +/** + * @brief This function handles DMA2 stream2 global interrupt. + */ +void DMA2_Stream2_IRQHandler(void) +{ + /* USER CODE BEGIN DMA2_Stream2_IRQn 0 */ + + /* USER CODE END DMA2_Stream2_IRQn 0 */ + HAL_DMA_IRQHandler(&hdma_usart1_rx); + /* USER CODE BEGIN DMA2_Stream2_IRQn 1 */ + + /* USER CODE END DMA2_Stream2_IRQn 1 */ +} + +/** + * @brief This function handles DMA2 stream7 global interrupt. + */ +void DMA2_Stream7_IRQHandler(void) +{ + /* USER CODE BEGIN DMA2_Stream7_IRQn 0 */ + + /* USER CODE END DMA2_Stream7_IRQn 0 */ + HAL_DMA_IRQHandler(&hdma_usart1_tx); + /* USER CODE BEGIN DMA2_Stream7_IRQn 1 */ + + /* USER CODE END DMA2_Stream7_IRQn 1 */ +} + +/* USER CODE BEGIN 1 */ + +/* USER CODE END 1 */ +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ci/stm32cube/Src/usart.c b/ci/stm32cube/Src/usart.c new file mode 100644 index 00000000..aef53957 --- /dev/null +++ b/ci/stm32cube/Src/usart.c @@ -0,0 +1,164 @@ +/** + ****************************************************************************** + * @file usart.c + * @brief This file provides code for the configuration + * of the USART instances. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2022 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "usart.h" + +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ + +UART_HandleTypeDef huart1; +DMA_HandleTypeDef hdma_usart1_rx; +DMA_HandleTypeDef hdma_usart1_tx; + +/* USART1 init function */ + +void MX_USART1_UART_Init(void) +{ + + /* USER CODE BEGIN USART1_Init 0 */ + + /* USER CODE END USART1_Init 0 */ + + /* USER CODE BEGIN USART1_Init 1 */ + + /* USER CODE END USART1_Init 1 */ + huart1.Instance = USART1; + huart1.Init.BaudRate = 460800; + huart1.Init.WordLength = UART_WORDLENGTH_8B; + huart1.Init.StopBits = UART_STOPBITS_1; + huart1.Init.Parity = UART_PARITY_NONE; + huart1.Init.Mode = UART_MODE_TX_RX; + huart1.Init.HwFlowCtl = UART_HWCONTROL_NONE; + huart1.Init.OverSampling = UART_OVERSAMPLING_16; + if (HAL_UART_Init(&huart1) != HAL_OK) + { + Error_Handler(); + } + /* USER CODE BEGIN USART1_Init 2 */ + + /* USER CODE END USART1_Init 2 */ + +} + +void HAL_UART_MspInit(UART_HandleTypeDef* uartHandle) +{ + + GPIO_InitTypeDef GPIO_InitStruct = {0}; + if(uartHandle->Instance==USART1) + { + /* USER CODE BEGIN USART1_MspInit 0 */ + + /* USER CODE END USART1_MspInit 0 */ + /* USART1 clock enable */ + __HAL_RCC_USART1_CLK_ENABLE(); + + __HAL_RCC_GPIOA_CLK_ENABLE(); + /**USART1 GPIO Configuration + PA9 ------> USART1_TX + PA10 ------> USART1_RX + */ + GPIO_InitStruct.Pin = GPIO_PIN_9|GPIO_PIN_10; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; + GPIO_InitStruct.Alternate = GPIO_AF7_USART1; + HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); + + /* USART1 DMA Init */ + /* USART1_RX Init */ + hdma_usart1_rx.Instance = DMA2_Stream2; + hdma_usart1_rx.Init.Channel = DMA_CHANNEL_4; + hdma_usart1_rx.Init.Direction = DMA_PERIPH_TO_MEMORY; + hdma_usart1_rx.Init.PeriphInc = DMA_PINC_DISABLE; + hdma_usart1_rx.Init.MemInc = DMA_MINC_ENABLE; + hdma_usart1_rx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE; + hdma_usart1_rx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE; + hdma_usart1_rx.Init.Mode = DMA_CIRCULAR; + hdma_usart1_rx.Init.Priority = DMA_PRIORITY_VERY_HIGH; + hdma_usart1_rx.Init.FIFOMode = DMA_FIFOMODE_DISABLE; + if (HAL_DMA_Init(&hdma_usart1_rx) != HAL_OK) + { + Error_Handler(); + } + + __HAL_LINKDMA(uartHandle,hdmarx,hdma_usart1_rx); + + /* USART1_TX Init */ + hdma_usart1_tx.Instance = DMA2_Stream7; + hdma_usart1_tx.Init.Channel = DMA_CHANNEL_4; + hdma_usart1_tx.Init.Direction = DMA_MEMORY_TO_PERIPH; + hdma_usart1_tx.Init.PeriphInc = DMA_PINC_DISABLE; + hdma_usart1_tx.Init.MemInc = DMA_MINC_ENABLE; + hdma_usart1_tx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE; + hdma_usart1_tx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE; + hdma_usart1_tx.Init.Mode = DMA_NORMAL; + hdma_usart1_tx.Init.Priority = DMA_PRIORITY_VERY_HIGH; + hdma_usart1_tx.Init.FIFOMode = DMA_FIFOMODE_DISABLE; + if (HAL_DMA_Init(&hdma_usart1_tx) != HAL_OK) + { + Error_Handler(); + } + + __HAL_LINKDMA(uartHandle,hdmatx,hdma_usart1_tx); + + /* USART1 interrupt Init */ + HAL_NVIC_SetPriority(USART1_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(USART1_IRQn); + /* USER CODE BEGIN USART1_MspInit 1 */ + + /* USER CODE END USART1_MspInit 1 */ + } +} + +void HAL_UART_MspDeInit(UART_HandleTypeDef* uartHandle) +{ + + if(uartHandle->Instance==USART1) + { + /* USER CODE BEGIN USART1_MspDeInit 0 */ + + /* USER CODE END USART1_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_USART1_CLK_DISABLE(); + + /**USART1 GPIO Configuration + PA9 ------> USART1_TX + PA10 ------> USART1_RX + */ + HAL_GPIO_DeInit(GPIOA, GPIO_PIN_9|GPIO_PIN_10); + + /* USART1 DMA DeInit */ + HAL_DMA_DeInit(uartHandle->hdmarx); + HAL_DMA_DeInit(uartHandle->hdmatx); + + /* USART1 interrupt Deinit */ + HAL_NVIC_DisableIRQ(USART1_IRQn); + /* USER CODE BEGIN USART1_MspDeInit 1 */ + + /* USER CODE END USART1_MspDeInit 1 */ + } +} + +/* USER CODE BEGIN 1 */ + +/* USER CODE END 1 */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ci/stm32cube/platformio.ini b/ci/stm32cube/platformio.ini new file mode 100644 index 00000000..2380c62a --- /dev/null +++ b/ci/stm32cube/platformio.ini @@ -0,0 +1,14 @@ +[env:genericSTM32F401RC] +platform = ststm32 +board = genericSTM32F401RC +framework = stm32cube +board_build.stm32cube.custom_config_header = yes +board_microros_transport = serial +lib_deps = + ../../ +debug_tool = stlink +upload_protocol = stlink + +[platformio] +include_dir = Inc +src_dir = Src diff --git a/ci/stm32cube/stm32pio.ini b/ci/stm32cube/stm32pio.ini new file mode 100644 index 00000000..a30c6e89 --- /dev/null +++ b/ci/stm32cube/stm32pio.ini @@ -0,0 +1,18 @@ +[app] +platformio_cmd = platformio +cubemx_cmd = /opt/STM32CubeMX/STM32CubeMX +java_cmd = None + +[project] +cubemx_script_content = config load ${ioc_file_absolute_path} + generate code ${project_dir_absolute_path} + exit +platformio_ini_patch_content = [platformio] + include_dir = Inc + src_dir = Src +board = +ioc_file = STM32F401RC.ioc +cleanup_ignore = STM32F401RC.ioc +cleanup_use_git = False +inspect_ioc = True + From ad2ba7c1a5b2a0eba14c817647248d17fa078c57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C5=82a=C5=BCej=20Sowa?= Date: Wed, 3 Aug 2022 18:51:42 +0200 Subject: [PATCH 09/23] Update CI workflow --- .github/workflows/ci.yml | 67 ++++++++++++++++++++++++++-------------- 1 file changed, 44 insertions(+), 23 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 31a7248d..7e0baba0 100755 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,30 +1,51 @@ name: CI on: - pull_request: - branches: - - '**' + pull_request: + branches: + - "**" jobs: + micro_ros_platformio: + runs-on: ubuntu-20.04 + container: ubuntu:20.04 - micro_ros_platformio: - runs-on: ubuntu-20.04 - container: ubuntu:20.04 + strategy: + fail-fast: false + matrix: + include: + - { framework: arduino, pio-environment: teensy41 } + - { framework: arduino, pio-environment: teensy41 } + - { framework: arduino, pio-environment: teensy40 } + - { framework: arduino, pio-environment: teensy36 } + - { framework: arduino, pio-environment: teensy35 } + - { framework: arduino, pio-environment: teensy31 } + - { framework: arduino, pio-environment: due } + - { framework: arduino, pio-environment: zero } + - { framework: arduino, pio-environment: olimex_e407 } + - { framework: arduino, pio-environment: esp32dev } + - { framework: arduino, pio-environment: nanorp2040connect } + - { framework: arduino, pio-environment: portenta_h7_m7 } + - { framework: arduino, pio-environment: teensy41_eth } + - { framework: arduino, pio-environment: nanorp2040connect_wifi } + - { framework: arduino, pio-environment: portenta_h7_m7_wifi } + - { framework: arduino, pio-environment: esp32dev_wifi } + - { framework: arduino, pio-environment: portenta_h7_m7_galactic } + - { framework: arduino, pio-environment: portenta_h7_m7_foxy } + - { framework: arduino, pio-environment: portenta_h7_m7_rolling } + - { framework: arduino, pio-environment: teensy41_custom } + - { framework: arduino, pio-environment: pico } + - { framework: stm32cube, pio-environment: genericSTM32F401RC } - strategy: - fail-fast: false - matrix: - platform: [teensy41, teensy40, teensy36, teensy35, teensy31, due, zero, olimex_e407, esp32dev, nanorp2040connect, portenta_h7_m7, teensy41_eth, nanorp2040connect_wifi, portenta_h7_m7_wifi, esp32dev_wifi, portenta_h7_m7_galactic, portenta_h7_m7_foxy, portenta_h7_m7_rolling, teensy41_custom, pico] - - steps: - - uses: actions/checkout@v3 - with: - path: repo - - name: Install environment - uses: ./repo/.github/actions/platformio-env - - name: Build - shell: bash - run: | - export PATH=$PATH:~/.platformio/penv/bin - cd repo/ci - pio run -e ${{ matrix.platform }} + steps: + - uses: actions/checkout@v3 + with: + path: repo + - name: Install environment + uses: ./repo/.github/actions/platformio-env + - name: Build + shell: bash + run: | + export PATH=$PATH:~/.platformio/penv/bin + cd repo/ci/${{ matrix.framework }} + pio run -e ${{ matrix.pio-environment }} From 4fecbf72245c45b011f087f09de60eaee34098ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C5=82a=C5=BCej=20Sowa?= Date: Wed, 3 Aug 2022 18:54:41 +0200 Subject: [PATCH 10/23] Remove vscode artifacts --- ci/stm32cube/.vscode/c_cpp_properties.json | 198 --------------------- ci/stm32cube/.vscode/extensions.json | 10 -- ci/stm32cube/.vscode/launch.json | 47 ----- 3 files changed, 255 deletions(-) delete mode 100644 ci/stm32cube/.vscode/c_cpp_properties.json delete mode 100644 ci/stm32cube/.vscode/extensions.json delete mode 100644 ci/stm32cube/.vscode/launch.json diff --git a/ci/stm32cube/.vscode/c_cpp_properties.json b/ci/stm32cube/.vscode/c_cpp_properties.json deleted file mode 100644 index 55dc02f1..00000000 --- a/ci/stm32cube/.vscode/c_cpp_properties.json +++ /dev/null @@ -1,198 +0,0 @@ -// -// !!! WARNING !!! AUTO-GENERATED FILE! -// PLEASE DO NOT MODIFY IT AND USE "platformio.ini": -// https://docs.platformio.org/page/projectconf/section_env_build.html#build-flags -// -{ - "configurations": [ - { - "name": "PlatformIO", - "includePath": [ - "/home/blazej/lazik/leo/leocore_firmware_ros2/Lib/micro_ros_platformio/ci/stm32cube/Inc", - "/home/blazej/lazik/leo/leocore_firmware_ros2/Lib/micro_ros_platformio/ci/stm32cube/Src", - "/home/blazej/lazik/leo/leocore_firmware_ros2/Lib/micro_ros_platformio/ci/stm32cube/.pio/libdeps/genericSTM32F401RC/micro_ros_platformio", - "/home/blazej/lazik/leo/leocore_firmware_ros2/Lib/micro_ros_platformio/ci/stm32cube/.pio/libdeps/genericSTM32F401RC/micro_ros_platformio/libmicroros/include", - "/home/blazej/lazik/leo/leocore_firmware_ros2/Lib/micro_ros_platformio/ci/stm32cube/.pio/libdeps/genericSTM32F401RC/micro_ros_platformio/platform_code", - "/home/blazej/lazik/leo/leocore_firmware_ros2/Lib/micro_ros_platformio/ci/stm32cube/.pio/libdeps/genericSTM32F401RC/micro_ros_platformio/platform_code/stm32cube/serial", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/CMSIS/Include", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/CMSIS/Device/ST/STM32F4xx/Include", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/STM32F4xx_HAL_Driver/Inc", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/STM32F4xx_HAL_Driver/Src", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/CMSIS/DSP/Include", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/n25q128a", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/nt35510", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/lsm303dlhc", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/ls016b8uy", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/ov2640", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/n25q256a", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/ampire480272", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/i3g4250d", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/lsm303agr", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/ili9341", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/st7735", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/stmpe1600", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/ts3510", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/n25q512a", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/Common", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/lis3dsh", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/otm8009a", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/cs43l22", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/l3gd20", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/exc7200", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/mfxstm32l152", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/lis302dl", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/stmpe811", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/wm8994", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/st7789h2", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/ft6x06", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/ampire640480", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/s5k5cag", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/ili9325", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/ov5640", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/s25fl512s", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Adafruit_Shield", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Utilities/CPU", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Utilities/Log", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Utilities/Fonts", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Core/Inc", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Core/Src", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/MSC/Inc", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/MSC/Src", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/DFU/Inc", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/DFU/Src", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/CDC_ECM/Inc", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/CDC_ECM/Src", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/AUDIO/Inc", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/AUDIO/Src", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/CDC_RNDIS/Inc", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/CDC_RNDIS/Src", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/BillBoard/Inc", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/BillBoard/Src", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/CustomHID/Inc", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/CustomHID/Src", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/VIDEO/Inc", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/VIDEO/Src", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Src", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/HID/Inc", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/HID/Src", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Host_Library/Core/Inc", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Host_Library/Core/Src", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Host_Library/Class/MSC/Inc", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Host_Library/Class/MSC/Src", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Host_Library/Class/AUDIO/Inc", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Host_Library/Class/AUDIO/Src", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Host_Library/Class/MTP/Inc", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Host_Library/Class/MTP/Src", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Host_Library/Class/CDC/Inc", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Host_Library/Class/CDC/Src", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Host_Library/Class/HID/Inc", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Host_Library/Class/HID/Src", - "" - ], - "browse": { - "limitSymbolsToIncludedHeaders": true, - "path": [ - "/home/blazej/lazik/leo/leocore_firmware_ros2/Lib/micro_ros_platformio/ci/stm32cube/Inc", - "/home/blazej/lazik/leo/leocore_firmware_ros2/Lib/micro_ros_platformio/ci/stm32cube/Src", - "/home/blazej/lazik/leo/leocore_firmware_ros2/Lib/micro_ros_platformio/ci/stm32cube/.pio/libdeps/genericSTM32F401RC/micro_ros_platformio", - "/home/blazej/lazik/leo/leocore_firmware_ros2/Lib/micro_ros_platformio/ci/stm32cube/.pio/libdeps/genericSTM32F401RC/micro_ros_platformio/libmicroros/include", - "/home/blazej/lazik/leo/leocore_firmware_ros2/Lib/micro_ros_platformio/ci/stm32cube/.pio/libdeps/genericSTM32F401RC/micro_ros_platformio/platform_code", - "/home/blazej/lazik/leo/leocore_firmware_ros2/Lib/micro_ros_platformio/ci/stm32cube/.pio/libdeps/genericSTM32F401RC/micro_ros_platformio/platform_code/stm32cube/serial", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/CMSIS/Include", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/CMSIS/Device/ST/STM32F4xx/Include", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/STM32F4xx_HAL_Driver/Inc", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/STM32F4xx_HAL_Driver/Src", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/CMSIS/DSP/Include", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/n25q128a", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/nt35510", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/lsm303dlhc", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/ls016b8uy", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/ov2640", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/n25q256a", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/ampire480272", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/i3g4250d", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/lsm303agr", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/ili9341", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/st7735", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/stmpe1600", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/ts3510", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/n25q512a", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/Common", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/lis3dsh", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/otm8009a", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/cs43l22", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/l3gd20", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/exc7200", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/mfxstm32l152", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/lis302dl", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/stmpe811", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/wm8994", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/st7789h2", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/ft6x06", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/ampire640480", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/s5k5cag", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/ili9325", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/ov5640", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Components/s25fl512s", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Drivers/BSP/Adafruit_Shield", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Utilities/CPU", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Utilities/Log", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Utilities/Fonts", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Core/Inc", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Core/Src", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/MSC/Inc", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/MSC/Src", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/DFU/Inc", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/DFU/Src", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/CDC_ECM/Inc", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/CDC_ECM/Src", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/AUDIO/Inc", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/AUDIO/Src", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/CDC_RNDIS/Inc", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/CDC_RNDIS/Src", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/BillBoard/Inc", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/BillBoard/Src", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/CustomHID/Inc", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/CustomHID/Src", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/VIDEO/Inc", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/VIDEO/Src", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Src", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/HID/Inc", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Device_Library/Class/HID/Src", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Host_Library/Core/Inc", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Host_Library/Core/Src", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Host_Library/Class/MSC/Inc", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Host_Library/Class/MSC/Src", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Host_Library/Class/AUDIO/Inc", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Host_Library/Class/AUDIO/Src", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Host_Library/Class/MTP/Inc", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Host_Library/Class/MTP/Src", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Host_Library/Class/CDC/Inc", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Host_Library/Class/CDC/Src", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Host_Library/Class/HID/Inc", - "/home/blazej/.platformio/packages/framework-stm32cubef4/Middlewares/ST/STM32_USB_Host_Library/Class/HID/Src", - "" - ] - }, - "defines": [ - "PLATFORMIO=60103", - "STM32F401xC", - "STM32F4xx", - "USE_HAL_DRIVER", - "F_CPU=84000000L", - "MICRO_ROS_TRANSPORT_STM32CUBE_SERIAL=1", - "MICRO_ROS_DISTRO_HUMBLE =1", - "" - ], - "compilerPath": "/home/blazej/.platformio/packages/toolchain-gccarmnoneeabi@1.70201.0/bin/arm-none-eabi-gcc", - "compilerArgs": [ - "-mthumb", - "-mcpu=cortex-m4", - "" - ] - } - ], - "version": 4 -} diff --git a/ci/stm32cube/.vscode/extensions.json b/ci/stm32cube/.vscode/extensions.json deleted file mode 100644 index 080e70d0..00000000 --- a/ci/stm32cube/.vscode/extensions.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - // See http://go.microsoft.com/fwlink/?LinkId=827846 - // for the documentation about the extensions.json format - "recommendations": [ - "platformio.platformio-ide" - ], - "unwantedRecommendations": [ - "ms-vscode.cpptools-extension-pack" - ] -} diff --git a/ci/stm32cube/.vscode/launch.json b/ci/stm32cube/.vscode/launch.json deleted file mode 100644 index 53b0a953..00000000 --- a/ci/stm32cube/.vscode/launch.json +++ /dev/null @@ -1,47 +0,0 @@ -// AUTOMATICALLY GENERATED FILE. PLEASE DO NOT MODIFY IT MANUALLY -// -// PIO Unified Debugger -// -// Documentation: https://docs.platformio.org/page/plus/debugging.html -// Configuration: https://docs.platformio.org/page/projectconf/section_env_debug.html - -{ - "version": "0.2.0", - "configurations": [ - { - "type": "platformio-debug", - "request": "launch", - "name": "PIO Debug", - "executable": "/home/blazej/lazik/leo/leocore_firmware_ros2/Lib/micro_ros_platformio/ci/stm32cube/.pio/build/genericSTM32F401RC/firmware.elf", - "projectEnvName": "genericSTM32F401RC", - "toolchainBinDir": "/home/blazej/.platformio/packages/toolchain-gccarmnoneeabi@1.70201.0/bin", - "internalConsoleOptions": "openOnSessionStart", - "svdPath": "/home/blazej/.platformio/platforms/ststm32/misc/svd/STM32F401x.svd", - "preLaunchTask": { - "type": "PlatformIO", - "task": "Pre-Debug" - } - }, - { - "type": "platformio-debug", - "request": "launch", - "name": "PIO Debug (skip Pre-Debug)", - "executable": "/home/blazej/lazik/leo/leocore_firmware_ros2/Lib/micro_ros_platformio/ci/stm32cube/.pio/build/genericSTM32F401RC/firmware.elf", - "projectEnvName": "genericSTM32F401RC", - "toolchainBinDir": "/home/blazej/.platformio/packages/toolchain-gccarmnoneeabi@1.70201.0/bin", - "internalConsoleOptions": "openOnSessionStart", - "svdPath": "/home/blazej/.platformio/platforms/ststm32/misc/svd/STM32F401x.svd" - }, - { - "type": "platformio-debug", - "request": "launch", - "name": "PIO Debug (without uploading)", - "executable": "/home/blazej/lazik/leo/leocore_firmware_ros2/Lib/micro_ros_platformio/ci/stm32cube/.pio/build/genericSTM32F401RC/firmware.elf", - "projectEnvName": "genericSTM32F401RC", - "toolchainBinDir": "/home/blazej/.platformio/packages/toolchain-gccarmnoneeabi@1.70201.0/bin", - "internalConsoleOptions": "openOnSessionStart", - "svdPath": "/home/blazej/.platformio/platforms/ststm32/misc/svd/STM32F401x.svd", - "loadMode": "manual" - } - ] -} From 2975d2f009df53ea5addce299e88fdc66bf0689e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C5=82a=C5=BCej=20Sowa?= Date: Thu, 4 Aug 2022 16:52:20 +0200 Subject: [PATCH 11/23] Install and use CubeMX to generate code --- .github/workflows/ci.yml | 103 ++++-- ci/stm32cube/Inc/dma.h | 52 --- ci/stm32cube/Inc/gpio.h | 49 --- ci/stm32cube/Inc/main.h | 71 ---- ci/stm32cube/Inc/stm32f4xx_hal_conf.h | 492 -------------------------- ci/stm32cube/Inc/stm32f4xx_it.h | 72 ---- ci/stm32cube/Inc/usart.h | 52 --- ci/stm32cube/Src/dma.c | 58 --- ci/stm32cube/Src/gpio.c | 54 --- ci/stm32cube/Src/main.c | 155 -------- ci/stm32cube/Src/stm32f4xx_hal_msp.c | 84 ----- ci/stm32cube/Src/stm32f4xx_it.c | 249 ------------- ci/stm32cube/Src/usart.c | 164 --------- ci/stm32cube/stm32pio.ini | 18 +- 14 files changed, 79 insertions(+), 1594 deletions(-) delete mode 100644 ci/stm32cube/Inc/dma.h delete mode 100644 ci/stm32cube/Inc/gpio.h delete mode 100644 ci/stm32cube/Inc/main.h delete mode 100644 ci/stm32cube/Inc/stm32f4xx_hal_conf.h delete mode 100644 ci/stm32cube/Inc/stm32f4xx_it.h delete mode 100644 ci/stm32cube/Inc/usart.h delete mode 100644 ci/stm32cube/Src/dma.c delete mode 100644 ci/stm32cube/Src/gpio.c delete mode 100644 ci/stm32cube/Src/stm32f4xx_hal_msp.c delete mode 100644 ci/stm32cube/Src/stm32f4xx_it.c delete mode 100644 ci/stm32cube/Src/usart.c diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7e0baba0..88e3096f 100755 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,51 +1,104 @@ name: CI on: + workflow_dispatch: pull_request: branches: - "**" jobs: - micro_ros_platformio: + # micro_ros_platformio_arduino: + # runs-on: ubuntu-20.04 + # container: ubuntu:20.04 + + # strategy: + # fail-fast: false + # matrix: + # pio-environment: + # - teensy41 + # - teensy41 + # - teensy40 + # - teensy36 + # - teensy35 + # - teensy31 + # - due + # - zero + # - olimex_e407 + # - esp32dev + # - nanorp2040connect + # - portenta_h7_m7 + # - teensy41_eth + # - nanorp2040connect_wifi + # - portenta_h7_m7_wifi + # - esp32dev_wifi + # - portenta_h7_m7_galactic + # - portenta_h7_m7_foxy + # - portenta_h7_m7_rolling + # - teensy41_custom + # - pico + + # steps: + # - uses: actions/checkout@v3 + # with: + # path: repo + # - name: Install environment + # uses: ./repo/.github/actions/platformio-env + # - name: Build + # shell: bash + # run: | + # export PATH=$PATH:~/.platformio/penv/bin + # cd repo/ci/arduino + # pio run -e ${{ matrix.pio-environment }} + + micro_ros_platformio_stm32cube: runs-on: ubuntu-20.04 container: ubuntu:20.04 strategy: fail-fast: false matrix: - include: - - { framework: arduino, pio-environment: teensy41 } - - { framework: arduino, pio-environment: teensy41 } - - { framework: arduino, pio-environment: teensy40 } - - { framework: arduino, pio-environment: teensy36 } - - { framework: arduino, pio-environment: teensy35 } - - { framework: arduino, pio-environment: teensy31 } - - { framework: arduino, pio-environment: due } - - { framework: arduino, pio-environment: zero } - - { framework: arduino, pio-environment: olimex_e407 } - - { framework: arduino, pio-environment: esp32dev } - - { framework: arduino, pio-environment: nanorp2040connect } - - { framework: arduino, pio-environment: portenta_h7_m7 } - - { framework: arduino, pio-environment: teensy41_eth } - - { framework: arduino, pio-environment: nanorp2040connect_wifi } - - { framework: arduino, pio-environment: portenta_h7_m7_wifi } - - { framework: arduino, pio-environment: esp32dev_wifi } - - { framework: arduino, pio-environment: portenta_h7_m7_galactic } - - { framework: arduino, pio-environment: portenta_h7_m7_foxy } - - { framework: arduino, pio-environment: portenta_h7_m7_rolling } - - { framework: arduino, pio-environment: teensy41_custom } - - { framework: arduino, pio-environment: pico } - - { framework: stm32cube, pio-environment: genericSTM32F401RC } + pio-environment: + - genericSTM32F401RC steps: - uses: actions/checkout@v3 with: path: repo + - name: Install STM32CubeMX + env: + CUBEMX_LINK: http://files.fictionlab.pl/en.stm32cubemx-lin_v6-3-0.zip + run: | + apt update + export DEBIAN_FRONTEND=noninteractive + apt install -y wget unzip python3-pip expect fontconfig xvfb libxrender1 libxtst6 libxi6 + wget -q -O cubemx.zip $CUBEMX_LINK + unzip -q cubemx.zip -d cubemx + expect -f - <
© Copyright (c) 2022 STMicroelectronics. - * All rights reserved.
- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __DMA_H__ -#define __DMA_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" - -/* DMA memory to memory transfer handles -------------------------------------*/ - -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -/* USER CODE BEGIN Private defines */ - -/* USER CODE END Private defines */ - -void MX_DMA_Init(void); - -/* USER CODE BEGIN Prototypes */ - -/* USER CODE END Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif /* __DMA_H__ */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ci/stm32cube/Inc/gpio.h b/ci/stm32cube/Inc/gpio.h deleted file mode 100644 index 1fa69006..00000000 --- a/ci/stm32cube/Inc/gpio.h +++ /dev/null @@ -1,49 +0,0 @@ -/** - ****************************************************************************** - * @file gpio.h - * @brief This file contains all the function prototypes for - * the gpio.c file - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2022 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __GPIO_H__ -#define __GPIO_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" - -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -/* USER CODE BEGIN Private defines */ - -/* USER CODE END Private defines */ - -void MX_GPIO_Init(void); - -/* USER CODE BEGIN Prototypes */ - -/* USER CODE END Prototypes */ - -#ifdef __cplusplus -} -#endif -#endif /*__ GPIO_H__ */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ci/stm32cube/Inc/main.h b/ci/stm32cube/Inc/main.h deleted file mode 100644 index edfdf455..00000000 --- a/ci/stm32cube/Inc/main.h +++ /dev/null @@ -1,71 +0,0 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file : main.h - * @brief : Header for main.c file. - * This file contains the common defines of the application. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2022 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __MAIN_H -#define __MAIN_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "stm32f4xx_hal.h" - -/* Private includes ----------------------------------------------------------*/ -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -/* Exported types ------------------------------------------------------------*/ -/* USER CODE BEGIN ET */ - -/* USER CODE END ET */ - -/* Exported constants --------------------------------------------------------*/ -/* USER CODE BEGIN EC */ - -/* USER CODE END EC */ - -/* Exported macro ------------------------------------------------------------*/ -/* USER CODE BEGIN EM */ - -/* USER CODE END EM */ - -/* Exported functions prototypes ---------------------------------------------*/ -void Error_Handler(void); - -/* USER CODE BEGIN EFP */ - -/* USER CODE END EFP */ - -/* Private defines -----------------------------------------------------------*/ -/* USER CODE BEGIN Private defines */ - -/* USER CODE END Private defines */ - -#ifdef __cplusplus -} -#endif - -#endif /* __MAIN_H */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ci/stm32cube/Inc/stm32f4xx_hal_conf.h b/ci/stm32cube/Inc/stm32f4xx_hal_conf.h deleted file mode 100644 index b13cce81..00000000 --- a/ci/stm32cube/Inc/stm32f4xx_hal_conf.h +++ /dev/null @@ -1,492 +0,0 @@ -/** - ****************************************************************************** - * @file stm32f4xx_hal_conf_template.h - * @author MCD Application Team - * @brief HAL configuration template file. - * This file should be copied to the application folder and renamed - * to stm32f4xx_hal_conf.h. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2017 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32F4xx_HAL_CONF_H -#define __STM32F4xx_HAL_CONF_H - -#ifdef __cplusplus - extern "C" { -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ - -/* ########################## Module Selection ############################## */ -/** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED - - /* #define HAL_ADC_MODULE_ENABLED */ -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_CAN_MODULE_ENABLED */ -/* #define HAL_CRC_MODULE_ENABLED */ -/* #define HAL_CAN_LEGACY_MODULE_ENABLED */ -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_DAC_MODULE_ENABLED */ -/* #define HAL_DCMI_MODULE_ENABLED */ -/* #define HAL_DMA2D_MODULE_ENABLED */ -/* #define HAL_ETH_MODULE_ENABLED */ -/* #define HAL_NAND_MODULE_ENABLED */ -/* #define HAL_NOR_MODULE_ENABLED */ -/* #define HAL_PCCARD_MODULE_ENABLED */ -/* #define HAL_SRAM_MODULE_ENABLED */ -/* #define HAL_SDRAM_MODULE_ENABLED */ -/* #define HAL_HASH_MODULE_ENABLED */ -/* #define HAL_I2C_MODULE_ENABLED */ -/* #define HAL_I2S_MODULE_ENABLED */ -/* #define HAL_IWDG_MODULE_ENABLED */ -/* #define HAL_LTDC_MODULE_ENABLED */ -/* #define HAL_RNG_MODULE_ENABLED */ -/* #define HAL_RTC_MODULE_ENABLED */ -/* #define HAL_SAI_MODULE_ENABLED */ -/* #define HAL_SD_MODULE_ENABLED */ -/* #define HAL_MMC_MODULE_ENABLED */ -/* #define HAL_SPI_MODULE_ENABLED */ -/* #define HAL_TIM_MODULE_ENABLED */ -#define HAL_UART_MODULE_ENABLED -/* #define HAL_USART_MODULE_ENABLED */ -/* #define HAL_IRDA_MODULE_ENABLED */ -/* #define HAL_SMARTCARD_MODULE_ENABLED */ -/* #define HAL_SMBUS_MODULE_ENABLED */ -/* #define HAL_WWDG_MODULE_ENABLED */ -/* #define HAL_PCD_MODULE_ENABLED */ -/* #define HAL_HCD_MODULE_ENABLED */ -/* #define HAL_DSI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_CEC_MODULE_ENABLED */ -/* #define HAL_FMPI2C_MODULE_ENABLED */ -/* #define HAL_FMPSMBUS_MODULE_ENABLED */ -/* #define HAL_SPDIFRX_MODULE_ENABLED */ -/* #define HAL_DFSDM_MODULE_ENABLED */ -/* #define HAL_LPTIM_MODULE_ENABLED */ -#define HAL_GPIO_MODULE_ENABLED -#define HAL_EXTI_MODULE_ENABLED -#define HAL_DMA_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED -#define HAL_FLASH_MODULE_ENABLED -#define HAL_PWR_MODULE_ENABLED -#define HAL_CORTEX_MODULE_ENABLED - -/* ########################## HSE/HSI Values adaptation ##################### */ -/** - * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). - */ -#if !defined (HSE_VALUE) - #define HSE_VALUE 8000000U /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined (HSE_STARTUP_TIMEOUT) - #define HSE_STARTUP_TIMEOUT 100U /*!< Time out for HSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief Internal High Speed oscillator (HSI) value. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). - */ -#if !defined (HSI_VALUE) - #define HSI_VALUE ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @brief Internal Low Speed oscillator (LSI) value. - */ -#if !defined (LSI_VALUE) - #define LSI_VALUE 32000U /*!< LSI Typical Value in Hz*/ -#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz - The real value may vary depending on the variations - in voltage and temperature.*/ -/** - * @brief External Low Speed oscillator (LSE) value. - */ -#if !defined (LSE_VALUE) - #define LSE_VALUE 32768U /*!< Value of the External Low Speed oscillator in Hz */ -#endif /* LSE_VALUE */ - -#if !defined (LSE_STARTUP_TIMEOUT) - #define LSE_STARTUP_TIMEOUT 5000U /*!< Time out for LSE start up, in ms */ -#endif /* LSE_STARTUP_TIMEOUT */ - -/** - * @brief External clock source for I2S peripheral - * This value is used by the I2S HAL module to compute the I2S clock source - * frequency, this source is inserted directly through I2S_CKIN pad. - */ -#if !defined (EXTERNAL_CLOCK_VALUE) - #define EXTERNAL_CLOCK_VALUE 12288000U /*!< Value of the External audio frequency in Hz*/ -#endif /* EXTERNAL_CLOCK_VALUE */ - -/* Tip: To avoid modifying this file each time you need to use different HSE, - === you can define the HSE value in your toolchain compiler preprocessor. */ - -/* ########################### System Configuration ######################### */ -/** - * @brief This is the HAL system configuration section - */ -#define VDD_VALUE 3300U /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY 15U /*!< tick interrupt priority */ -#define USE_RTOS 0U -#define PREFETCH_ENABLE 1U -#define INSTRUCTION_CACHE_ENABLE 1U -#define DATA_CACHE_ENABLE 1U - -#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */ -#define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */ -#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */ -#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U /* CRYP register callback disabled */ -#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */ -#define USE_HAL_DCMI_REGISTER_CALLBACKS 0U /* DCMI register callback disabled */ -#define USE_HAL_DFSDM_REGISTER_CALLBACKS 0U /* DFSDM register callback disabled */ -#define USE_HAL_DMA2D_REGISTER_CALLBACKS 0U /* DMA2D register callback disabled */ -#define USE_HAL_DSI_REGISTER_CALLBACKS 0U /* DSI register callback disabled */ -#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */ -#define USE_HAL_HASH_REGISTER_CALLBACKS 0U /* HASH register callback disabled */ -#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */ -#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */ -#define USE_HAL_FMPI2C_REGISTER_CALLBACKS 0U /* FMPI2C register callback disabled */ -#define USE_HAL_FMPSMBUS_REGISTER_CALLBACKS 0U /* FMPSMBUS register callback disabled */ -#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */ -#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */ -#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U /* LPTIM register callback disabled */ -#define USE_HAL_LTDC_REGISTER_CALLBACKS 0U /* LTDC register callback disabled */ -#define USE_HAL_MMC_REGISTER_CALLBACKS 0U /* MMC register callback disabled */ -#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */ -#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */ -#define USE_HAL_PCCARD_REGISTER_CALLBACKS 0U /* PCCARD register callback disabled */ -#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */ -#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U /* QSPI register callback disabled */ -#define USE_HAL_RNG_REGISTER_CALLBACKS 0U /* RNG register callback disabled */ -#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */ -#define USE_HAL_SAI_REGISTER_CALLBACKS 0U /* SAI register callback disabled */ -#define USE_HAL_SD_REGISTER_CALLBACKS 0U /* SD register callback disabled */ -#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */ -#define USE_HAL_SDRAM_REGISTER_CALLBACKS 0U /* SDRAM register callback disabled */ -#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */ -#define USE_HAL_SPDIFRX_REGISTER_CALLBACKS 0U /* SPDIFRX register callback disabled */ -#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */ -#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */ -#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */ -#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */ -#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */ -#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */ - -/* ########################## Assert Selection ############################## */ -/** - * @brief Uncomment the line below to expanse the "assert_param" macro in the - * HAL drivers code - */ -/* #define USE_FULL_ASSERT 1U */ - -/* ################## Ethernet peripheral configuration ##################### */ - -/* Section 1 : Ethernet peripheral configuration */ - -/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ -#define MAC_ADDR0 2U -#define MAC_ADDR1 0U -#define MAC_ADDR2 0U -#define MAC_ADDR3 0U -#define MAC_ADDR4 0U -#define MAC_ADDR5 0U - -/* Definition of the Ethernet driver buffers size and count */ -#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ -#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ -#define ETH_RXBUFNB 4U /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ -#define ETH_TXBUFNB 4U /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ - -/* Section 2: PHY configuration section */ - -/* DP83848_PHY_ADDRESS Address*/ -#define DP83848_PHY_ADDRESS 0x01U -/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ -#define PHY_RESET_DELAY 0x000000FFU -/* PHY Configuration delay */ -#define PHY_CONFIG_DELAY 0x00000FFFU - -#define PHY_READ_TO 0x0000FFFFU -#define PHY_WRITE_TO 0x0000FFFFU - -/* Section 3: Common PHY Registers */ - -#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ -#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ - -#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ -#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ -#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ -#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ -#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ -#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ -#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ -#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ -#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ -#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ - -#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ -#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ -#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ - -/* Section 4: Extended PHY Registers */ -#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ - -#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ -#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ - -/* ################## SPI peripheral configuration ########################## */ - -/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver -* Activated: CRC code is present inside driver -* Deactivated: CRC code cleaned from driver -*/ - -#define USE_SPI_CRC 0U - -/* Includes ------------------------------------------------------------------*/ -/** - * @brief Include module's header file - */ - -#ifdef HAL_RCC_MODULE_ENABLED - #include "stm32f4xx_hal_rcc.h" -#endif /* HAL_RCC_MODULE_ENABLED */ - -#ifdef HAL_GPIO_MODULE_ENABLED - #include "stm32f4xx_hal_gpio.h" -#endif /* HAL_GPIO_MODULE_ENABLED */ - -#ifdef HAL_EXTI_MODULE_ENABLED - #include "stm32f4xx_hal_exti.h" -#endif /* HAL_EXTI_MODULE_ENABLED */ - -#ifdef HAL_DMA_MODULE_ENABLED - #include "stm32f4xx_hal_dma.h" -#endif /* HAL_DMA_MODULE_ENABLED */ - -#ifdef HAL_CORTEX_MODULE_ENABLED - #include "stm32f4xx_hal_cortex.h" -#endif /* HAL_CORTEX_MODULE_ENABLED */ - -#ifdef HAL_ADC_MODULE_ENABLED - #include "stm32f4xx_hal_adc.h" -#endif /* HAL_ADC_MODULE_ENABLED */ - -#ifdef HAL_CAN_MODULE_ENABLED - #include "stm32f4xx_hal_can.h" -#endif /* HAL_CAN_MODULE_ENABLED */ - -#ifdef HAL_CAN_LEGACY_MODULE_ENABLED - #include "stm32f4xx_hal_can_legacy.h" -#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */ - -#ifdef HAL_CRC_MODULE_ENABLED - #include "stm32f4xx_hal_crc.h" -#endif /* HAL_CRC_MODULE_ENABLED */ - -#ifdef HAL_CRYP_MODULE_ENABLED - #include "stm32f4xx_hal_cryp.h" -#endif /* HAL_CRYP_MODULE_ENABLED */ - -#ifdef HAL_DMA2D_MODULE_ENABLED - #include "stm32f4xx_hal_dma2d.h" -#endif /* HAL_DMA2D_MODULE_ENABLED */ - -#ifdef HAL_DAC_MODULE_ENABLED - #include "stm32f4xx_hal_dac.h" -#endif /* HAL_DAC_MODULE_ENABLED */ - -#ifdef HAL_DCMI_MODULE_ENABLED - #include "stm32f4xx_hal_dcmi.h" -#endif /* HAL_DCMI_MODULE_ENABLED */ - -#ifdef HAL_ETH_MODULE_ENABLED - #include "stm32f4xx_hal_eth.h" -#endif /* HAL_ETH_MODULE_ENABLED */ - -#ifdef HAL_FLASH_MODULE_ENABLED - #include "stm32f4xx_hal_flash.h" -#endif /* HAL_FLASH_MODULE_ENABLED */ - -#ifdef HAL_SRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sram.h" -#endif /* HAL_SRAM_MODULE_ENABLED */ - -#ifdef HAL_NOR_MODULE_ENABLED - #include "stm32f4xx_hal_nor.h" -#endif /* HAL_NOR_MODULE_ENABLED */ - -#ifdef HAL_NAND_MODULE_ENABLED - #include "stm32f4xx_hal_nand.h" -#endif /* HAL_NAND_MODULE_ENABLED */ - -#ifdef HAL_PCCARD_MODULE_ENABLED - #include "stm32f4xx_hal_pccard.h" -#endif /* HAL_PCCARD_MODULE_ENABLED */ - -#ifdef HAL_SDRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sdram.h" -#endif /* HAL_SDRAM_MODULE_ENABLED */ - -#ifdef HAL_HASH_MODULE_ENABLED - #include "stm32f4xx_hal_hash.h" -#endif /* HAL_HASH_MODULE_ENABLED */ - -#ifdef HAL_I2C_MODULE_ENABLED - #include "stm32f4xx_hal_i2c.h" -#endif /* HAL_I2C_MODULE_ENABLED */ - -#ifdef HAL_SMBUS_MODULE_ENABLED - #include "stm32f4xx_hal_smbus.h" -#endif /* HAL_SMBUS_MODULE_ENABLED */ - -#ifdef HAL_I2S_MODULE_ENABLED - #include "stm32f4xx_hal_i2s.h" -#endif /* HAL_I2S_MODULE_ENABLED */ - -#ifdef HAL_IWDG_MODULE_ENABLED - #include "stm32f4xx_hal_iwdg.h" -#endif /* HAL_IWDG_MODULE_ENABLED */ - -#ifdef HAL_LTDC_MODULE_ENABLED - #include "stm32f4xx_hal_ltdc.h" -#endif /* HAL_LTDC_MODULE_ENABLED */ - -#ifdef HAL_PWR_MODULE_ENABLED - #include "stm32f4xx_hal_pwr.h" -#endif /* HAL_PWR_MODULE_ENABLED */ - -#ifdef HAL_RNG_MODULE_ENABLED - #include "stm32f4xx_hal_rng.h" -#endif /* HAL_RNG_MODULE_ENABLED */ - -#ifdef HAL_RTC_MODULE_ENABLED - #include "stm32f4xx_hal_rtc.h" -#endif /* HAL_RTC_MODULE_ENABLED */ - -#ifdef HAL_SAI_MODULE_ENABLED - #include "stm32f4xx_hal_sai.h" -#endif /* HAL_SAI_MODULE_ENABLED */ - -#ifdef HAL_SD_MODULE_ENABLED - #include "stm32f4xx_hal_sd.h" -#endif /* HAL_SD_MODULE_ENABLED */ - -#ifdef HAL_SPI_MODULE_ENABLED - #include "stm32f4xx_hal_spi.h" -#endif /* HAL_SPI_MODULE_ENABLED */ - -#ifdef HAL_TIM_MODULE_ENABLED - #include "stm32f4xx_hal_tim.h" -#endif /* HAL_TIM_MODULE_ENABLED */ - -#ifdef HAL_UART_MODULE_ENABLED - #include "stm32f4xx_hal_uart.h" -#endif /* HAL_UART_MODULE_ENABLED */ - -#ifdef HAL_USART_MODULE_ENABLED - #include "stm32f4xx_hal_usart.h" -#endif /* HAL_USART_MODULE_ENABLED */ - -#ifdef HAL_IRDA_MODULE_ENABLED - #include "stm32f4xx_hal_irda.h" -#endif /* HAL_IRDA_MODULE_ENABLED */ - -#ifdef HAL_SMARTCARD_MODULE_ENABLED - #include "stm32f4xx_hal_smartcard.h" -#endif /* HAL_SMARTCARD_MODULE_ENABLED */ - -#ifdef HAL_WWDG_MODULE_ENABLED - #include "stm32f4xx_hal_wwdg.h" -#endif /* HAL_WWDG_MODULE_ENABLED */ - -#ifdef HAL_PCD_MODULE_ENABLED - #include "stm32f4xx_hal_pcd.h" -#endif /* HAL_PCD_MODULE_ENABLED */ - -#ifdef HAL_HCD_MODULE_ENABLED - #include "stm32f4xx_hal_hcd.h" -#endif /* HAL_HCD_MODULE_ENABLED */ - -#ifdef HAL_DSI_MODULE_ENABLED - #include "stm32f4xx_hal_dsi.h" -#endif /* HAL_DSI_MODULE_ENABLED */ - -#ifdef HAL_QSPI_MODULE_ENABLED - #include "stm32f4xx_hal_qspi.h" -#endif /* HAL_QSPI_MODULE_ENABLED */ - -#ifdef HAL_CEC_MODULE_ENABLED - #include "stm32f4xx_hal_cec.h" -#endif /* HAL_CEC_MODULE_ENABLED */ - -#ifdef HAL_FMPI2C_MODULE_ENABLED - #include "stm32f4xx_hal_fmpi2c.h" -#endif /* HAL_FMPI2C_MODULE_ENABLED */ - -#ifdef HAL_FMPSMBUS_MODULE_ENABLED - #include "stm32f4xx_hal_fmpsmbus.h" -#endif /* HAL_FMPSMBUS_MODULE_ENABLED */ - -#ifdef HAL_SPDIFRX_MODULE_ENABLED - #include "stm32f4xx_hal_spdifrx.h" -#endif /* HAL_SPDIFRX_MODULE_ENABLED */ - -#ifdef HAL_DFSDM_MODULE_ENABLED - #include "stm32f4xx_hal_dfsdm.h" -#endif /* HAL_DFSDM_MODULE_ENABLED */ - -#ifdef HAL_LPTIM_MODULE_ENABLED - #include "stm32f4xx_hal_lptim.h" -#endif /* HAL_LPTIM_MODULE_ENABLED */ - -#ifdef HAL_MMC_MODULE_ENABLED - #include "stm32f4xx_hal_mmc.h" -#endif /* HAL_MMC_MODULE_ENABLED */ - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT -/** - * @brief The assert_param macro is used for function's parameters check. - * @param expr If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ - #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) -/* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t* file, uint32_t line); -#else - #define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32F4xx_HAL_CONF_H */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ci/stm32cube/Inc/stm32f4xx_it.h b/ci/stm32cube/Inc/stm32f4xx_it.h deleted file mode 100644 index 368929ba..00000000 --- a/ci/stm32cube/Inc/stm32f4xx_it.h +++ /dev/null @@ -1,72 +0,0 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file stm32f4xx_it.h - * @brief This file contains the headers of the interrupt handlers. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2022 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32F4xx_IT_H -#define __STM32F4xx_IT_H - -#ifdef __cplusplus - extern "C" { -#endif - -/* Private includes ----------------------------------------------------------*/ -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -/* Exported types ------------------------------------------------------------*/ -/* USER CODE BEGIN ET */ - -/* USER CODE END ET */ - -/* Exported constants --------------------------------------------------------*/ -/* USER CODE BEGIN EC */ - -/* USER CODE END EC */ - -/* Exported macro ------------------------------------------------------------*/ -/* USER CODE BEGIN EM */ - -/* USER CODE END EM */ - -/* Exported functions prototypes ---------------------------------------------*/ -void NMI_Handler(void); -void HardFault_Handler(void); -void MemManage_Handler(void); -void BusFault_Handler(void); -void UsageFault_Handler(void); -void SVC_Handler(void); -void DebugMon_Handler(void); -void PendSV_Handler(void); -void SysTick_Handler(void); -void USART1_IRQHandler(void); -void DMA2_Stream2_IRQHandler(void); -void DMA2_Stream7_IRQHandler(void); -/* USER CODE BEGIN EFP */ - -/* USER CODE END EFP */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32F4xx_IT_H */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ci/stm32cube/Inc/usart.h b/ci/stm32cube/Inc/usart.h deleted file mode 100644 index e519d518..00000000 --- a/ci/stm32cube/Inc/usart.h +++ /dev/null @@ -1,52 +0,0 @@ -/** - ****************************************************************************** - * @file usart.h - * @brief This file contains all the function prototypes for - * the usart.c file - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2022 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __USART_H__ -#define __USART_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" - -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -extern UART_HandleTypeDef huart1; - -/* USER CODE BEGIN Private defines */ - -/* USER CODE END Private defines */ - -void MX_USART1_UART_Init(void); - -/* USER CODE BEGIN Prototypes */ - -/* USER CODE END Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif /* __USART_H__ */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ci/stm32cube/Src/dma.c b/ci/stm32cube/Src/dma.c deleted file mode 100644 index 8f6a2e43..00000000 --- a/ci/stm32cube/Src/dma.c +++ /dev/null @@ -1,58 +0,0 @@ -/** - ****************************************************************************** - * @file dma.c - * @brief This file provides code for the configuration - * of all the requested memory to memory DMA transfers. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2022 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Includes ------------------------------------------------------------------*/ -#include "dma.h" - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -/*----------------------------------------------------------------------------*/ -/* Configure DMA */ -/*----------------------------------------------------------------------------*/ - -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ - -/** - * Enable DMA controller clock - */ -void MX_DMA_Init(void) -{ - - /* DMA controller clock enable */ - __HAL_RCC_DMA2_CLK_ENABLE(); - - /* DMA interrupt init */ - /* DMA2_Stream2_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(DMA2_Stream2_IRQn, 5, 0); - HAL_NVIC_EnableIRQ(DMA2_Stream2_IRQn); - /* DMA2_Stream7_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(DMA2_Stream7_IRQn, 5, 0); - HAL_NVIC_EnableIRQ(DMA2_Stream7_IRQn); - -} - -/* USER CODE BEGIN 2 */ - -/* USER CODE END 2 */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ci/stm32cube/Src/gpio.c b/ci/stm32cube/Src/gpio.c deleted file mode 100644 index ba1f675a..00000000 --- a/ci/stm32cube/Src/gpio.c +++ /dev/null @@ -1,54 +0,0 @@ -/** - ****************************************************************************** - * @file gpio.c - * @brief This file provides code for the configuration - * of all used GPIO pins. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2022 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Includes ------------------------------------------------------------------*/ -#include "gpio.h" - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -/*----------------------------------------------------------------------------*/ -/* Configure GPIO */ -/*----------------------------------------------------------------------------*/ -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ - -/** Configure pins as - * Analog - * Input - * Output - * EVENT_OUT - * EXTI -*/ -void MX_GPIO_Init(void) -{ - - /* GPIO Ports Clock Enable */ - __HAL_RCC_GPIOH_CLK_ENABLE(); - __HAL_RCC_GPIOA_CLK_ENABLE(); - -} - -/* USER CODE BEGIN 2 */ - -/* USER CODE END 2 */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ci/stm32cube/Src/main.c b/ci/stm32cube/Src/main.c index 7ebd5b95..eaa28065 100644 --- a/ci/stm32cube/Src/main.c +++ b/ci/stm32cube/Src/main.c @@ -1,29 +1,3 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file : main.c - * @brief : Main program body - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2022 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ -/* USER CODE END Header */ -/* Includes ------------------------------------------------------------------*/ -#include "main.h" -#include "dma.h" -#include "usart.h" -#include "gpio.h" - -/* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include @@ -36,12 +10,6 @@ #include /* USER CODE END Includes */ -/* Private typedef -----------------------------------------------------------*/ -/* USER CODE BEGIN PTD */ - -/* USER CODE END PTD */ - -/* Private define ------------------------------------------------------------*/ /* USER CODE BEGIN PD */ #define RCCHECK(fn) \ { \ @@ -58,13 +26,6 @@ } /* USER CODE END PD */ -/* Private macro -------------------------------------------------------------*/ -/* USER CODE BEGIN PM */ - -/* USER CODE END PM */ - -/* Private variables ---------------------------------------------------------*/ - /* USER CODE BEGIN PV */ static rcl_publisher_t publisher; static std_msgs__msg__Int32 msg; @@ -85,13 +46,6 @@ static struct DMAStream stream = { }; /* USER CODE END PV */ -/* Private function prototypes -----------------------------------------------*/ -void SystemClock_Config(void); -/* USER CODE BEGIN PFP */ - -/* USER CODE END PFP */ - -/* Private user code ---------------------------------------------------------*/ /* USER CODE BEGIN 0 */ void timer_callback(rcl_timer_t* timer, int64_t last_call_time) { RCLC_UNUSED(last_call_time); @@ -108,36 +62,8 @@ void HAL_UART_TxCpltCallback(UART_HandleTypeDef* huart) { } /* USER CODE END 0 */ -/** - * @brief The application entry point. - * @retval int - */ int main(void) { - /* USER CODE BEGIN 1 */ - - /* USER CODE END 1 */ - - /* MCU Configuration--------------------------------------------------------*/ - - /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ - HAL_Init(); - - /* USER CODE BEGIN Init */ - - /* USER CODE END Init */ - - /* Configure the system clock */ - SystemClock_Config(); - - /* USER CODE BEGIN SysInit */ - - /* USER CODE END SysInit */ - - /* Initialize all configured peripherals */ - MX_GPIO_Init(); - MX_DMA_Init(); - MX_USART1_UART_Init(); /* USER CODE BEGIN 2 */ set_microros_serial_transports(&stream); @@ -176,84 +102,3 @@ int main(void) } /* USER CODE END 3 */ } - -/** - * @brief System Clock Configuration - * @retval None - */ -void SystemClock_Config(void) -{ - RCC_OscInitTypeDef RCC_OscInitStruct = {0}; - RCC_ClkInitTypeDef RCC_ClkInitStruct = {0}; - - /** Configure the main internal regulator output voltage - */ - __HAL_RCC_PWR_CLK_ENABLE(); - __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE2); - /** Initializes the RCC Oscillators according to the specified parameters - * in the RCC_OscInitTypeDef structure. - */ - RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; - RCC_OscInitStruct.HSEState = RCC_HSE_ON; - RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; - RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; - RCC_OscInitStruct.PLL.PLLM = 8; - RCC_OscInitStruct.PLL.PLLN = 168; - RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; - RCC_OscInitStruct.PLL.PLLQ = 4; - if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) - { - Error_Handler(); - } - /** Initializes the CPU, AHB and APB buses clocks - */ - RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK - |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2; - RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; - RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; - RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2; - RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; - - if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK) - { - Error_Handler(); - } -} - -/* USER CODE BEGIN 4 */ - -/* USER CODE END 4 */ - -/** - * @brief This function is executed in case of error occurrence. - * @retval None - */ -void Error_Handler(void) -{ - /* USER CODE BEGIN Error_Handler_Debug */ - /* User can add his own implementation to report the HAL error return state */ - __disable_irq(); - while (1) { - } - /* USER CODE END Error_Handler_Debug */ -} - -#ifdef USE_FULL_ASSERT -/** - * @brief Reports the name of the source file and the source line number - * where the assert_param error has occurred. - * @param file: pointer to the source file name - * @param line: assert_param error line source number - * @retval None - */ -void assert_failed(uint8_t *file, uint32_t line) -{ - /* USER CODE BEGIN 6 */ - /* User can add his own implementation to report the file name and line - number, ex: printf("Wrong parameters value: file %s on line %d\r\n", file, - line) */ - /* USER CODE END 6 */ -} -#endif /* USE_FULL_ASSERT */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ci/stm32cube/Src/stm32f4xx_hal_msp.c b/ci/stm32cube/Src/stm32f4xx_hal_msp.c deleted file mode 100644 index bf3bb8ac..00000000 --- a/ci/stm32cube/Src/stm32f4xx_hal_msp.c +++ /dev/null @@ -1,84 +0,0 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file stm32f4xx_hal_msp.c - * @brief This file provides code for the MSP Initialization - * and de-Initialization codes. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2022 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -/* Private typedef -----------------------------------------------------------*/ -/* USER CODE BEGIN TD */ - -/* USER CODE END TD */ - -/* Private define ------------------------------------------------------------*/ -/* USER CODE BEGIN Define */ - -/* USER CODE END Define */ - -/* Private macro -------------------------------------------------------------*/ -/* USER CODE BEGIN Macro */ - -/* USER CODE END Macro */ - -/* Private variables ---------------------------------------------------------*/ -/* USER CODE BEGIN PV */ - -/* USER CODE END PV */ - -/* Private function prototypes -----------------------------------------------*/ -/* USER CODE BEGIN PFP */ - -/* USER CODE END PFP */ - -/* External functions --------------------------------------------------------*/ -/* USER CODE BEGIN ExternalFunctions */ - -/* USER CODE END ExternalFunctions */ - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ -/** - * Initializes the Global MSP. - */ -void HAL_MspInit(void) -{ - /* USER CODE BEGIN MspInit 0 */ - - /* USER CODE END MspInit 0 */ - - __HAL_RCC_SYSCFG_CLK_ENABLE(); - __HAL_RCC_PWR_CLK_ENABLE(); - - /* System interrupt init*/ - - /* USER CODE BEGIN MspInit 1 */ - - /* USER CODE END MspInit 1 */ -} - -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ci/stm32cube/Src/stm32f4xx_it.c b/ci/stm32cube/Src/stm32f4xx_it.c deleted file mode 100644 index 9d815ec8..00000000 --- a/ci/stm32cube/Src/stm32f4xx_it.c +++ /dev/null @@ -1,249 +0,0 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file stm32f4xx_it.c - * @brief Interrupt Service Routines. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2022 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" -#include "stm32f4xx_it.h" -/* Private includes ----------------------------------------------------------*/ -/* USER CODE BEGIN Includes */ -/* USER CODE END Includes */ - -/* Private typedef -----------------------------------------------------------*/ -/* USER CODE BEGIN TD */ - -/* USER CODE END TD */ - -/* Private define ------------------------------------------------------------*/ -/* USER CODE BEGIN PD */ - -/* USER CODE END PD */ - -/* Private macro -------------------------------------------------------------*/ -/* USER CODE BEGIN PM */ - -/* USER CODE END PM */ - -/* Private variables ---------------------------------------------------------*/ -/* USER CODE BEGIN PV */ - -/* USER CODE END PV */ - -/* Private function prototypes -----------------------------------------------*/ -/* USER CODE BEGIN PFP */ - -/* USER CODE END PFP */ - -/* Private user code ---------------------------------------------------------*/ -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -/* External variables --------------------------------------------------------*/ -extern DMA_HandleTypeDef hdma_usart1_rx; -extern DMA_HandleTypeDef hdma_usart1_tx; -extern UART_HandleTypeDef huart1; -/* USER CODE BEGIN EV */ - -/* USER CODE END EV */ - -/******************************************************************************/ -/* Cortex-M4 Processor Interruption and Exception Handlers */ -/******************************************************************************/ -/** - * @brief This function handles Non maskable interrupt. - */ -void NMI_Handler(void) -{ - /* USER CODE BEGIN NonMaskableInt_IRQn 0 */ - - /* USER CODE END NonMaskableInt_IRQn 0 */ - /* USER CODE BEGIN NonMaskableInt_IRQn 1 */ - while (1) - { - } - /* USER CODE END NonMaskableInt_IRQn 1 */ -} - -/** - * @brief This function handles Hard fault interrupt. - */ -void HardFault_Handler(void) -{ - /* USER CODE BEGIN HardFault_IRQn 0 */ - - /* USER CODE END HardFault_IRQn 0 */ - while (1) - { - /* USER CODE BEGIN W1_HardFault_IRQn 0 */ - /* USER CODE END W1_HardFault_IRQn 0 */ - } -} - -/** - * @brief This function handles Memory management fault. - */ -void MemManage_Handler(void) -{ - /* USER CODE BEGIN MemoryManagement_IRQn 0 */ - - /* USER CODE END MemoryManagement_IRQn 0 */ - while (1) - { - /* USER CODE BEGIN W1_MemoryManagement_IRQn 0 */ - /* USER CODE END W1_MemoryManagement_IRQn 0 */ - } -} - -/** - * @brief This function handles Pre-fetch fault, memory access fault. - */ -void BusFault_Handler(void) -{ - /* USER CODE BEGIN BusFault_IRQn 0 */ - - /* USER CODE END BusFault_IRQn 0 */ - while (1) - { - /* USER CODE BEGIN W1_BusFault_IRQn 0 */ - /* USER CODE END W1_BusFault_IRQn 0 */ - } -} - -/** - * @brief This function handles Undefined instruction or illegal state. - */ -void UsageFault_Handler(void) -{ - /* USER CODE BEGIN UsageFault_IRQn 0 */ - - /* USER CODE END UsageFault_IRQn 0 */ - while (1) - { - /* USER CODE BEGIN W1_UsageFault_IRQn 0 */ - /* USER CODE END W1_UsageFault_IRQn 0 */ - } -} - -/** - * @brief This function handles System service call via SWI instruction. - */ -void SVC_Handler(void) -{ - /* USER CODE BEGIN SVCall_IRQn 0 */ - - /* USER CODE END SVCall_IRQn 0 */ - /* USER CODE BEGIN SVCall_IRQn 1 */ - - /* USER CODE END SVCall_IRQn 1 */ -} - -/** - * @brief This function handles Debug monitor. - */ -void DebugMon_Handler(void) -{ - /* USER CODE BEGIN DebugMonitor_IRQn 0 */ - - /* USER CODE END DebugMonitor_IRQn 0 */ - /* USER CODE BEGIN DebugMonitor_IRQn 1 */ - - /* USER CODE END DebugMonitor_IRQn 1 */ -} - -/** - * @brief This function handles Pendable request for system service. - */ -void PendSV_Handler(void) -{ - /* USER CODE BEGIN PendSV_IRQn 0 */ - - /* USER CODE END PendSV_IRQn 0 */ - /* USER CODE BEGIN PendSV_IRQn 1 */ - - /* USER CODE END PendSV_IRQn 1 */ -} - -/** - * @brief This function handles System tick timer. - */ -void SysTick_Handler(void) -{ - /* USER CODE BEGIN SysTick_IRQn 0 */ - - /* USER CODE END SysTick_IRQn 0 */ - HAL_IncTick(); - /* USER CODE BEGIN SysTick_IRQn 1 */ - - /* USER CODE END SysTick_IRQn 1 */ -} - -/******************************************************************************/ -/* STM32F4xx Peripheral Interrupt Handlers */ -/* Add here the Interrupt Handlers for the used peripherals. */ -/* For the available peripheral interrupt handler names, */ -/* please refer to the startup file (startup_stm32f4xx.s). */ -/******************************************************************************/ - -/** - * @brief This function handles USART1 global interrupt. - */ -void USART1_IRQHandler(void) -{ - /* USER CODE BEGIN USART1_IRQn 0 */ - - /* USER CODE END USART1_IRQn 0 */ - HAL_UART_IRQHandler(&huart1); - /* USER CODE BEGIN USART1_IRQn 1 */ - - /* USER CODE END USART1_IRQn 1 */ -} - -/** - * @brief This function handles DMA2 stream2 global interrupt. - */ -void DMA2_Stream2_IRQHandler(void) -{ - /* USER CODE BEGIN DMA2_Stream2_IRQn 0 */ - - /* USER CODE END DMA2_Stream2_IRQn 0 */ - HAL_DMA_IRQHandler(&hdma_usart1_rx); - /* USER CODE BEGIN DMA2_Stream2_IRQn 1 */ - - /* USER CODE END DMA2_Stream2_IRQn 1 */ -} - -/** - * @brief This function handles DMA2 stream7 global interrupt. - */ -void DMA2_Stream7_IRQHandler(void) -{ - /* USER CODE BEGIN DMA2_Stream7_IRQn 0 */ - - /* USER CODE END DMA2_Stream7_IRQn 0 */ - HAL_DMA_IRQHandler(&hdma_usart1_tx); - /* USER CODE BEGIN DMA2_Stream7_IRQn 1 */ - - /* USER CODE END DMA2_Stream7_IRQn 1 */ -} - -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ci/stm32cube/Src/usart.c b/ci/stm32cube/Src/usart.c deleted file mode 100644 index aef53957..00000000 --- a/ci/stm32cube/Src/usart.c +++ /dev/null @@ -1,164 +0,0 @@ -/** - ****************************************************************************** - * @file usart.c - * @brief This file provides code for the configuration - * of the USART instances. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2022 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Includes ------------------------------------------------------------------*/ -#include "usart.h" - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -UART_HandleTypeDef huart1; -DMA_HandleTypeDef hdma_usart1_rx; -DMA_HandleTypeDef hdma_usart1_tx; - -/* USART1 init function */ - -void MX_USART1_UART_Init(void) -{ - - /* USER CODE BEGIN USART1_Init 0 */ - - /* USER CODE END USART1_Init 0 */ - - /* USER CODE BEGIN USART1_Init 1 */ - - /* USER CODE END USART1_Init 1 */ - huart1.Instance = USART1; - huart1.Init.BaudRate = 460800; - huart1.Init.WordLength = UART_WORDLENGTH_8B; - huart1.Init.StopBits = UART_STOPBITS_1; - huart1.Init.Parity = UART_PARITY_NONE; - huart1.Init.Mode = UART_MODE_TX_RX; - huart1.Init.HwFlowCtl = UART_HWCONTROL_NONE; - huart1.Init.OverSampling = UART_OVERSAMPLING_16; - if (HAL_UART_Init(&huart1) != HAL_OK) - { - Error_Handler(); - } - /* USER CODE BEGIN USART1_Init 2 */ - - /* USER CODE END USART1_Init 2 */ - -} - -void HAL_UART_MspInit(UART_HandleTypeDef* uartHandle) -{ - - GPIO_InitTypeDef GPIO_InitStruct = {0}; - if(uartHandle->Instance==USART1) - { - /* USER CODE BEGIN USART1_MspInit 0 */ - - /* USER CODE END USART1_MspInit 0 */ - /* USART1 clock enable */ - __HAL_RCC_USART1_CLK_ENABLE(); - - __HAL_RCC_GPIOA_CLK_ENABLE(); - /**USART1 GPIO Configuration - PA9 ------> USART1_TX - PA10 ------> USART1_RX - */ - GPIO_InitStruct.Pin = GPIO_PIN_9|GPIO_PIN_10; - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; - GPIO_InitStruct.Alternate = GPIO_AF7_USART1; - HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); - - /* USART1 DMA Init */ - /* USART1_RX Init */ - hdma_usart1_rx.Instance = DMA2_Stream2; - hdma_usart1_rx.Init.Channel = DMA_CHANNEL_4; - hdma_usart1_rx.Init.Direction = DMA_PERIPH_TO_MEMORY; - hdma_usart1_rx.Init.PeriphInc = DMA_PINC_DISABLE; - hdma_usart1_rx.Init.MemInc = DMA_MINC_ENABLE; - hdma_usart1_rx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE; - hdma_usart1_rx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE; - hdma_usart1_rx.Init.Mode = DMA_CIRCULAR; - hdma_usart1_rx.Init.Priority = DMA_PRIORITY_VERY_HIGH; - hdma_usart1_rx.Init.FIFOMode = DMA_FIFOMODE_DISABLE; - if (HAL_DMA_Init(&hdma_usart1_rx) != HAL_OK) - { - Error_Handler(); - } - - __HAL_LINKDMA(uartHandle,hdmarx,hdma_usart1_rx); - - /* USART1_TX Init */ - hdma_usart1_tx.Instance = DMA2_Stream7; - hdma_usart1_tx.Init.Channel = DMA_CHANNEL_4; - hdma_usart1_tx.Init.Direction = DMA_MEMORY_TO_PERIPH; - hdma_usart1_tx.Init.PeriphInc = DMA_PINC_DISABLE; - hdma_usart1_tx.Init.MemInc = DMA_MINC_ENABLE; - hdma_usart1_tx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE; - hdma_usart1_tx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE; - hdma_usart1_tx.Init.Mode = DMA_NORMAL; - hdma_usart1_tx.Init.Priority = DMA_PRIORITY_VERY_HIGH; - hdma_usart1_tx.Init.FIFOMode = DMA_FIFOMODE_DISABLE; - if (HAL_DMA_Init(&hdma_usart1_tx) != HAL_OK) - { - Error_Handler(); - } - - __HAL_LINKDMA(uartHandle,hdmatx,hdma_usart1_tx); - - /* USART1 interrupt Init */ - HAL_NVIC_SetPriority(USART1_IRQn, 5, 0); - HAL_NVIC_EnableIRQ(USART1_IRQn); - /* USER CODE BEGIN USART1_MspInit 1 */ - - /* USER CODE END USART1_MspInit 1 */ - } -} - -void HAL_UART_MspDeInit(UART_HandleTypeDef* uartHandle) -{ - - if(uartHandle->Instance==USART1) - { - /* USER CODE BEGIN USART1_MspDeInit 0 */ - - /* USER CODE END USART1_MspDeInit 0 */ - /* Peripheral clock disable */ - __HAL_RCC_USART1_CLK_DISABLE(); - - /**USART1 GPIO Configuration - PA9 ------> USART1_TX - PA10 ------> USART1_RX - */ - HAL_GPIO_DeInit(GPIOA, GPIO_PIN_9|GPIO_PIN_10); - - /* USART1 DMA DeInit */ - HAL_DMA_DeInit(uartHandle->hdmarx); - HAL_DMA_DeInit(uartHandle->hdmatx); - - /* USART1 interrupt Deinit */ - HAL_NVIC_DisableIRQ(USART1_IRQn); - /* USER CODE BEGIN USART1_MspDeInit 1 */ - - /* USER CODE END USART1_MspDeInit 1 */ - } -} - -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ci/stm32cube/stm32pio.ini b/ci/stm32cube/stm32pio.ini index a30c6e89..31a02250 100644 --- a/ci/stm32cube/stm32pio.ini +++ b/ci/stm32cube/stm32pio.ini @@ -1,18 +1,2 @@ [app] -platformio_cmd = platformio -cubemx_cmd = /opt/STM32CubeMX/STM32CubeMX -java_cmd = None - -[project] -cubemx_script_content = config load ${ioc_file_absolute_path} - generate code ${project_dir_absolute_path} - exit -platformio_ini_patch_content = [platformio] - include_dir = Inc - src_dir = Src -board = -ioc_file = STM32F401RC.ioc -cleanup_ignore = STM32F401RC.ioc -cleanup_use_git = False -inspect_ioc = True - +cubemx_cmd = /usr/local/STMicroelectronics/STM32Cube/STM32CubeMX/STM32CubeMX From 8828f03e5daa26af4f0dc141f7deb9ca20834095 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C5=82a=C5=BCej=20Sowa?= Date: Thu, 4 Aug 2022 16:54:07 +0200 Subject: [PATCH 12/23] Uncomment arduino ci job --- .github/workflows/ci.yml | 80 ++++++++++++++++++++-------------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 88e3096f..5aa0c361 100755 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,48 +7,48 @@ on: - "**" jobs: - # micro_ros_platformio_arduino: - # runs-on: ubuntu-20.04 - # container: ubuntu:20.04 + micro_ros_platformio_arduino: + runs-on: ubuntu-20.04 + container: ubuntu:20.04 - # strategy: - # fail-fast: false - # matrix: - # pio-environment: - # - teensy41 - # - teensy41 - # - teensy40 - # - teensy36 - # - teensy35 - # - teensy31 - # - due - # - zero - # - olimex_e407 - # - esp32dev - # - nanorp2040connect - # - portenta_h7_m7 - # - teensy41_eth - # - nanorp2040connect_wifi - # - portenta_h7_m7_wifi - # - esp32dev_wifi - # - portenta_h7_m7_galactic - # - portenta_h7_m7_foxy - # - portenta_h7_m7_rolling - # - teensy41_custom - # - pico + strategy: + fail-fast: false + matrix: + pio-environment: + - teensy41 + - teensy41 + - teensy40 + - teensy36 + - teensy35 + - teensy31 + - due + - zero + - olimex_e407 + - esp32dev + - nanorp2040connect + - portenta_h7_m7 + - teensy41_eth + - nanorp2040connect_wifi + - portenta_h7_m7_wifi + - esp32dev_wifi + - portenta_h7_m7_galactic + - portenta_h7_m7_foxy + - portenta_h7_m7_rolling + - teensy41_custom + - pico - # steps: - # - uses: actions/checkout@v3 - # with: - # path: repo - # - name: Install environment - # uses: ./repo/.github/actions/platformio-env - # - name: Build - # shell: bash - # run: | - # export PATH=$PATH:~/.platformio/penv/bin - # cd repo/ci/arduino - # pio run -e ${{ matrix.pio-environment }} + steps: + - uses: actions/checkout@v3 + with: + path: repo + - name: Install environment + uses: ./repo/.github/actions/platformio-env + - name: Build + shell: bash + run: | + export PATH=$PATH:~/.platformio/penv/bin + cd repo/ci/arduino + pio run -e ${{ matrix.pio-environment }} micro_ros_platformio_stm32cube: runs-on: ubuntu-20.04 From 1d6a755815473cc7c92f6d0aa680366227816ef3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C5=82a=C5=BCej=20Sowa?= Date: Thu, 4 Aug 2022 17:32:02 +0200 Subject: [PATCH 13/23] Allow setting buffer sizes that are not a power of 2 --- platform_code/stm32cube/serial/micro_ros_transport.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platform_code/stm32cube/serial/micro_ros_transport.cpp b/platform_code/stm32cube/serial/micro_ros_transport.cpp index 56696290..a68b27d5 100644 --- a/platform_code/stm32cube/serial/micro_ros_transport.cpp +++ b/platform_code/stm32cube/serial/micro_ros_transport.cpp @@ -13,7 +13,7 @@ static void stream_flush(DMAStream *stream) { if (thead != ttail) { uint16_t len = thead < ttail ? ttail - thead : stream->tbuffer_size - thead; - thead_next = (thead + len) & (stream->tbuffer_size - 1); + thead_next = (thead + len) % stream->tbuffer_size; HAL_UART_Transmit_DMA(stream->uart, stream->tbuffer + thead, len); } mutex = false; @@ -69,7 +69,7 @@ size_t platformio_transport_write(struct uxrCustomTransport *transport, memcpy(stream->tbuffer, buf + n_tail, n - n_tail); } - ttail = (ttail + n) & (stream->tbuffer_size - 1); + ttail = (ttail + n) % stream->tbuffer_size; stream_flush(stream); @@ -96,7 +96,7 @@ size_t platformio_transport_read(struct uxrCustomTransport *transport, size_t wrote = 0; while ((rhead != rtail) && (wrote < len)) { buf[wrote++] = stream->rbuffer[rhead]; - rhead = (rhead + 1) & (stream->rbuffer_size - 1); + rhead = (rhead + 1) % stream->rbuffer_size; } return wrote; From 44da9654aa2e08b749fcb494b6fd6fc510adccc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C5=82a=C5=BCej=20Sowa?= Date: Thu, 4 Aug 2022 17:34:27 +0200 Subject: [PATCH 14/23] Freeze ststm32 platform package version --- ci/stm32cube/platformio.ini | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ci/stm32cube/platformio.ini b/ci/stm32cube/platformio.ini index 2380c62a..81849ea4 100644 --- a/ci/stm32cube/platformio.ini +++ b/ci/stm32cube/platformio.ini @@ -1,11 +1,13 @@ -[env:genericSTM32F401RC] -platform = ststm32 -board = genericSTM32F401RC +[env] +platform = ststm32@15.4.1 framework = stm32cube board_build.stm32cube.custom_config_header = yes -board_microros_transport = serial lib_deps = ../../ + +[env:genericSTM32F401RC] +board = genericSTM32F401RC +board_microros_transport = serial debug_tool = stlink upload_protocol = stlink From d7bbc0afeb5060b74e5a17552657cd3104629917 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C5=82a=C5=BCej=20Sowa?= Date: Fri, 26 Aug 2022 16:03:47 +0200 Subject: [PATCH 15/23] Update .github/workflows/ci.yml Co-authored-by: Antonio Cuadros <49162117+Acuadros95@users.noreply.github.com> --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5aa0c361..897741b7 100755 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,6 @@ jobs: fail-fast: false matrix: pio-environment: - - teensy41 - teensy41 - teensy40 - teensy36 From 6dee3d2197c36d66c24a3f13a13777531176ba64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C5=82a=C5=BCej=20Sowa?= Date: Fri, 2 Sep 2022 14:11:27 +0200 Subject: [PATCH 16/23] Ignore vscode configuration --- ci/stm32cube/.gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/ci/stm32cube/.gitignore b/ci/stm32cube/.gitignore index 03f4a3c1..3b8da3a4 100644 --- a/ci/stm32cube/.gitignore +++ b/ci/stm32cube/.gitignore @@ -1 +1,2 @@ .pio +.vscode \ No newline at end of file From 9399a570bf53f210f94b973c749a2399fb9344b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C5=82a=C5=BCej=20Sowa?= Date: Fri, 2 Sep 2022 14:15:23 +0200 Subject: [PATCH 17/23] Don't include HAL libraries in clock_gettime --- platform_code/stm32cube/clock_gettime.cpp | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/platform_code/stm32cube/clock_gettime.cpp b/platform_code/stm32cube/clock_gettime.cpp index 64b39fdb..319b2f4e 100644 --- a/platform_code/stm32cube/clock_gettime.cpp +++ b/platform_code/stm32cube/clock_gettime.cpp @@ -1,18 +1,6 @@ #include -#if defined(STM32F0xx) -#include "stm32f0xx_hal.h" -#elif defined(STM32F1xx) -#include "stm32f1xx_hal.h" -#elif defined(STM32F2xx) -#include "stm32f2xx_hal.h" -#elif defined(STM32F3xx) -#include "stm32f3xx_hal.h" -#elif defined(STM32F4xx) -#include "stm32f4xx_hal.h" -#elif defined(STM32F7xx) -#include "stm32f7xx_hal.h" -#endif +extern "C" uint32_t HAL_GetTick(); constexpr uint64_t GETTICK_ROLLOVER_USECONDS = 4294967296000UL; From b77f7527c8324cdeb8b7200ee8cd41ddfd5096c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C5=82a=C5=BCej=20Sowa?= Date: Fri, 2 Sep 2022 14:17:46 +0200 Subject: [PATCH 18/23] Create example project on nucleo-f103rb board --- ci/stm32cube/STM32F401RC.ioc | 146 --------------------------- ci/stm32cube/Src/main.c | 41 ++++---- ci/stm32cube/custom.meta | 15 +++ ci/stm32cube/nucleo_f103rb.ioc | 176 +++++++++++++++++++++++++++++++++ ci/stm32cube/platformio.ini | 9 +- 5 files changed, 216 insertions(+), 171 deletions(-) delete mode 100644 ci/stm32cube/STM32F401RC.ioc create mode 100644 ci/stm32cube/custom.meta create mode 100644 ci/stm32cube/nucleo_f103rb.ioc diff --git a/ci/stm32cube/STM32F401RC.ioc b/ci/stm32cube/STM32F401RC.ioc deleted file mode 100644 index 9693df03..00000000 --- a/ci/stm32cube/STM32F401RC.ioc +++ /dev/null @@ -1,146 +0,0 @@ -#MicroXplorer Configuration settings - do not modify -Dma.Request0=USART1_RX -Dma.Request1=USART1_TX -Dma.RequestsNb=2 -Dma.USART1_RX.0.Direction=DMA_PERIPH_TO_MEMORY -Dma.USART1_RX.0.FIFOMode=DMA_FIFOMODE_DISABLE -Dma.USART1_RX.0.Instance=DMA2_Stream2 -Dma.USART1_RX.0.MemDataAlignment=DMA_MDATAALIGN_BYTE -Dma.USART1_RX.0.MemInc=DMA_MINC_ENABLE -Dma.USART1_RX.0.Mode=DMA_CIRCULAR -Dma.USART1_RX.0.PeriphDataAlignment=DMA_PDATAALIGN_BYTE -Dma.USART1_RX.0.PeriphInc=DMA_PINC_DISABLE -Dma.USART1_RX.0.Priority=DMA_PRIORITY_VERY_HIGH -Dma.USART1_RX.0.RequestParameters=Instance,Direction,PeriphInc,MemInc,PeriphDataAlignment,MemDataAlignment,Mode,Priority,FIFOMode -Dma.USART1_TX.1.Direction=DMA_MEMORY_TO_PERIPH -Dma.USART1_TX.1.FIFOMode=DMA_FIFOMODE_DISABLE -Dma.USART1_TX.1.Instance=DMA2_Stream7 -Dma.USART1_TX.1.MemDataAlignment=DMA_MDATAALIGN_BYTE -Dma.USART1_TX.1.MemInc=DMA_MINC_ENABLE -Dma.USART1_TX.1.Mode=DMA_NORMAL -Dma.USART1_TX.1.PeriphDataAlignment=DMA_PDATAALIGN_BYTE -Dma.USART1_TX.1.PeriphInc=DMA_PINC_DISABLE -Dma.USART1_TX.1.Priority=DMA_PRIORITY_VERY_HIGH -Dma.USART1_TX.1.RequestParameters=Instance,Direction,PeriphInc,MemInc,PeriphDataAlignment,MemDataAlignment,Mode,Priority,FIFOMode -File.Version=6 -GPIO.groupedBy=Group By Peripherals -KeepUserPlacement=false -Mcu.Family=STM32F4 -Mcu.IP0=DMA -Mcu.IP1=NVIC -Mcu.IP2=RCC -Mcu.IP3=SYS -Mcu.IP4=USART1 -Mcu.IPNb=5 -Mcu.Name=STM32F401R(B-C)Tx -Mcu.Package=LQFP64 -Mcu.Pin0=PH0 - OSC_IN -Mcu.Pin1=PH1 - OSC_OUT -Mcu.Pin2=PA9 -Mcu.Pin3=PA10 -Mcu.Pin4=PA13 -Mcu.Pin5=PA14 -Mcu.Pin6=VP_SYS_VS_Systick -Mcu.PinsNb=7 -Mcu.ThirdPartyNb=0 -Mcu.UserConstants= -Mcu.UserName=STM32F401RCTx -MxCube.Version=6.3.0 -MxDb.Version=DB.6.0.30 -NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false -NVIC.DMA2_Stream2_IRQn=true\:5\:0\:true\:false\:true\:false\:true -NVIC.DMA2_Stream7_IRQn=true\:5\:0\:true\:false\:true\:false\:true -NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false -NVIC.ForceEnableDMAVector=true -NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false -NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:false\:false -NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:false\:false -NVIC.PendSV_IRQn=true\:0\:0\:false\:false\:true\:false\:false -NVIC.PriorityGroup=NVIC_PRIORITYGROUP_4 -NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:true\:false\:false -NVIC.SysTick_IRQn=true\:15\:0\:false\:false\:true\:false\:true -NVIC.USART1_IRQn=true\:5\:0\:true\:false\:true\:true\:true -NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false -PA10.Locked=true -PA10.Mode=Asynchronous -PA10.Signal=USART1_RX -PA13.Locked=true -PA13.Mode=Serial_Wire -PA13.Signal=SYS_JTMS-SWDIO -PA14.Locked=true -PA14.Mode=Serial_Wire -PA14.Signal=SYS_JTCK-SWCLK -PA9.Locked=true -PA9.Mode=Asynchronous -PA9.Signal=USART1_TX -PH0\ -\ OSC_IN.Locked=true -PH0\ -\ OSC_IN.Mode=HSE-External-Oscillator -PH0\ -\ OSC_IN.Signal=RCC_OSC_IN -PH1\ -\ OSC_OUT.Locked=true -PH1\ -\ OSC_OUT.Mode=HSE-External-Oscillator -PH1\ -\ OSC_OUT.Signal=RCC_OSC_OUT -PinOutPanel.RotationAngle=0 -ProjectManager.AskForMigrate=true -ProjectManager.BackupPrevious=false -ProjectManager.CompilerOptimize=6 -ProjectManager.ComputerToolchain=false -ProjectManager.CoupleFile=true -ProjectManager.CustomerFirmwarePackage= -ProjectManager.DefaultFWLocation=true -ProjectManager.DeletePrevious=true -ProjectManager.DeviceId=STM32F401RCTx -ProjectManager.FirmwarePackage=STM32Cube FW_F4 V1.26.2 -ProjectManager.FreePins=false -ProjectManager.HalAssertFull=false -ProjectManager.HeapSize=0x200 -ProjectManager.KeepUserCode=true -ProjectManager.LastFirmware=true -ProjectManager.LibraryCopy=1 -ProjectManager.MainLocation=Core/Src -ProjectManager.NoMain=false -ProjectManager.PreviousToolchain= -ProjectManager.ProjectBuild=false -ProjectManager.ProjectFileName=STM32F401RC.ioc -ProjectManager.ProjectName=STM32F401RC -ProjectManager.RegisterCallBack= -ProjectManager.StackSize=0x400 -ProjectManager.TargetToolchain=Other Toolchains (GPDSC) -ProjectManager.ToolChainLocation= -ProjectManager.UnderRoot=false -ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-MX_DMA_Init-DMA-false-HAL-true,3-SystemClock_Config-RCC-false-HAL-false,4-MX_USART1_UART_Init-USART1-false-HAL-true -RCC.48MHZClocksFreq_Value=42000000 -RCC.AHBFreq_Value=84000000 -RCC.APB1CLKDivider=RCC_HCLK_DIV2 -RCC.APB1Freq_Value=42000000 -RCC.APB1TimFreq_Value=84000000 -RCC.APB2Freq_Value=84000000 -RCC.APB2TimFreq_Value=84000000 -RCC.CortexFreq_Value=84000000 -RCC.FCLKCortexFreq_Value=84000000 -RCC.HCLKFreq_Value=84000000 -RCC.HSE_VALUE=8000000 -RCC.HSI_VALUE=16000000 -RCC.I2SClocksFreq_Value=96000000 -RCC.IPParameters=48MHZClocksFreq_Value,AHBFreq_Value,APB1CLKDivider,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,CortexFreq_Value,FCLKCortexFreq_Value,HCLKFreq_Value,HSE_VALUE,HSI_VALUE,I2SClocksFreq_Value,LSE_VALUE,LSI_VALUE,MCO2PinFreq_Value,PLLCLKFreq_Value,PLLM,PLLN,PLLQCLKFreq_Value,PLLSourceVirtual,RTCFreq_Value,RTCHSEDivFreq_Value,SYSCLKFreq_VALUE,SYSCLKSource,VCOI2SOutputFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VcooutputI2S -RCC.LSE_VALUE=32768 -RCC.LSI_VALUE=32000 -RCC.MCO2PinFreq_Value=84000000 -RCC.PLLCLKFreq_Value=84000000 -RCC.PLLM=8 -RCC.PLLN=168 -RCC.PLLQCLKFreq_Value=42000000 -RCC.PLLSourceVirtual=RCC_PLLSOURCE_HSE -RCC.RTCFreq_Value=32000 -RCC.RTCHSEDivFreq_Value=4000000 -RCC.SYSCLKFreq_VALUE=84000000 -RCC.SYSCLKSource=RCC_SYSCLKSOURCE_PLLCLK -RCC.VCOI2SOutputFreq_Value=192000000 -RCC.VCOInputFreq_Value=1000000 -RCC.VCOOutputFreq_Value=168000000 -RCC.VcooutputI2S=96000000 -USART1.BaudRate=460800 -USART1.IPParameters=VirtualMode,BaudRate -USART1.VirtualMode=VM_ASYNC -VP_SYS_VS_Systick.Mode=SysTick -VP_SYS_VS_Systick.Signal=SYS_VS_Systick -board=custom diff --git a/ci/stm32cube/Src/main.c b/ci/stm32cube/Src/main.c index eaa28065..a645b978 100644 --- a/ci/stm32cube/Src/main.c +++ b/ci/stm32cube/Src/main.c @@ -11,18 +11,18 @@ /* USER CODE END Includes */ /* USER CODE BEGIN PD */ -#define RCCHECK(fn) \ - { \ - rcl_ret_t temp_rc = fn; \ - if ((temp_rc != RCL_RET_OK)) { \ - Error_Handler(); \ - } \ +#define RCCHECK(fn) \ + { \ + rcl_ret_t temp_rc = fn; \ + if ((temp_rc != RCL_RET_OK)) { \ + Error_Handler(); \ + } \ } -#define RCSOFTCHECK(fn) \ - { \ - rcl_ret_t temp_rc = fn; \ - if ((temp_rc != RCL_RET_OK)) { \ - } \ +#define RCSOFTCHECK(fn) \ + { \ + rcl_ret_t temp_rc = fn; \ + if ((temp_rc != RCL_RET_OK)) { \ + } \ } /* USER CODE END PD */ @@ -35,19 +35,19 @@ static rcl_allocator_t allocator; static rcl_node_t node; static rcl_timer_t timer; -static uint8_t uart_rbuffer[2048]; -static uint8_t uart_tbuffer[2048]; +static uint8_t uart_rbuffer[512]; +static uint8_t uart_tbuffer[512]; static struct DMAStream stream = { - .uart = &huart1, - .rbuffer_size = 2048, + .uart = &huart2, + .rbuffer_size = 512, .rbuffer = uart_rbuffer, - .tbuffer_size = 2048, + .tbuffer_size = 512, .tbuffer = uart_tbuffer, }; /* USER CODE END PV */ /* USER CODE BEGIN 0 */ -void timer_callback(rcl_timer_t* timer, int64_t last_call_time) { +void timer_callback(rcl_timer_t *timer, int64_t last_call_time) { RCLC_UNUSED(last_call_time); if (timer != NULL) { RCSOFTCHECK(rcl_publish(&publisher, &msg, NULL)); @@ -55,15 +55,14 @@ void timer_callback(rcl_timer_t* timer, int64_t last_call_time) { } } -void HAL_UART_TxCpltCallback(UART_HandleTypeDef* huart) { - if (huart == &huart1) { +void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart) { + if (huart == &huart2) { uart_transfer_complete_callback(&stream); } } /* USER CODE END 0 */ -int main(void) -{ +int main(void) { /* USER CODE BEGIN 2 */ set_microros_serial_transports(&stream); diff --git a/ci/stm32cube/custom.meta b/ci/stm32cube/custom.meta new file mode 100644 index 00000000..866bcd0d --- /dev/null +++ b/ci/stm32cube/custom.meta @@ -0,0 +1,15 @@ +{ + "names": { + "rmw_microxrcedds": { + "cmake-args": [ + "-DRMW_UXRCE_MAX_NODES=1", + "-DRMW_UXRCE_MAX_PUBLISHERS=2", + "-DRMW_UXRCE_MAX_SUBSCRIPTIONS=1", + "-DRMW_UXRCE_MAX_SERVICES=0", + "-DRMW_UXRCE_MAX_CLIENTS=1", + "-DRMW_UXRCE_MAX_HISTORY=1", + "-DRMW_UXRCE_TRANSPORT=custom" + ] + } + } +} \ No newline at end of file diff --git a/ci/stm32cube/nucleo_f103rb.ioc b/ci/stm32cube/nucleo_f103rb.ioc new file mode 100644 index 00000000..ff9ae9ff --- /dev/null +++ b/ci/stm32cube/nucleo_f103rb.ioc @@ -0,0 +1,176 @@ +#MicroXplorer Configuration settings - do not modify +Dma.Request0=USART2_RX +Dma.Request1=USART2_TX +Dma.RequestsNb=2 +Dma.USART2_RX.0.Direction=DMA_PERIPH_TO_MEMORY +Dma.USART2_RX.0.Instance=DMA1_Channel6 +Dma.USART2_RX.0.MemDataAlignment=DMA_MDATAALIGN_BYTE +Dma.USART2_RX.0.MemInc=DMA_MINC_ENABLE +Dma.USART2_RX.0.Mode=DMA_CIRCULAR +Dma.USART2_RX.0.PeriphDataAlignment=DMA_PDATAALIGN_BYTE +Dma.USART2_RX.0.PeriphInc=DMA_PINC_DISABLE +Dma.USART2_RX.0.Priority=DMA_PRIORITY_VERY_HIGH +Dma.USART2_RX.0.RequestParameters=Instance,Direction,PeriphInc,MemInc,PeriphDataAlignment,MemDataAlignment,Mode,Priority +Dma.USART2_TX.1.Direction=DMA_MEMORY_TO_PERIPH +Dma.USART2_TX.1.Instance=DMA1_Channel7 +Dma.USART2_TX.1.MemDataAlignment=DMA_MDATAALIGN_BYTE +Dma.USART2_TX.1.MemInc=DMA_MINC_ENABLE +Dma.USART2_TX.1.Mode=DMA_NORMAL +Dma.USART2_TX.1.PeriphDataAlignment=DMA_PDATAALIGN_BYTE +Dma.USART2_TX.1.PeriphInc=DMA_PINC_DISABLE +Dma.USART2_TX.1.Priority=DMA_PRIORITY_VERY_HIGH +Dma.USART2_TX.1.RequestParameters=Instance,Direction,PeriphInc,MemInc,PeriphDataAlignment,MemDataAlignment,Mode,Priority +File.Version=6 +GPIO.groupedBy=Group By Peripherals +KeepUserPlacement=false +Mcu.Family=STM32F1 +Mcu.IP0=DMA +Mcu.IP1=NVIC +Mcu.IP2=RCC +Mcu.IP3=SYS +Mcu.IP4=USART2 +Mcu.IPNb=5 +Mcu.Name=STM32F103R(8-B)Tx +Mcu.Package=LQFP64 +Mcu.Pin0=PC13-TAMPER-RTC +Mcu.Pin1=PC14-OSC32_IN +Mcu.Pin10=PB3 +Mcu.Pin11=VP_SYS_VS_Systick +Mcu.Pin2=PC15-OSC32_OUT +Mcu.Pin3=PD0-OSC_IN +Mcu.Pin4=PD1-OSC_OUT +Mcu.Pin5=PA2 +Mcu.Pin6=PA3 +Mcu.Pin7=PA5 +Mcu.Pin8=PA13 +Mcu.Pin9=PA14 +Mcu.PinsNb=12 +Mcu.ThirdPartyNb=0 +Mcu.UserConstants= +Mcu.UserName=STM32F103RBTx +MxCube.Version=6.3.0 +MxDb.Version=DB.6.0.30 +NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:true\:false +NVIC.DMA1_Channel6_IRQn=true\:0\:0\:false\:false\:true\:false\:true +NVIC.DMA1_Channel7_IRQn=true\:0\:0\:false\:false\:true\:false\:true +NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:true\:false +NVIC.EXTI15_10_IRQn=true\:0\:0\:false\:false\:true\:true\:true +NVIC.ForceEnableDMAVector=true +NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:true\:false +NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:true\:false +NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:true\:false +NVIC.PendSV_IRQn=true\:0\:0\:false\:false\:true\:true\:false +NVIC.PriorityGroup=NVIC_PRIORITYGROUP_4 +NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:true\:true\:false +NVIC.SysTick_IRQn=true\:0\:0\:false\:false\:true\:true\:true +NVIC.USART2_IRQn=true\:0\:0\:false\:false\:true\:true\:true +NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:true\:false +PA13.GPIOParameters=GPIO_Label +PA13.GPIO_Label=TMS +PA13.Locked=true +PA13.Mode=Serial_Wire +PA13.Signal=SYS_JTMS-SWDIO +PA14.GPIOParameters=GPIO_Label +PA14.GPIO_Label=TCK +PA14.Locked=true +PA14.Mode=Serial_Wire +PA14.Signal=SYS_JTCK-SWCLK +PA2.GPIOParameters=GPIO_Speed,GPIO_PuPd,GPIO_Label,GPIO_Mode +PA2.GPIO_Label=USART_TX +PA2.GPIO_Mode=GPIO_MODE_AF_PP +PA2.GPIO_PuPd=GPIO_NOPULL +PA2.GPIO_Speed=GPIO_SPEED_FREQ_LOW +PA2.Locked=true +PA2.Mode=Asynchronous +PA2.Signal=USART2_TX +PA3.GPIOParameters=GPIO_Speed,GPIO_PuPd,GPIO_Label,GPIO_Mode +PA3.GPIO_Label=USART_RX +PA3.GPIO_Mode=GPIO_MODE_AF_PP +PA3.GPIO_PuPd=GPIO_NOPULL +PA3.GPIO_Speed=GPIO_SPEED_FREQ_LOW +PA3.Locked=true +PA3.Mode=Asynchronous +PA3.Signal=USART2_RX +PA5.GPIOParameters=GPIO_Speed,GPIO_PuPd,GPIO_Label,GPIO_ModeDefaultOutputPP +PA5.GPIO_Label=LD2 [Green Led] +PA5.GPIO_ModeDefaultOutputPP=GPIO_MODE_OUTPUT_PP +PA5.GPIO_PuPd=GPIO_NOPULL +PA5.GPIO_Speed=GPIO_SPEED_FREQ_LOW +PA5.Locked=true +PA5.Signal=GPIO_Output +PB3.GPIOParameters=GPIO_Label +PB3.GPIO_Label=SWO +PB3.Locked=true +PB3.Signal=SYS_JTDO-TRACESWO +PC13-TAMPER-RTC.GPIOParameters=GPIO_PuPd,GPIO_Label,GPIO_ModeDefaultEXTI +PC13-TAMPER-RTC.GPIO_Label=B1 [Blue PushButton] +PC13-TAMPER-RTC.GPIO_ModeDefaultEXTI=GPIO_MODE_IT_FALLING +PC13-TAMPER-RTC.GPIO_PuPd=GPIO_NOPULL +PC13-TAMPER-RTC.Locked=true +PC13-TAMPER-RTC.Signal=GPXTI13 +PC14-OSC32_IN.Locked=true +PC14-OSC32_IN.Signal=RCC_OSC32_IN +PC15-OSC32_OUT.Locked=true +PC15-OSC32_OUT.Signal=RCC_OSC32_OUT +PD0-OSC_IN.Locked=true +PD0-OSC_IN.Signal=RCC_OSC_IN +PD1-OSC_OUT.Locked=true +PD1-OSC_OUT.Signal=RCC_OSC_OUT +PinOutPanel.RotationAngle=0 +ProjectManager.AskForMigrate=true +ProjectManager.BackupPrevious=false +ProjectManager.CompilerOptimize=6 +ProjectManager.ComputerToolchain=false +ProjectManager.CoupleFile=true +ProjectManager.CustomerFirmwarePackage= +ProjectManager.DefaultFWLocation=true +ProjectManager.DeletePrevious=true +ProjectManager.DeviceId=STM32F103RBTx +ProjectManager.FirmwarePackage=STM32Cube FW_F1 V1.8.4 +ProjectManager.FreePins=false +ProjectManager.HalAssertFull=false +ProjectManager.HeapSize=0x200 +ProjectManager.KeepUserCode=true +ProjectManager.LastFirmware=true +ProjectManager.LibraryCopy=1 +ProjectManager.MainLocation=Core/Src +ProjectManager.NoMain=false +ProjectManager.PreviousToolchain= +ProjectManager.ProjectBuild=false +ProjectManager.ProjectFileName=nucleo_f103rb.ioc +ProjectManager.ProjectName=nucleo_f103rb +ProjectManager.RegisterCallBack= +ProjectManager.StackSize=0x400 +ProjectManager.TargetToolchain=Other Toolchains (GPDSC) +ProjectManager.ToolChainLocation= +ProjectManager.UnderRoot=false +ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-MX_DMA_Init-DMA-false-HAL-true,3-SystemClock_Config-RCC-false-HAL-false,4-MX_USART2_UART_Init-USART2-false-HAL-true +RCC.ADCFreqValue=32000000 +RCC.AHBFreq_Value=64000000 +RCC.APB1CLKDivider=RCC_HCLK_DIV2 +RCC.APB1Freq_Value=32000000 +RCC.APB1TimFreq_Value=64000000 +RCC.APB2Freq_Value=64000000 +RCC.APB2TimFreq_Value=64000000 +RCC.FCLKCortexFreq_Value=64000000 +RCC.FamilyName=M +RCC.HCLKFreq_Value=64000000 +RCC.IPParameters=ADCFreqValue,AHBFreq_Value,APB1CLKDivider,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,FCLKCortexFreq_Value,FamilyName,HCLKFreq_Value,MCOFreq_Value,PLLCLKFreq_Value,PLLMCOFreq_Value,PLLMUL,RTCFreq_Value,SYSCLKFreq_VALUE,SYSCLKSource,TimSysFreq_Value,USBFreq_Value,VCOOutput2Freq_Value +RCC.MCOFreq_Value=64000000 +RCC.PLLCLKFreq_Value=64000000 +RCC.PLLMCOFreq_Value=32000000 +RCC.PLLMUL=RCC_PLL_MUL16 +RCC.RTCFreq_Value=40000 +RCC.SYSCLKFreq_VALUE=64000000 +RCC.SYSCLKSource=RCC_SYSCLKSOURCE_PLLCLK +RCC.TimSysFreq_Value=64000000 +RCC.USBFreq_Value=64000000 +RCC.VCOOutput2Freq_Value=4000000 +SH.GPXTI13.0=GPIO_EXTI13 +SH.GPXTI13.ConfNb=1 +USART2.IPParameters=VirtualMode +USART2.VirtualMode=VM_ASYNC +VP_SYS_VS_Systick.Mode=SysTick +VP_SYS_VS_Systick.Signal=SYS_VS_Systick +board=NUCLEO-F103RB +boardIOC=true diff --git a/ci/stm32cube/platformio.ini b/ci/stm32cube/platformio.ini index 81849ea4..03eabb3c 100644 --- a/ci/stm32cube/platformio.ini +++ b/ci/stm32cube/platformio.ini @@ -5,11 +5,12 @@ board_build.stm32cube.custom_config_header = yes lib_deps = ../../ -[env:genericSTM32F401RC] -board = genericSTM32F401RC +[env:nucleo_f103rb] +board = nucleo_f103rb board_microros_transport = serial -debug_tool = stlink -upload_protocol = stlink +board_microros_user_meta = custom.meta +build_flags= + -DSTM32F1xx [platformio] include_dir = Inc From 0fa7672d978d459cdda38f9c27e8604feda38c01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C5=82a=C5=BCej=20Sowa?= Date: Fri, 2 Sep 2022 14:18:44 +0200 Subject: [PATCH 19/23] Update CI to use new pio environment --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 897741b7..443988af 100755 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,7 +57,7 @@ jobs: fail-fast: false matrix: pio-environment: - - genericSTM32F401RC + - nucleo_f103rb steps: - uses: actions/checkout@v3 From 2e496587f753937d43f542edd6ca716f7e7235be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C5=82a=C5=BCej=20Sowa?= Date: Tue, 20 Sep 2022 15:06:35 +0200 Subject: [PATCH 20/23] Fix issues with clock_gettime implementation - Fix race condition in rollover detection by disabling interrupts - Fix integer overflows by casting types in the correct order --- platform_code/stm32cube/clock_gettime.cpp | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/platform_code/stm32cube/clock_gettime.cpp b/platform_code/stm32cube/clock_gettime.cpp index 319b2f4e..4db69a8a 100644 --- a/platform_code/stm32cube/clock_gettime.cpp +++ b/platform_code/stm32cube/clock_gettime.cpp @@ -1,6 +1,18 @@ #include -extern "C" uint32_t HAL_GetTick(); +#if defined(STM32F0xx) +#include "stm32f0xx_hal.h" +#elif defined(STM32F1xx) +#include "stm32f1xx_hal.h" +#elif defined(STM32F2xx) +#include "stm32f2xx_hal.h" +#elif defined(STM32F3xx) +#include "stm32f3xx_hal.h" +#elif defined(STM32F4xx) +#include "stm32f4xx_hal.h" +#elif defined(STM32F7xx) +#include "stm32f7xx_hal.h" +#endif constexpr uint64_t GETTICK_ROLLOVER_USECONDS = 4294967296000UL; @@ -9,14 +21,16 @@ extern "C" int clock_gettime(clockid_t unused, struct timespec *tp) { static uint32_t rollover = 0; static uint32_t last_measure = 0; + __disable_irq(); uint32_t m = HAL_GetTick(); rollover += (m < last_measure) ? 1 : 0; + last_measure = m; + __enable_irq(); uint64_t real_us = - (uint64_t)(m * 1000 + rollover * GETTICK_ROLLOVER_USECONDS); + static_cast(m) * 1000UL + rollover * GETTICK_ROLLOVER_USECONDS; tp->tv_sec = real_us / 1000000; tp->tv_nsec = (real_us % 1000000) * 1000; - last_measure = m; return 0; -} \ No newline at end of file +} From d5a0592b2baddccb53569464a3565d34ba7d9f2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C5=82a=C5=BCej=20Sowa?= Date: Thu, 22 Sep 2022 16:26:47 +0200 Subject: [PATCH 21/23] Add nucleo_767zi example to CI --- .github/workflows/ci.yml | 2 + ci/stm32cube/Src/main.c | 4 +- ci/stm32cube/{ => ioc}/nucleo_f103rb.ioc | 0 ci/stm32cube/ioc/nucleo_f767zi.ioc | 316 +++++++++++++++++++++++ ci/stm32cube/platformio.ini | 8 + 5 files changed, 328 insertions(+), 2 deletions(-) rename ci/stm32cube/{ => ioc}/nucleo_f103rb.ioc (100%) create mode 100644 ci/stm32cube/ioc/nucleo_f767zi.ioc diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 443988af..f85da831 100755 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -58,6 +58,7 @@ jobs: matrix: pio-environment: - nucleo_f103rb + - nucleo_f767zi steps: - uses: actions/checkout@v3 @@ -99,5 +100,6 @@ jobs: run: | export PATH=$PATH:~/.platformio/penv/bin cd repo/ci/stm32cube + cp ioc/${{ matrix.pio-environment }}.ioc . xvfb-run --auto-servernum stm32pio -v generate pio run -e ${{ matrix.pio-environment }} diff --git a/ci/stm32cube/Src/main.c b/ci/stm32cube/Src/main.c index a645b978..43db0e75 100644 --- a/ci/stm32cube/Src/main.c +++ b/ci/stm32cube/Src/main.c @@ -38,7 +38,7 @@ static rcl_timer_t timer; static uint8_t uart_rbuffer[512]; static uint8_t uart_tbuffer[512]; static struct DMAStream stream = { - .uart = &huart2, + .uart = &UART_HANDLE, .rbuffer_size = 512, .rbuffer = uart_rbuffer, .tbuffer_size = 512, @@ -56,7 +56,7 @@ void timer_callback(rcl_timer_t *timer, int64_t last_call_time) { } void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart) { - if (huart == &huart2) { + if (huart == &UART_HANDLE) { uart_transfer_complete_callback(&stream); } } diff --git a/ci/stm32cube/nucleo_f103rb.ioc b/ci/stm32cube/ioc/nucleo_f103rb.ioc similarity index 100% rename from ci/stm32cube/nucleo_f103rb.ioc rename to ci/stm32cube/ioc/nucleo_f103rb.ioc diff --git a/ci/stm32cube/ioc/nucleo_f767zi.ioc b/ci/stm32cube/ioc/nucleo_f767zi.ioc new file mode 100644 index 00000000..aebeca36 --- /dev/null +++ b/ci/stm32cube/ioc/nucleo_f767zi.ioc @@ -0,0 +1,316 @@ +#MicroXplorer Configuration settings - do not modify +Dma.Request0=USART3_RX +Dma.Request1=USART3_TX +Dma.RequestsNb=2 +Dma.USART3_RX.0.Direction=DMA_PERIPH_TO_MEMORY +Dma.USART3_RX.0.FIFOMode=DMA_FIFOMODE_DISABLE +Dma.USART3_RX.0.Instance=DMA1_Stream1 +Dma.USART3_RX.0.MemDataAlignment=DMA_MDATAALIGN_BYTE +Dma.USART3_RX.0.MemInc=DMA_MINC_ENABLE +Dma.USART3_RX.0.Mode=DMA_CIRCULAR +Dma.USART3_RX.0.PeriphDataAlignment=DMA_PDATAALIGN_BYTE +Dma.USART3_RX.0.PeriphInc=DMA_PINC_DISABLE +Dma.USART3_RX.0.Priority=DMA_PRIORITY_VERY_HIGH +Dma.USART3_RX.0.RequestParameters=Instance,Direction,PeriphInc,MemInc,PeriphDataAlignment,MemDataAlignment,Mode,Priority,FIFOMode +Dma.USART3_TX.1.Direction=DMA_MEMORY_TO_PERIPH +Dma.USART3_TX.1.FIFOMode=DMA_FIFOMODE_DISABLE +Dma.USART3_TX.1.Instance=DMA1_Stream3 +Dma.USART3_TX.1.MemDataAlignment=DMA_MDATAALIGN_BYTE +Dma.USART3_TX.1.MemInc=DMA_MINC_ENABLE +Dma.USART3_TX.1.Mode=DMA_NORMAL +Dma.USART3_TX.1.PeriphDataAlignment=DMA_PDATAALIGN_BYTE +Dma.USART3_TX.1.PeriphInc=DMA_PINC_DISABLE +Dma.USART3_TX.1.Priority=DMA_PRIORITY_VERY_HIGH +Dma.USART3_TX.1.RequestParameters=Instance,Direction,PeriphInc,MemInc,PeriphDataAlignment,MemDataAlignment,Mode,Priority,FIFOMode +File.Version=6 +KeepUserPlacement=false +Mcu.Family=STM32F7 +Mcu.IP0=CORTEX_M7 +Mcu.IP1=DMA +Mcu.IP2=NVIC +Mcu.IP3=RCC +Mcu.IP4=SYS +Mcu.IP5=USART3 +Mcu.IPNb=6 +Mcu.Name=STM32F767ZITx +Mcu.Package=LQFP144 +Mcu.Pin0=PC13 +Mcu.Pin1=PC14/OSC32_IN +Mcu.Pin10=PC5 +Mcu.Pin11=PB0 +Mcu.Pin12=PB13 +Mcu.Pin13=PB14 +Mcu.Pin14=PD8 +Mcu.Pin15=PD9 +Mcu.Pin16=PG6 +Mcu.Pin17=PG7 +Mcu.Pin18=PA8 +Mcu.Pin19=PA9 +Mcu.Pin2=PC15/OSC32_OUT +Mcu.Pin20=PA10 +Mcu.Pin21=PA11 +Mcu.Pin22=PA12 +Mcu.Pin23=PA13 +Mcu.Pin24=PA14 +Mcu.Pin25=PG11 +Mcu.Pin26=PG13 +Mcu.Pin27=PB3 +Mcu.Pin28=PB7 +Mcu.Pin29=VP_SYS_VS_Systick +Mcu.Pin3=PH0/OSC_IN +Mcu.Pin4=PH1/OSC_OUT +Mcu.Pin5=PC1 +Mcu.Pin6=PA1 +Mcu.Pin7=PA2 +Mcu.Pin8=PA7 +Mcu.Pin9=PC4 +Mcu.PinsNb=30 +Mcu.ThirdPartyNb=0 +Mcu.UserConstants= +Mcu.UserName=STM32F767ZITx +MxCube.Version=6.3.0 +MxDb.Version=DB.6.0.30 +NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:true\:false +NVIC.DMA1_Stream1_IRQn=true\:0\:0\:false\:false\:true\:false\:true +NVIC.DMA1_Stream3_IRQn=true\:0\:0\:false\:false\:true\:false\:true +NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:true\:false +NVIC.ForceEnableDMAVector=true +NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:true\:false +NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:true\:false +NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:true\:false +NVIC.PendSV_IRQn=true\:0\:0\:false\:false\:true\:true\:false +NVIC.PriorityGroup=NVIC_PRIORITYGROUP_4 +NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:true\:true\:false +NVIC.SysTick_IRQn=true\:0\:0\:false\:false\:true\:true\:true +NVIC.USART3_IRQn=true\:0\:0\:false\:false\:true\:true\:true +NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:true\:false +PA1.GPIOParameters=GPIO_Label +PA1.GPIO_Label=RMII_REF_CLK [LAN8742A-CZ-TR_REFCLK0] +PA1.Locked=true +PA1.Signal=ETH_REF_CLK +PA10.GPIOParameters=GPIO_Label +PA10.GPIO_Label=USB_ID +PA10.Locked=true +PA10.Signal=USB_OTG_FS_ID +PA11.GPIOParameters=GPIO_Label +PA11.GPIO_Label=USB_DM +PA11.Locked=true +PA11.Signal=USB_OTG_FS_DM +PA12.GPIOParameters=GPIO_Label +PA12.GPIO_Label=USB_DP +PA12.Locked=true +PA12.Signal=USB_OTG_FS_DP +PA13.GPIOParameters=GPIO_Label +PA13.GPIO_Label=TMS +PA13.Locked=true +PA13.Signal=SYS_JTMS-SWDIO +PA14.GPIOParameters=GPIO_Label +PA14.GPIO_Label=TCK +PA14.Locked=true +PA14.Signal=SYS_JTCK-SWCLK +PA2.GPIOParameters=GPIO_Label +PA2.GPIO_Label=RMII_MDIO [LAN8742A-CZ-TR_MDIO] +PA2.Locked=true +PA2.Signal=ETH_MDIO +PA7.GPIOParameters=GPIO_Label +PA7.GPIO_Label=RMII_CRS_DV [LAN8742A-CZ-TR_CRS_DV] +PA7.Locked=true +PA7.Signal=ETH_CRS_DV +PA8.GPIOParameters=GPIO_Label +PA8.GPIO_Label=USB_SOF [TP1] +PA8.Locked=true +PA8.Signal=USB_OTG_FS_SOF +PA9.GPIOParameters=GPIO_Label +PA9.GPIO_Label=USB_VBUS +PA9.Locked=true +PA9.Signal=USB_OTG_FS_VBUS +PB0.GPIOParameters=GPIO_Label +PB0.GPIO_Label=LD1 [Green] +PB0.Locked=true +PB0.Signal=GPIO_Output +PB13.GPIOParameters=GPIO_Label +PB13.GPIO_Label=RMII_TXD1 [LAN8742A-CZ-TR_TXD1] +PB13.Locked=true +PB13.Signal=ETH_TXD1 +PB14.GPIOParameters=GPIO_Label +PB14.GPIO_Label=LD3 [Red] +PB14.Locked=true +PB14.Signal=GPIO_Output +PB3.GPIOParameters=GPIO_Label +PB3.GPIO_Label=SW0 +PB3.Locked=true +PB3.Signal=SYS_JTDO-SWO +PB7.GPIOParameters=GPIO_Label +PB7.GPIO_Label=LD2 [Blue] +PB7.Locked=true +PB7.Signal=GPIO_Output +PC1.GPIOParameters=GPIO_Label +PC1.GPIO_Label=RMII_MDC [LAN8742A-CZ-TR_MDC] +PC1.Locked=true +PC1.Signal=ETH_MDC +PC13.GPIOParameters=GPIO_Label +PC13.GPIO_Label=USER_Btn [B1] +PC13.Locked=true +PC13.Signal=GPXTI13 +PC14/OSC32_IN.Locked=true +PC14/OSC32_IN.Signal=RCC_OSC32_IN +PC15/OSC32_OUT.Locked=true +PC15/OSC32_OUT.Signal=RCC_OSC32_OUT +PC4.GPIOParameters=GPIO_Label +PC4.GPIO_Label=RMII_RXD0 [LAN8742A-CZ-TR_RXD0] +PC4.Locked=true +PC4.Signal=ETH_RXD0 +PC5.GPIOParameters=GPIO_Label +PC5.GPIO_Label=RMII_RXD1 [LAN8742A-CZ-TR_RXD1] +PC5.Locked=true +PC5.Signal=ETH_RXD1 +PD8.GPIOParameters=GPIO_Label +PD8.GPIO_Label=STLK_RX [STM32F103CBT6_PA3] +PD8.Locked=true +PD8.Mode=Asynchronous +PD8.Signal=USART3_TX +PD9.GPIOParameters=GPIO_Label +PD9.GPIO_Label=STLK_TX [STM32F103CBT6_PA2] +PD9.Locked=true +PD9.Mode=Asynchronous +PD9.Signal=USART3_RX +PG11.GPIOParameters=GPIO_Label +PG11.GPIO_Label=RMII_TX_EN [LAN8742A-CZ-TR_TXEN] +PG11.Locked=true +PG11.Signal=ETH_TX_EN +PG13.GPIOParameters=GPIO_Label +PG13.GPIO_Label=RMII_TXD0 [LAN8742A-CZ-TR_TXD0] +PG13.Locked=true +PG13.Signal=ETH_TXD0 +PG6.GPIOParameters=GPIO_Label +PG6.GPIO_Label=USB_PowerSwitchOn [STMPS2151STR_EN] +PG6.Locked=true +PG6.Signal=GPIO_Output +PG7.GPIOParameters=GPIO_Label +PG7.GPIO_Label=USB_OverCurrent [STMPS2151STR_FAULT] +PG7.Locked=true +PG7.Signal=GPIO_Input +PH0/OSC_IN.GPIOParameters=GPIO_Label +PH0/OSC_IN.GPIO_Label=MCO [STM32F103CBT6_PA8] +PH0/OSC_IN.Locked=true +PH0/OSC_IN.Signal=RCC_OSC_IN +PH1/OSC_OUT.Locked=true +PH1/OSC_OUT.Signal=RCC_OSC_OUT +PinOutPanel.RotationAngle=0 +ProjectManager.AskForMigrate=true +ProjectManager.BackupPrevious=false +ProjectManager.CompilerOptimize=6 +ProjectManager.ComputerToolchain=false +ProjectManager.CoupleFile=true +ProjectManager.CustomerFirmwarePackage= +ProjectManager.DefaultFWLocation=true +ProjectManager.DeletePrevious=true +ProjectManager.DeviceId=STM32F767ZITx +ProjectManager.FirmwarePackage=STM32Cube FW_F7 V1.16.2 +ProjectManager.FreePins=false +ProjectManager.HalAssertFull=false +ProjectManager.HeapSize=0x200 +ProjectManager.KeepUserCode=true +ProjectManager.LastFirmware=true +ProjectManager.LibraryCopy=1 +ProjectManager.MainLocation=Core/Src +ProjectManager.NoMain=false +ProjectManager.PreviousToolchain= +ProjectManager.ProjectBuild=false +ProjectManager.ProjectFileName=nucleo_f767zi.ioc +ProjectManager.ProjectName=nucleo_f767zi +ProjectManager.RegisterCallBack= +ProjectManager.StackSize=0x400 +ProjectManager.TargetToolchain=Other Toolchains (GPDSC) +ProjectManager.ToolChainLocation= +ProjectManager.UnderRoot=false +ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-SystemClock_Config-RCC-false-HAL-false,3-MX_DMA_Init-DMA-false-HAL-true,4-MX_USART3_UART_Init-USART3-false-HAL-true,0-MX_CORTEX_M7_Init-CORTEX_M7-false-HAL-true +RCC.48MHZClocksFreq_Value=24000000 +RCC.ADC12outputFreq_Value=72000000 +RCC.ADC34outputFreq_Value=72000000 +RCC.AHBFreq_Value=16000000 +RCC.APB1CLKDivider=RCC_HCLK_DIV2 +RCC.APB1Freq_Value=8000000 +RCC.APB1TimFreq_Value=16000000 +RCC.APB2Freq_Value=16000000 +RCC.APB2TimFreq_Value=16000000 +RCC.CECFreq_Value=32786.88524590164 +RCC.CortexFreq_Value=16000000 +RCC.DFSDMFreq_Value=16000000 +RCC.EthernetFreq_Value=16000000 +RCC.FCLKCortexFreq_Value=16000000 +RCC.FamilyName=M +RCC.HCLKFreq_Value=16000000 +RCC.HSE_VALUE=16000000 +RCC.HSI_VALUE=16000000 +RCC.I2C1Freq_Value=8000000 +RCC.I2C2Freq_Value=8000000 +RCC.I2C3Freq_Value=8000000 +RCC.I2C4Freq_Value=8000000 +RCC.I2SClocksFreq_Value=48000000 +RCC.I2SFreq_Value=96000000 +RCC.IPParameters=48MHZClocksFreq_Value,ADC12outputFreq_Value,ADC34outputFreq_Value,AHBFreq_Value,APB1CLKDivider,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,CECFreq_Value,CortexFreq_Value,DFSDMFreq_Value,EthernetFreq_Value,FCLKCortexFreq_Value,FamilyName,HCLKFreq_Value,HSE_VALUE,HSI_VALUE,I2C1Freq_Value,I2C2Freq_Value,I2C3Freq_Value,I2C4Freq_Value,I2SClocksFreq_Value,I2SFreq_Value,LCDTFTFreq_Value,LCDTFToutputFreq_Value,LPTIM1Freq_Value,LSE_VALUE,LSI_VALUE,MCO1PinFreq_Value,MCO2PinFreq_Value,MCOFreq_Value,PLLCLKFreq_Value,PLLI2SPCLKFreq_Value,PLLI2SQCLKFreq_Value,PLLI2SRCLKFreq_Value,PLLI2SRoutputFreq_Value,PLLMCOFreq_Value,PLLMUL,PLLQCLKFreq_Value,PLLQoutputFreq_Value,PLLSAIPCLKFreq_Value,PLLSAIQCLKFreq_Value,PLLSAIRCLKFreq_Value,PLLSAIoutputFreq_Value,PRESCALERUSB,RNGFreq_Value,RTCFreq_Value,RTCHSEDivFreq_Value,SAI1Freq_Value,SAI2Freq_Value,SDMMC2Freq_Value,SDMMCFreq_Value,SPDIFRXFreq_Value,SYSCLKFreq_VALUE,SYSCLKSourceVirtual,TIM15Freq_Value,TIM16Freq_Value,TIM17Freq_Value,TIM1Freq_Value,TIM20Freq_Value,TIM2Freq_Value,TIM3Freq_Value,TIM8Freq_Value,UART4Freq_Value,UART5Freq_Value,UART7Freq_Value,UART8Freq_Value,USART1Freq_Value,USART2Freq_Value,USART3Freq_Value,USART6Freq_Value,USBFreq_Value,VCOI2SOutputFreq_Value,VCOInputFreq_Value,VCOOutput2Freq_Value,VCOOutputFreq_Value,VCOSAIOutputFreq_Value,VcooutputI2S,WatchDogFreq_Value +RCC.LCDTFTFreq_Value=48000000 +RCC.LCDTFToutputFreq_Value=24000000 +RCC.LPTIM1Freq_Value=8000000 +RCC.LSE_VALUE=32768 +RCC.LSI_VALUE=32000 +RCC.MCO1PinFreq_Value=16000000 +RCC.MCO2PinFreq_Value=16000000 +RCC.MCOFreq_Value=72000000 +RCC.PLLCLKFreq_Value=96000000 +RCC.PLLI2SPCLKFreq_Value=96000000 +RCC.PLLI2SQCLKFreq_Value=96000000 +RCC.PLLI2SRCLKFreq_Value=96000000 +RCC.PLLI2SRoutputFreq_Value=96000000 +RCC.PLLMCOFreq_Value=72000000 +RCC.PLLMUL=RCC_PLL_MUL9 +RCC.PLLQCLKFreq_Value=96000000 +RCC.PLLQoutputFreq_Value=96000000 +RCC.PLLSAIPCLKFreq_Value=96000000 +RCC.PLLSAIQCLKFreq_Value=96000000 +RCC.PLLSAIRCLKFreq_Value=96000000 +RCC.PLLSAIoutputFreq_Value=96000000 +RCC.PRESCALERUSB=RCC_USBCLKSOURCE_PLL_DIV1_5 +RCC.RNGFreq_Value=96000000 +RCC.RTCFreq_Value=32000 +RCC.RTCHSEDivFreq_Value=4000000 +RCC.SAI1Freq_Value=96000000 +RCC.SAI2Freq_Value=96000000 +RCC.SDMMC2Freq_Value=16000000 +RCC.SDMMCFreq_Value=16000000 +RCC.SPDIFRXFreq_Value=96000000 +RCC.SYSCLKFreq_VALUE=16000000 +RCC.SYSCLKSourceVirtual=RCC_SYSCLKSOURCE_PLLCLK +RCC.TIM15Freq_Value=72000000 +RCC.TIM16Freq_Value=72000000 +RCC.TIM17Freq_Value=72000000 +RCC.TIM1Freq_Value=72000000 +RCC.TIM20Freq_Value=72000000 +RCC.TIM2Freq_Value=72000000 +RCC.TIM3Freq_Value=72000000 +RCC.TIM8Freq_Value=72000000 +RCC.UART4Freq_Value=8000000 +RCC.UART5Freq_Value=8000000 +RCC.UART7Freq_Value=8000000 +RCC.UART8Freq_Value=8000000 +RCC.USART1Freq_Value=16000000 +RCC.USART2Freq_Value=8000000 +RCC.USART3Freq_Value=8000000 +RCC.USART6Freq_Value=16000000 +RCC.USBFreq_Value=96000000 +RCC.VCOI2SOutputFreq_Value=192000000 +RCC.VCOInputFreq_Value=1000000 +RCC.VCOOutput2Freq_Value=8000000 +RCC.VCOOutputFreq_Value=192000000 +RCC.VCOSAIOutputFreq_Value=192000000 +RCC.VcooutputI2S=48000000 +RCC.WatchDogFreq_Value=32000 +SH.GPXTI13.0=GPIO_EXTI13 +SH.GPXTI13.ConfNb=1 +USART3.IPParameters=VirtualMode-Asynchronous +USART3.VirtualMode-Asynchronous=VM_ASYNC +VP_SYS_VS_Systick.Mode=SysTick +VP_SYS_VS_Systick.Signal=SYS_VS_Systick +board=NUCLEO-F767ZI +boardIOC=true diff --git a/ci/stm32cube/platformio.ini b/ci/stm32cube/platformio.ini index 03eabb3c..445314c8 100644 --- a/ci/stm32cube/platformio.ini +++ b/ci/stm32cube/platformio.ini @@ -11,6 +11,14 @@ board_microros_transport = serial board_microros_user_meta = custom.meta build_flags= -DSTM32F1xx + -DUART_HANDLE=huart2 + +[env:nucleo_f767zi] +board = nucleo_f767zi +board_microros_transport = serial +build_flags= + -DSTM32F7xx + -DUART_HANDLE=huart3 [platformio] include_dir = Inc From 5552498963e06bbf1fa296242639f413bbf0b50d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C5=82a=C5=BCej=20Sowa?= Date: Thu, 22 Sep 2022 16:33:25 +0200 Subject: [PATCH 22/23] Set default colcon metas for nucleo boards --- ci/stm32cube/custom.meta | 15 --------------- ci/stm32cube/platformio.ini | 1 - extra_script.py | 5 +++-- 3 files changed, 3 insertions(+), 18 deletions(-) delete mode 100644 ci/stm32cube/custom.meta diff --git a/ci/stm32cube/custom.meta b/ci/stm32cube/custom.meta deleted file mode 100644 index 866bcd0d..00000000 --- a/ci/stm32cube/custom.meta +++ /dev/null @@ -1,15 +0,0 @@ -{ - "names": { - "rmw_microxrcedds": { - "cmake-args": [ - "-DRMW_UXRCE_MAX_NODES=1", - "-DRMW_UXRCE_MAX_PUBLISHERS=2", - "-DRMW_UXRCE_MAX_SUBSCRIPTIONS=1", - "-DRMW_UXRCE_MAX_SERVICES=0", - "-DRMW_UXRCE_MAX_CLIENTS=1", - "-DRMW_UXRCE_MAX_HISTORY=1", - "-DRMW_UXRCE_TRANSPORT=custom" - ] - } - } -} \ No newline at end of file diff --git a/ci/stm32cube/platformio.ini b/ci/stm32cube/platformio.ini index 445314c8..c1d02fe5 100644 --- a/ci/stm32cube/platformio.ini +++ b/ci/stm32cube/platformio.ini @@ -8,7 +8,6 @@ lib_deps = [env:nucleo_f103rb] board = nucleo_f103rb board_microros_transport = serial -board_microros_user_meta = custom.meta build_flags= -DSTM32F1xx -DUART_HANDLE=huart2 diff --git a/extra_script.py b/extra_script.py index 33700b9f..6da026d3 100644 --- a/extra_script.py +++ b/extra_script.py @@ -21,8 +21,9 @@ "olimex_e407" : "colcon.meta", "due" : "colcon_verylowmem.meta", "zero" : "colcon_verylowmem.meta", - "pico": "colcon.meta" - + "pico": "colcon.meta", + "nucleo_f103rb": "colcon_verylowmem.meta", + "nucleo_f767zi": "colcon.meta" } project_options = env.GetProjectConfig().items(env=env["PIOENV"], as_dict=True) From a69ff6500ccbcec0ebbc7b3b047acaf3d8bbfcb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C5=82a=C5=BCej=20Sowa?= Date: Thu, 22 Sep 2022 16:35:28 +0200 Subject: [PATCH 23/23] Add nucleo board to supported boards --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 0012e730..2c7d2133 100755 --- a/README.md +++ b/README.md @@ -40,6 +40,8 @@ Supported boards are: | `esp32dev` | `espressif32` | `arduino` | `serial`
`wifi` | `colcon.meta` | | `nanorp2040connect` | `raspberrypi` | `arduino` | `serial`
`wifi_nina` | `colcon_verylowmem.meta` | | `pico` | `raspberrypi` | `arduino` | `serial` | `colcon.meta`| +| `nucleo_f103rb` | `ststm32` | `stm32cube` | `serial` | `colcon_verylowmem.meta` | +| `nucleo_f767zi` | `ststm32` | `stm32cube` | `serial` | `colcon.meta`| The community is encouraged to open pull request with custom use cases.