Skip to content

Commit 9344bdb

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 7789cf3 + 3d26385 commit 9344bdb

File tree

877 files changed

+109590
-35441
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

877 files changed

+109590
-35441
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.orig
2+
*.swp

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
Boards available:
44

55
* STM32F0
6+
* [Nucleo F030R8](http://www.st.com/en/evaluation-tools/nucleo-f030r8.html)
67
* [Nucleo F091RC](http://www.st.com/en/evaluation-tools/nucleo-f091rc.html)
78

89
* STM32F1 (soon)

boards.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ Nucleo_64.menu.Nucleo_64_board.NUCLEO_F091RC.build.extra_flags=-DSTM32F091xC {bu
7777
# NUCLEO_F030R8 board
7878

7979
Nucleo_64.menu.Nucleo_64_board.NUCLEO_F030R8=Nucleo F030R8
80-
Nucleo_64.menu.Nucleo_64_board.NUCLEO_F030R8.node=NODE_F030R8
80+
Nucleo_64.menu.Nucleo_64_board.NUCLEO_F030R8.node="NODE_F030R8,NUCLEO"
8181
Nucleo_64.menu.Nucleo_64_board.NUCLEO_F030R8.upload.maximum_size=65536
8282
Nucleo_64.menu.Nucleo_64_board.NUCLEO_F030R8.upload.maximum_data_size=8192
8383
Nucleo_64.menu.Nucleo_64_board.NUCLEO_F030R8.build.mcu=cortex-m0
@@ -86,6 +86,7 @@ Nucleo_64.menu.Nucleo_64_board.NUCLEO_F030R8.build.board=NUCLEO_F030R8
8686
Nucleo_64.menu.Nucleo_64_board.NUCLEO_F030R8.build.series=STM32F0xx
8787
Nucleo_64.menu.Nucleo_64_board.NUCLEO_F030R8.build.variant=NUCLEO_F030R8
8888
Nucleo_64.menu.Nucleo_64_board.NUCLEO_F030R8.build.cmsis_lib_gcc=arm_cortexM0l_math
89+
#To enable Serial1 (USART1 on PA10, PA9) add -DENABLE_SERIAL1
8990
Nucleo_64.menu.Nucleo_64_board.NUCLEO_F030R8.build.extra_flags=-DSTM32F030x8
9091

9192
# NUCLEO_F303RE board

cores/arduino/stm32/HAL/stm32yyxx_hal_mmc.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// none
88
#endif
99
#ifdef STM32F2xx
10-
// none
10+
#include "stm32f2xx_hal_mmc.c"
1111
#endif
1212
#ifdef STM32F3xx
1313
// none

cores/arduino/stm32/HAL/stm32yyxx_ll_adc.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// none
88
#endif
99
#ifdef STM32F2xx
10-
// none
10+
#include "stm32f2xx_ll_adc.c"
1111
#endif
1212
#ifdef STM32F3xx
1313
#include "stm32f3xx_ll_adc.c"

cores/arduino/stm32/HAL/stm32yyxx_ll_crc.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// none
88
#endif
99
#ifdef STM32F2xx
10-
// none
10+
#include "stm32f2xx_ll_crc.c"
1111
#endif
1212
#ifdef STM32F3xx
1313
#include "stm32f3xx_ll_crc.c"

cores/arduino/stm32/HAL/stm32yyxx_ll_dac.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// none
88
#endif
99
#ifdef STM32F2xx
10-
// none
10+
#include "stm32f2xx_ll_dac.c"
1111
#endif
1212
#ifdef STM32F3xx
1313
#include "stm32f3xx_ll_dac.c"

cores/arduino/stm32/HAL/stm32yyxx_ll_dma.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// none
88
#endif
99
#ifdef STM32F2xx
10-
// none
10+
#include "stm32f2xx_ll_dma.c"
1111
#endif
1212
#ifdef STM32F3xx
1313
#include "stm32f3xx_ll_dma.c"

cores/arduino/stm32/HAL/stm32yyxx_ll_exti.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// none
88
#endif
99
#ifdef STM32F2xx
10-
// none
10+
#include "stm32f2xx_ll_exti.c"
1111
#endif
1212
#ifdef STM32F3xx
1313
#include "stm32f3xx_ll_exti.c"

cores/arduino/stm32/HAL/stm32yyxx_ll_gpio.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// none
88
#endif
99
#ifdef STM32F2xx
10-
// none
10+
#include "stm32f2xx_ll_gpio.c"
1111
#endif
1212
#ifdef STM32F3xx
1313
#include "stm32f3xx_ll_gpio.c"

cores/arduino/stm32/HAL/stm32yyxx_ll_i2c.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// none
88
#endif
99
#ifdef STM32F2xx
10-
// none
10+
#include "stm32f2xx_ll_i2c.c"
1111
#endif
1212
#ifdef STM32F3xx
1313
#include "stm32f3xx_ll_i2c.c"

cores/arduino/stm32/HAL/stm32yyxx_ll_pwr.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// none
88
#endif
99
#ifdef STM32F2xx
10-
// none
10+
#include "stm32f2xx_ll_pwr.c"
1111
#endif
1212
#ifdef STM32F3xx
1313
#include "stm32f3xx_ll_pwr.c"

cores/arduino/stm32/HAL/stm32yyxx_ll_rcc.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// none
88
#endif
99
#ifdef STM32F2xx
10-
// none
10+
#include "stm32f2xx_ll_rcc.c"
1111
#endif
1212
#ifdef STM32F3xx
1313
#include "stm32f3xx_ll_rcc.c"

cores/arduino/stm32/HAL/stm32yyxx_ll_rng.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// none
88
#endif
99
#ifdef STM32F2xx
10-
// none
10+
#include "stm32f2xx_ll_rng.c"
1111
#endif
1212
#ifdef STM32F3xx
1313
// none

cores/arduino/stm32/HAL/stm32yyxx_ll_rtc.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// none
88
#endif
99
#ifdef STM32F2xx
10-
// none
10+
#include "stm32f2xx_ll_rtc.c"
1111
#endif
1212
#ifdef STM32F3xx
1313
#include "stm32f3xx_ll_rtc.c"

cores/arduino/stm32/HAL/stm32yyxx_ll_spi.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// none
88
#endif
99
#ifdef STM32F2xx
10-
// none
10+
#include "stm32f2xx_ll_spi.c"
1111
#endif
1212
#ifdef STM32F3xx
1313
#include "stm32f3xx_ll_spi.c"

cores/arduino/stm32/HAL/stm32yyxx_ll_tim.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// none
88
#endif
99
#ifdef STM32F2xx
10-
// none
10+
#include "stm32f2xx_ll_tim.c"
1111
#endif
1212
#ifdef STM32F3xx
1313
#include "stm32f3xx_ll_tim.c"

cores/arduino/stm32/HAL/stm32yyxx_ll_usart.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// none
88
#endif
99
#ifdef STM32F2xx
10-
// none
10+
#include "stm32f2xx_ll_usart.c"
1111
#endif
1212
#ifdef STM32F3xx
1313
#include "stm32f3xx_ll_usart.c"

cores/arduino/stm32/HAL/stm32yyxx_ll_utils.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// none
88
#endif
99
#ifdef STM32F2xx
10-
// none
10+
#include "stm32f2xx_ll_utils.c"
1111
#endif
1212
#ifdef STM32F3xx
1313
#include "stm32f3xx_ll_utils.c"

cores/arduino/stm32/PeripheralPins.h

-3
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,5 @@ extern const PinMap PinMap_SPI_SSEL[];
6262
extern const PinMap PinMap_CAN_RD[];
6363
extern const PinMap PinMap_CAN_TD[];
6464

65-
//*** TIMER ***
66-
extern const TimerMap TimerMap_CONFIG[];
67-
6865
#endif
6966

cores/arduino/stm32/PortNames.c

+11-11
Original file line numberDiff line numberDiff line change
@@ -100,64 +100,64 @@ GPIO_TypeDef *set_GPIO_Port_Clock(uint32_t port_idx) {
100100
switch (port_idx) {
101101
case PortA:
102102
gpioPort = GPIOA_BASE;
103-
__GPIOA_CLK_ENABLE();
103+
__HAL_RCC_GPIOA_CLK_ENABLE();
104104
break;
105105
case PortB:
106106
gpioPort = GPIOB_BASE;
107-
__GPIOB_CLK_ENABLE();
107+
__HAL_RCC_GPIOB_CLK_ENABLE();
108108
break;
109109
#if defined GPIOC_BASE
110110
case PortC:
111111
gpioPort = GPIOC_BASE;
112-
__GPIOC_CLK_ENABLE();
112+
__HAL_RCC_GPIOC_CLK_ENABLE();
113113
break;
114114
#endif
115115
#if defined GPIOD_BASE
116116
case PortD:
117117
gpioPort = GPIOD_BASE;
118-
__GPIOD_CLK_ENABLE();
118+
__HAL_RCC_GPIOD_CLK_ENABLE();
119119
break;
120120
#endif
121121
#if defined GPIOE_BASE
122122
case PortE:
123123
gpioPort = GPIOE_BASE;
124-
__GPIOE_CLK_ENABLE();
124+
__HAL_RCC_GPIOE_CLK_ENABLE();
125125
break;
126126
#endif
127127
#if defined GPIOF_BASE
128128
case PortF:
129129
gpioPort = GPIOF_BASE;
130-
__GPIOF_CLK_ENABLE();
130+
__HAL_RCC_GPIOF_CLK_ENABLE();
131131
break;
132132
#endif
133133
#if defined GPIOG_BASE
134134
case PortG:
135135
gpioPort = GPIOG_BASE;
136-
__GPIOG_CLK_ENABLE();
136+
__HAL_RCC_GPIOG_CLK_ENABLE();
137137
break;
138138
#endif
139139
#if defined GPIOH_BASE
140140
case PortH:
141141
gpioPort = GPIOH_BASE;
142-
__GPIOH_CLK_ENABLE();
142+
__HAL_RCC_GPIOH_CLK_ENABLE();
143143
break;
144144
#endif
145145
#if defined GPIOI_BASE
146146
case PortI:
147147
gpioPort = GPIOI_BASE;
148-
__GPIOI_CLK_ENABLE();
148+
__HAL_RCC_GPIOI_CLK_ENABLE();
149149
break;
150150
#endif
151151
#if defined GPIOJ_BASE
152152
case PortJ:
153153
gpioPort = GPIOJ_BASE;
154-
__GPIOJ_CLK_ENABLE();
154+
__HAL_RCC_GPIOJ_CLK_ENABLE();
155155
break;
156156
#endif
157157
#if defined GPIOK_BASE
158158
case PortK:
159159
gpioPort = GPIOK_BASE;
160-
__GPIOK_CLK_ENABLE();
160+
__HAL_RCC_GPIOK_CLK_ENABLE();
161161
break;
162162
#endif
163163
default:

cores/arduino/stm32/analog.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,7 @@ void pwm_start(PinName pin, uint32_t clock_freq,
737737
timHandle.Instance = pinmap_peripheral(pin, PinMap_PWM);
738738
if (timHandle.Instance == NC) return 0;
739739
timHandle.Init.Prescaler = (uint32_t)(getTimerClkFreq(timHandle.Instance) / clock_freq) - 1;
740-
timHandle.Init.Period = period;
740+
timHandle.Init.Period = period -1;
741741
timHandle.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
742742
timHandle.Init.CounterMode = TIM_COUNTERMODE_UP;
743743
#ifndef STM32L0xx

cores/arduino/stm32/pinmap.c

-18
Original file line numberDiff line numberDiff line change
@@ -83,21 +83,3 @@ uint32_t pinmap_merge(uint32_t a, uint32_t b) {
8383
// error("pinmap mis-match");
8484
return (uint32_t)NC;
8585
}
86-
87-
uint32_t timermap_irq(TIM_TypeDef *tim, const TimerMap* map) {
88-
while (map->timer != NULL) {
89-
if (map->timer == tim)
90-
return map->irq;
91-
map++;
92-
}
93-
return (uint32_t)0;
94-
}
95-
96-
uint32_t timermap_clkSrc(TIM_TypeDef *tim, const TimerMap* map) {
97-
while (map->timer != NULL) {
98-
if (map->timer == tim)
99-
return map->clk_src;
100-
map++;
101-
}
102-
return (uint32_t)0;
103-
}

cores/arduino/stm32/pinmap.h

-9
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,6 @@ typedef struct {
3333
int function;
3434
} PinMap;
3535

36-
typedef struct {
37-
TIM_TypeDef *timer;
38-
IRQn_Type irq;
39-
uint8_t clk_src;
40-
} TimerMap;
41-
4236
bool pin_in_pinmap(PinName pin, const PinMap* map);
4337
void pin_function(PinName pin, int function);
4438

@@ -48,9 +42,6 @@ uint32_t pinmap_find_peripheral(PinName pin, const PinMap* map);
4842
uint32_t pinmap_find_function(PinName pin, const PinMap* map);
4943
uint32_t pinmap_merge(uint32_t a, uint32_t b);
5044

51-
uint32_t timermap_irq(TIM_TypeDef *tim, const TimerMap* map);
52-
uint32_t timermap_clkSrc(TIM_TypeDef *tim, const TimerMap* map);
53-
5445
#ifdef __cplusplus
5546
}
5647
#endif

cores/arduino/stm32/spi_com.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ void spi_init(spi_t *obj, uint32_t speed, spi_mode_e mode, uint8_t msb)
252252
handle->Init.CLKPolarity = SPI_POLARITY_HIGH;
253253
}
254254

255-
handle->Init.CRCCalculation = SPI_CRCCALCULATION_DISABLED;
255+
handle->Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE;
256256
handle->Init.CRCPolynomial = 7;
257257
handle->Init.DataSize = SPI_DATASIZE_8BIT;
258258

@@ -262,7 +262,7 @@ void spi_init(spi_t *obj, uint32_t speed, spi_mode_e mode, uint8_t msb)
262262
handle->Init.FirstBit = SPI_FIRSTBIT_MSB;
263263
}
264264

265-
handle->Init.TIMode = SPI_TIMODE_DISABLED;
265+
handle->Init.TIMode = SPI_TIMODE_DISABLE;
266266

267267
if(obj->pin_mosi != NC) {
268268
port = set_GPIO_Port_Clock(STM_PORT(obj->pin_mosi));

0 commit comments

Comments
 (0)