From 9437945745bcf5c861eb6df2c67d9cf8a45e1e5b Mon Sep 17 00:00:00 2001 From: pmantoine Date: Sun, 29 Oct 2023 17:34:51 +0800 Subject: [PATCH] STM32F439ZI updates --- DCCTimerSTM32.cpp | 2 +- I2CManager_STM32.h | 3 ++- platformio.ini | 24 ++++++++++++------------ 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/DCCTimerSTM32.cpp b/DCCTimerSTM32.cpp index f2d51ff..13694aa 100644 --- a/DCCTimerSTM32.cpp +++ b/DCCTimerSTM32.cpp @@ -52,7 +52,7 @@ HardwareSerial Serial6(PA12, PA11); // Rx=PA12, Tx=PA11 -- CN10 pins 12 and 14 HardwareSerial Serial3(PC11, PC10); // Rx=PC11, Tx=PC10 -- USART3 - F446RE HardwareSerial Serial5(PD2, PC12); // Rx=PC7, Tx=PC6 -- UART5 - F446RE // On the F446RE, Serial4 and Serial6 also use pins we can't readily map while using the Arduino pins -#elif defined(ARDUINO_NUCLEO_F412ZG) || defined(ARDUINO_NUCLEO_F413ZH) || defined(ARDUINO_NUCLEO_F429ZI) || defined(ARDUINO_NUCLEO_F446ZE) +#elif defined(ARDUINO_NUCLEO_F412ZG) || defined(ARDUINO_NUCLEO_F413ZH) || defined(ARDUINO_NUCLEO_F429ZI) || defined(ARDUINO_NUCLEO_F439ZI) || defined(ARDUINO_NUCLEO_F446ZE) // Nucleo-144 boards don't have Serial1 defined by default HardwareSerial Serial6(PG9, PG14); // Rx=PG9, Tx=PG14 -- USART6 // Serial3 is defined to use USART3 by default, but is in fact used as the diag console diff --git a/I2CManager_STM32.h b/I2CManager_STM32.h index 7e0f547..f386959 100644 --- a/I2CManager_STM32.h +++ b/I2CManager_STM32.h @@ -39,7 +39,8 @@ #if defined(I2C_USE_INTERRUPTS) && defined(ARDUINO_ARCH_STM32) #if defined(ARDUINO_NUCLEO_F401RE) || defined(ARDUINO_NUCLEO_F411RE) || defined(ARDUINO_NUCLEO_F446RE) \ || defined(ARDUINO_NUCLEO_F412ZG) || defined(ARDUINO_NUCLEO_F413ZH) \ - || defined(ARDUINO_NUCLEO_F429ZI) || defined(ARDUINO_NUCLEO_F446ZE) + || defined(ARDUINO_NUCLEO_F429ZI) || defined(ARDUINO_NUCLEO_F439ZI) \ + || defined(ARDUINO_NUCLEO_F446ZE) // Assume I2C1 for now - default I2C bus on Nucleo-F411RE and likely all Nucleo-64 // and Nucleo-144 variants I2C_TypeDef *s = I2C1; diff --git a/platformio.ini b/platformio.ini index e1ddfb5..f13d4f5 100644 --- a/platformio.ini +++ b/platformio.ini @@ -261,18 +261,18 @@ upload_protocol = stlink ; Experimental - Ethernet work still in progress ; Commented out as the F439ZI also needs variant files ; -; [env:Nucleo-F439ZI] -; platform = ststm32 -; board = nucleo_f429zi -; framework = arduino -; lib_deps = ${env.lib_deps} -; arduino-libraries/Ethernet @ ^2.0.1 -; stm32duino/STM32Ethernet @ ^1.3.0 -; stm32duino/STM32duino LwIP @ ^2.1.2 -; build_flags = -std=c++17 -Os -g2 -Wunused-variable -; monitor_speed = 115200 -; monitor_echo = yes -; upload_protocol = stlink +[env:Nucleo-F439ZI] +platform = ststm32 +board = nucleo_f429zi +framework = arduino +lib_deps = ${env.lib_deps} + arduino-libraries/Ethernet @ ^2.0.1 + stm32duino/STM32Ethernet @ ^1.3.0 + stm32duino/STM32duino LwIP @ ^2.1.2 +build_flags = -std=c++17 -Os -g2 -Wunused-variable +monitor_speed = 115200 +monitor_echo = yes +upload_protocol = stlink [env:Teensy3_2] platform = teensy