Skip to content

Commit 1ee9be7

Browse files
fprfpistm
authored andcommitted
NUCLEO-F103RB added.
F1 configuration files imported. Signed-off-by: fpr <[email protected]>
1 parent 247310a commit 1ee9be7

File tree

9 files changed

+1702
-0
lines changed

9 files changed

+1702
-0
lines changed

boards.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,20 @@ Nucleo_64.menu.board_part_num.NUCLEO_F091RC.build.product_line=STM32F091xC
8686
Nucleo_64.menu.board_part_num.NUCLEO_F091RC.build.variant=NUCLEO_F091RC
8787
Nucleo_64.menu.board_part_num.NUCLEO_F091RC.build.cmsis_lib_gcc=arm_cortexM0l_math
8888

89+
# NUCLEO_F103RB board
90+
# Support: Serial1 (USART1 on PA10, PA9) and Serial2 (USART3 on PC11, PC10)
91+
Nucleo_64.menu.board_part_num.NUCLEO_F103RB=Nucleo F103RB
92+
Nucleo_64.menu.board_part_num.NUCLEO_F103RB.node="NODE_F103RB,NUCLEO"
93+
Nucleo_64.menu.board_part_num.NUCLEO_F103RB.upload.maximum_size=131072
94+
Nucleo_64.menu.board_part_num.NUCLEO_F103RB.upload.maximum_data_size=20480
95+
Nucleo_64.menu.board_part_num.NUCLEO_F103RB.build.mcu=cortex-m3
96+
Nucleo_64.menu.board_part_num.NUCLEO_F103RB.build.f_cpu=72000000L
97+
Nucleo_64.menu.board_part_num.NUCLEO_F103RB.build.board=NUCLEO_F103RB
98+
Nucleo_64.menu.board_part_num.NUCLEO_F103RB.build.series=STM32F1xx
99+
Nucleo_64.menu.board_part_num.NUCLEO_F103RB.build.product_line=STM32F103xB
100+
Nucleo_64.menu.board_part_num.NUCLEO_F103RB.build.variant=NUCLEO_F103RB
101+
Nucleo_64.menu.board_part_num.NUCLEO_F103RB.build.cmsis_lib_gcc=arm_cortexM3l_math
102+
89103
# NUCLEO_F303RE board
90104
# Support: Serial1 (USART1 on PA10, PA9) and Serial2 (USART2 on PA1, PA0)
91105
Nucleo_64.menu.board_part_num.NUCLEO_F303RE=Nucleo F303RE

cores/arduino/stm32/PinAF_STM32F1.h

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
/*
2+
*******************************************************************************
3+
* Copyright (c) 2017, STMicroelectronics
4+
* All rights reserved.
5+
*
6+
* Redistribution and use in source and binary forms, with or without
7+
* modification, are permitted provided that the following conditions are met:
8+
*
9+
* 1. Redistributions of source code must retain the above copyright notice,
10+
* this list of conditions and the following disclaimer.
11+
* 2. Redistributions in binary form must reproduce the above copyright notice,
12+
* this list of conditions and the following disclaimer in the documentation
13+
* and/or other materials provided with the distribution.
14+
* 3. Neither the name of STMicroelectronics nor the names of its contributors
15+
* may be used to endorse or promote products derived from this software
16+
* without specific prior written permission.
17+
*
18+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28+
*******************************************************************************
29+
*/
30+
31+
#ifndef _PINAF_STM32F1_H
32+
#define _PINAF_STM32F1_H
33+
34+
#include "Arduino.h"
35+
36+
#ifdef __cplusplus
37+
extern "C" {
38+
#endif
39+
40+
static inline void pin_SetF1AFPin(uint32_t afnum)
41+
{
42+
// Enable AFIO clock
43+
__HAL_RCC_AFIO_CLK_ENABLE();
44+
45+
if (afnum > 0) {
46+
switch (afnum) {
47+
case 1: // Remap SPI1
48+
__HAL_AFIO_REMAP_SPI1_ENABLE();
49+
break;
50+
case 2: // Remap I2C1
51+
__HAL_AFIO_REMAP_I2C1_ENABLE();
52+
break;
53+
case 3: // Remap USART1
54+
__HAL_AFIO_REMAP_USART1_ENABLE();
55+
break;
56+
case 4: // Remap USART2
57+
__HAL_AFIO_REMAP_USART2_ENABLE();
58+
break;
59+
case 5: // Partial Remap USART3
60+
__HAL_AFIO_REMAP_USART3_PARTIAL();
61+
break;
62+
case 6: // Partial Remap TIM1
63+
__HAL_AFIO_REMAP_TIM1_PARTIAL();
64+
break;
65+
case 7: // Partial Remap TIM3
66+
__HAL_AFIO_REMAP_TIM3_PARTIAL();
67+
break;
68+
case 8: // Full Remap TIM2
69+
__HAL_AFIO_REMAP_TIM2_ENABLE();
70+
break;
71+
case 9: // Full Remap TIM3
72+
__HAL_AFIO_REMAP_TIM3_ENABLE();
73+
break;
74+
#if defined(AFIO_MAPR_CAN_REMAP_REMAP1)
75+
case 10: // CAN_RX mapped to PB8, CAN_TX mapped to PB9
76+
__HAL_AFIO_REMAP_CAN1_2();
77+
break;
78+
case 11: // CAN_RX mapped to PB8, CAN_TX mapped to PB9
79+
__HAL_AFIO_REMAP_CAN1_3();
80+
break;
81+
#endif
82+
case 12: // Full Remap USART3
83+
__HAL_AFIO_REMAP_USART3_ENABLE();
84+
break;
85+
case 13: // Full Remap TIM1
86+
__HAL_AFIO_REMAP_TIM1_ENABLE();
87+
break;
88+
case 14: // Full Remap TIM4
89+
__HAL_AFIO_REMAP_TIM4_ENABLE();
90+
break;
91+
default:
92+
break;
93+
}
94+
}
95+
}
96+
97+
#ifdef __cplusplus
98+
}
99+
#endif
100+
101+
#endif /* _PINAF_STM32F1_H */

cores/arduino/stm32/stm32_def_build.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@
4040
#define CMSIS_STARTUP_FILE "startup_stm32l476xx.s"
4141
#elif defined(STM32L432xx)
4242
#define CMSIS_STARTUP_FILE "startup_stm32l432xx.s"
43+
#elif defined(STM32F103xB)
44+
#define CMSIS_STARTUP_FILE "startup_stm32f103xb.s"
4345
#else
4446
#error UNKNOWN CHIP
4547
#endif

0 commit comments

Comments
 (0)