Skip to content

Commit 15530c9

Browse files
committed
2 parents 83a4682 + 835a014 commit 15530c9

File tree

21 files changed

+1778
-28
lines changed

21 files changed

+1778
-28
lines changed

README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ User can add a STM32 based board following this [wiki](https://github.com/stm32d
125125
| :green_heart: | [DIYMORE STM32F407VGT](https://stm32-base.org/boards/STM32F407VGT6-diymore) | *1.5.0* | |
126126
| :green_heart: | FK407M1 | *1.5.0* | |
127127
| :green_heart: | Generic F401R(B-C-D-E) | *1.8.0* | |
128+
| :yellow_heart: | Generic F411C(C-E) | **1.9.0** | |
129+
| :yellow_heart: | Generic F411R(C-E) | **1.9.0** | |
128130

129131
| Status | Generic STM32L0xx | Release | Comment |
130132
| :---: | --- | :---: | :--- |
@@ -147,7 +149,7 @@ User can add a STM32 based board following this [wiki](https://github.com/stm32d
147149

148150
| Status | LoRa boards | Release | Comment |
149151
| :---: | --- | :---: | :--- |
150-
| :green_heart: | [RAK811 LoRa Tracker](https://www.rakwireless.com/en/) | *1.4.0* | Basic support |
152+
| :green_heart: | [RAK811 LoRa Tracker](https://www.rakwireless.com/en/) | *1.4.0* | [Wiki](https://github.com/stm32duino/wiki/wiki/Connectivities#lora) |
151153
| :green_heart: | [RHF76-052](https://www.ai-thinker.com/) | *1.7.0* | Basic support |
152154

153155
| Status | Electronic Speed Controller boards | Release | Comment |
@@ -161,7 +163,7 @@ User can add a STM32 based board following this [wiki](https://github.com/stm32d
161163

162164
| Status | [Midatronics](https://midatronics.com/) | Release | Comment |
163165
| :---: | --- | :---: | :--- |
164-
| :green_heart: | [SharkyMKR](https://midatronics.com/Development_Boards/MKR_Sharky_I) | *1.7.0* | |
166+
| :green_heart: | [SharkyMKR](https://midatronics.com/shop/development-boards/mkr-sharky-i/) | *1.7.0* | |
165167

166168
## Next release
167169

boards.txt

+32
Original file line numberDiff line numberDiff line change
@@ -1025,6 +1025,38 @@ GenF4.menu.pnum.FEATHER_F405.build.board=FEATHER_F405
10251025
GenF4.menu.pnum.FEATHER_F405.build.product_line=STM32F405xx
10261026
GenF4.menu.pnum.FEATHER_F405.build.variant=FEATHER_F405
10271027

1028+
# Generic F411RE
1029+
GenF4.menu.pnum.Generic_F411RE=Generic F411RE
1030+
GenF4.menu.pnum.Generic_F411RE.upload.maximum_size=524288
1031+
GenF4.menu.pnum.Generic_F411RE.upload.maximum_data_size=131072
1032+
GenF4.menu.pnum.Generic_F411RE.build.board=GENERIC_F411RE
1033+
GenF4.menu.pnum.Generic_F411RE.build.product_line=STM32F411xE
1034+
GenF4.menu.pnum.Generic_F411RE.build.variant=Generic_F411Rx
1035+
1036+
# Generic F411RC
1037+
GenF4.menu.pnum.Generic_F411RC=Generic F411RC
1038+
GenF4.menu.pnum.Generic_F411RC.upload.maximum_size=262144
1039+
GenF4.menu.pnum.Generic_F411RC.upload.maximum_data_size=131072
1040+
GenF4.menu.pnum.Generic_F411RC.build.board=GENERIC_F411RC
1041+
GenF4.menu.pnum.Generic_F411RC.build.product_line=STM32F411xE
1042+
GenF4.menu.pnum.Generic_F411RC.build.variant=Generic_F411Rx
1043+
1044+
# Generic F411CE
1045+
GenF4.menu.pnum.Generic_F411CE=Generic F411CE
1046+
GenF4.menu.pnum.Generic_F411CE.upload.maximum_size=524288
1047+
GenF4.menu.pnum.Generic_F411CE.upload.maximum_data_size=131072
1048+
GenF4.menu.pnum.Generic_F411CE.build.board=GENERIC_F411CE
1049+
GenF4.menu.pnum.Generic_F411CE.build.product_line=STM32F411xE
1050+
GenF4.menu.pnum.Generic_F411CE.build.variant=Generic_F411Cx
1051+
1052+
# Generic F411CC
1053+
GenF4.menu.pnum.Generic_F411CC=Generic F411CC
1054+
GenF4.menu.pnum.Generic_F411CC.upload.maximum_size=262144
1055+
GenF4.menu.pnum.Generic_F411CC.upload.maximum_data_size=131072
1056+
GenF4.menu.pnum.Generic_F411CC.build.board=GENERIC_F411CC
1057+
GenF4.menu.pnum.Generic_F411CC.build.product_line=STM32F411xE
1058+
GenF4.menu.pnum.Generic_F411CC.build.variant=Generic_F411Cx
1059+
10281060
# Generic F401RE
10291061
GenF4.menu.pnum.Generic_F401RE=Generic F401RE
10301062
GenF4.menu.pnum.Generic_F401RE.upload.maximum_size=524288

cores/arduino/HardwareTimer.cpp

+26-12
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,11 @@ void HardwareTimer::resume(void)
158158
if (callbacks[0] != NULL) {
159159
__HAL_TIM_CLEAR_FLAG(&(_timerObj.handle), TIM_FLAG_UPDATE);
160160
__HAL_TIM_ENABLE_IT(&(_timerObj.handle), TIM_IT_UPDATE);
161+
162+
// Start timer in Time base mode. Required when there is no channel used but only update interrupt.
163+
HAL_TIM_Base_Start(&(_timerObj.handle));
161164
}
165+
162166
// Resume all channels
163167
resumeChannel(1);
164168
resumeChannel(2);
@@ -848,12 +852,17 @@ void HardwareTimer::setInterruptPriority(uint32_t preemptPriority, uint32_t subP
848852
*/
849853
void HardwareTimer::attachInterrupt(void (*callback)(HardwareTimer *))
850854
{
851-
callbacks[0] = callback;
852-
if (callback != NULL) {
853-
// Clear flag before enabling IT
854-
__HAL_TIM_CLEAR_FLAG(&(_timerObj.handle), TIM_FLAG_UPDATE);
855-
// Enable update interrupt only if callback is valid
856-
__HAL_TIM_ENABLE_IT(&(_timerObj.handle), TIM_IT_UPDATE);
855+
if (callbacks[0] != NULL) {
856+
// Callback previously configured : do not clear neither enable IT, it is just a change of callback
857+
callbacks[0] = callback;
858+
} else {
859+
callbacks[0] = callback;
860+
if (callback != NULL) {
861+
// Clear flag before enabling IT
862+
__HAL_TIM_CLEAR_FLAG(&(_timerObj.handle), TIM_FLAG_UPDATE);
863+
// Enable update interrupt only if callback is valid
864+
__HAL_TIM_ENABLE_IT(&(_timerObj.handle), TIM_IT_UPDATE);
865+
}
857866
}
858867
}
859868

@@ -885,12 +894,17 @@ void HardwareTimer::attachInterrupt(uint32_t channel, void (*callback)(HardwareT
885894
Error_Handler(); // only channel 1..4 have an interrupt
886895
}
887896

888-
callbacks[channel] = callback;
889-
if (callback != NULL) {
890-
// Clear flag before enabling IT
891-
__HAL_TIM_CLEAR_FLAG(&(_timerObj.handle), interrupt);
892-
// Enable interrupt corresponding to channel, only if callback is valid
893-
__HAL_TIM_ENABLE_IT(&(_timerObj.handle), interrupt);
897+
if (callbacks[channel] != NULL) {
898+
// Callback previously configured : do not clear neither enable IT, it is just a change of callback
899+
callbacks[channel] = callback;
900+
} else {
901+
callbacks[channel] = callback;
902+
if (callback != NULL) {
903+
// Clear flag before enabling IT
904+
__HAL_TIM_CLEAR_FLAG(&(_timerObj.handle), interrupt);
905+
// Enable interrupt corresponding to channel, only if callback is valid
906+
__HAL_TIM_ENABLE_IT(&(_timerObj.handle), interrupt);
907+
}
894908
}
895909
}
896910

cores/arduino/Print.cpp

+3-6
Original file line numberDiff line numberDiff line change
@@ -200,22 +200,19 @@ extern "C" {
200200
__attribute__((weak))
201201
int _write(int file, char *ptr, int len)
202202
{
203-
#if defined(HAL_UART_MODULE_ENABLED) && !defined(HAL_UART_MODULE_ONLY)
204203
switch (file) {
205204
case STDOUT_FILENO:
206205
case STDERR_FILENO:
206+
#if defined(HAL_UART_MODULE_ENABLED) && !defined(HAL_UART_MODULE_ONLY)
207+
/* Used for core_debug() */
207208
uart_debug_write((uint8_t *)ptr, (uint32_t)len);
208-
break;
209+
#endif
209210
case STDIN_FILENO:
210211
break;
211212
default:
212213
((class Print *)file)->write((uint8_t *)ptr, len);
213214
break;
214215
}
215-
#else
216-
(void)file;
217-
(void)ptr;
218-
#endif
219216
return len;
220217
}
221218
}

cores/arduino/stm32/stm32_def.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
* @brief STM32 core version number
77
*/
88
#define STM32_CORE_VERSION_MAJOR (0x01U) /*!< [31:24] major version */
9-
#define STM32_CORE_VERSION_MINOR (0x08U) /*!< [23:16] minor version */
9+
#define STM32_CORE_VERSION_MINOR (0x09U) /*!< [23:16] minor version */
1010
#define STM32_CORE_VERSION_PATCH (0x00U) /*!< [15:8] patch version */
1111
/*
1212
* Extra label for development:
1313
* 0: official release
1414
* [1-9]: release candidate
1515
* F[0-9]: development
1616
*/
17-
#define STM32_CORE_VERSION_EXTRA (0x00U) /*!< [7:0] extra version */
17+
#define STM32_CORE_VERSION_EXTRA (0xF0U) /*!< [7:0] extra version */
1818
#define STM32_CORE_VERSION ((STM32_CORE_VERSION_MAJOR << 24U)\
1919
|(STM32_CORE_VERSION_MINOR << 16U)\
2020
|(STM32_CORE_VERSION_PATCH << 8U )\

cores/arduino/stm32/timer.h

+5
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,13 @@ extern "C" {
5151
#define TIM1_IRQn TIM1_UP_TIM16_IRQn
5252
#define TIM1_IRQHandler TIM1_UP_TIM16_IRQHandler
5353
#elif defined(STM32F2xx) || defined(STM32F4xx) || defined(STM32F7xx)
54+
#if !defined (TIM10_BASE)
55+
#define TIM1_IRQn TIM1_UP_IRQn
56+
#define TIM1_IRQHandler TIM1_UP_IRQHandler
57+
#else
5458
#define TIM1_IRQn TIM1_UP_TIM10_IRQn
5559
#define TIM1_IRQHandler TIM1_UP_TIM10_IRQHandler
60+
#endif
5661
#elif defined(STM32H7xx) || defined(STM32MP1xx)
5762
#define TIM1_IRQn TIM1_UP_IRQn
5863
#define TIM1_IRQHandler TIM1_UP_IRQHandler

cores/arduino/stm32/uart.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ struct serial_s {
9999
#endif /* STM32F091xC || STM32F098xx */
100100
#endif /* STM32F0xx */
101101

102-
#if defined(STM32G0xx)
102+
#if defined(STM32G0xx) && !defined(STM32G030xx) && !defined(STM32G031xx) && !defined(STM32G041xx)
103103
#define USART3_IRQn USART3_4_LPUART1_IRQn
104104
#define USART3_IRQHandler USART3_4_LPUART1_IRQHandler
105105
#endif /* STM32G0xx */
@@ -118,7 +118,7 @@ struct serial_s {
118118
#elif defined(STM32L0xx)
119119
#define USART4_IRQn USART4_5_IRQn
120120
#endif /* STM32F0xx */
121-
#if defined(STM32G0xx)
121+
#if defined(STM32G0xx) && !defined(STM32G030xx) && !defined(STM32G031xx) && !defined(STM32G041xx)
122122
#define USART4_IRQn USART3_4_LPUART1_IRQn
123123
#endif /* STM32G0xx */
124124

@@ -160,7 +160,7 @@ struct serial_s {
160160
#endif
161161
#endif /* STM32F0xx */
162162

163-
#if defined(STM32G0xx)
163+
#if defined(STM32G0xx) && !defined(STM32G030xx) && !defined(STM32G031xx) && !defined(STM32G041xx)
164164
#if defined(LPUART1_BASE) && !defined(LPUART1_IRQn)
165165
#define LPUART1_IRQn USART3_4_LPUART1_IRQn
166166
#endif

libraries/Wire/src/utility/twi.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,7 @@ i2c_status_e i2c_master_write(i2c_t *obj, uint8_t dev_address,
813813
}
814814

815815
err = HAL_I2C_GetError(&(obj->handle));
816-
if ((delta > I2C_TIMEOUT_TICK)
816+
if ((delta >= I2C_TIMEOUT_TICK)
817817
|| ((err & HAL_I2C_ERROR_TIMEOUT) == HAL_I2C_ERROR_TIMEOUT)) {
818818
ret = I2C_TIMEOUT;
819819
} else {
@@ -887,7 +887,7 @@ i2c_status_e i2c_master_read(i2c_t *obj, uint8_t dev_address, uint8_t *data, uin
887887
}
888888

889889
err = HAL_I2C_GetError(&(obj->handle));
890-
if ((delta > I2C_TIMEOUT_TICK)
890+
if ((delta >= I2C_TIMEOUT_TICK)
891891
|| ((err & HAL_I2C_ERROR_TIMEOUT) == HAL_I2C_ERROR_TIMEOUT)) {
892892
ret = I2C_TIMEOUT;
893893
} else {

libraries/Wire/src/utility/twi.h

+4
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,11 @@ extern "C" {
6161
#endif
6262

6363
/* I2C Tx/Rx buffer size */
64+
#if !defined(I2C_TXRX_BUFFER_SIZE)
6465
#define I2C_TXRX_BUFFER_SIZE 32
66+
#elif (I2C_TXRX_BUFFER_SIZE >= 256)
67+
#error I2C buffer size cannot exceed 255
68+
#endif
6569

6670
/* Redefinition of IRQ for F0/G0/L0 families */
6771
#if defined(STM32F0xx) || defined(STM32G0xx) || defined(STM32L0xx)

system/Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_hal_pwr.h

+2
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,9 @@ typedef struct
133133
#define PWR_WAKEUP_PIN1 PWR_CR3_EWUP1 /*!< Wakeup pin 1 (with high level detection) */
134134
#define PWR_WAKEUP_PIN2 PWR_CR3_EWUP2 /*!< Wakeup pin 2 (with high level detection) */
135135
#define PWR_WAKEUP_PIN4 PWR_CR3_EWUP4 /*!< Wakeup pin 4 (with high level detection) */
136+
#if defined(PWR_CR3_EWUP5)
136137
#define PWR_WAKEUP_PIN5 PWR_CR3_EWUP5 /*!< Wakeup pin 5 (with high level detection) */
138+
#endif
137139
#define PWR_WAKEUP_PIN6 PWR_CR3_EWUP6 /*!< Wakeup pin 6 (with high level detection) */
138140
#define PWR_WAKEUP_PIN1_HIGH PWR_CR3_EWUP1 /*!< Wakeup pin 1 (with high level detection) */
139141
#define PWR_WAKEUP_PIN2_HIGH PWR_CR3_EWUP2 /*!< Wakeup pin 2 (with high level detection) */

variants/Generic_F103Rx/variant.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ WEAK void SystemClock_Config(void)
120120
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK) {
121121
Error_Handler();
122122
}
123-
PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_USB;
123+
PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_ADC | RCC_PERIPHCLK_USB;
124+
PeriphClkInit.AdcClockSelection = RCC_ADCPCLK2_DIV6;
124125
PeriphClkInit.UsbClockSelection = RCC_USBCLKSOURCE_PLL_DIV1_5;
125126
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK) {
126127
Error_Handler();

0 commit comments

Comments
 (0)