Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e27a24d

Browse files
committedApr 9, 2020
[Generic_F103Rx] Unified variant definition
Remove of "(Blue Button)" reference as this is generic. Only the LED is specific. Signed-off-by: Frederic Pillon <[email protected]>
1 parent 7d2c3eb commit e27a24d

File tree

4 files changed

+103
-81
lines changed

4 files changed

+103
-81
lines changed
 

‎README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ User can add a STM32 based board following this [wiki](https://github.com/stm32d
116116
| :---: | --- | :---: | :--- |
117117
| :green_heart: | [BluePill F103C(6-8-B)](https://stm32-base.org/boards/STM32F103C8T6-Blue-Pill) | *1.2.0* | USB CDC support since *1.5.0*, Maple bootloaders support since *1.6.0* |
118118
| :green_heart: | [BlackPill F103C(8-B)](https://stm32-base.org/boards/STM32F103C8T6-Black-Pill) | *1.5.0* | |
119-
| :green_heart: | [Generic F103R(8-B-C-E)T6](https://stm32-base.org/boards/STM32F103RET6-Generic-Board) | *1.7.0* | Blue Button |
119+
| :green_heart: | [Generic F103R(8-B-C-E)T6](https://stm32-base.org/boards/STM32F103RET6-Generic-Board) | *1.7.0* | |
120120
| :yellow_heart: | Generic F103Z(C-D-E-F-G) | **1.9.0** | |
121121
| :green_heart: | HY-TinySTM103T | *1.5.0* | |
122122
| :green_heart: | MapleMini F103CB | *1.2.0* | USB CDC support since *1.5.0*, Maple bootloaders support since *1.6.0* |

‎boards.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -873,29 +873,29 @@ GenF1.menu.pnum.BLACKPILL_F103CB.build.board=BLACKPILL_F103CB
873873
GenF1.menu.pnum.BLACKPILL_F103CB.build.product_line=STM32F103xB
874874
GenF1.menu.pnum.BLACKPILL_F103CB.build.variant=PILL_F103XX
875875

876-
# Generic STM32F103Rx boards (Blue button)
877-
GenF1.menu.pnum.Generic_F103R8T6=Generic F103R8T6 (Blue Button)
876+
# Generic STM32F103Rx boards
877+
GenF1.menu.pnum.Generic_F103R8T6=Generic F103R8T6
878878
GenF1.menu.pnum.Generic_F103R8T6.upload.maximum_size=65536
879879
GenF1.menu.pnum.Generic_F103R8T6.upload.maximum_data_size=20480
880880
GenF1.menu.pnum.Generic_F103R8T6.build.board=GENERIC_F103R8T6
881881
GenF1.menu.pnum.Generic_F103R8T6.build.product_line=STM32F103xB
882882
GenF1.menu.pnum.Generic_F103R8T6.build.variant=Generic_F103Rx
883883

884-
GenF1.menu.pnum.Generic_F103RBT6=Generic F103RBT6 (Blue Button)
884+
GenF1.menu.pnum.Generic_F103RBT6=Generic F103RBT6
885885
GenF1.menu.pnum.Generic_F103RBT6.upload.maximum_size=131072
886886
GenF1.menu.pnum.Generic_F103RBT6.upload.maximum_data_size=20480
887887
GenF1.menu.pnum.Generic_F103RBT6.build.board=GENERIC_F103RBT6
888888
GenF1.menu.pnum.Generic_F103RBT6.build.product_line=STM32F103xB
889889
GenF1.menu.pnum.Generic_F103RBT6.build.variant=Generic_F103Rx
890890

891-
GenF1.menu.pnum.Generic_F103RCT6=Generic F103RCT6 (Blue Button)
891+
GenF1.menu.pnum.Generic_F103RCT6=Generic F103RCT6
892892
GenF1.menu.pnum.Generic_F103RCT6.upload.maximum_size=262144
893893
GenF1.menu.pnum.Generic_F103RCT6.upload.maximum_data_size=49152
894894
GenF1.menu.pnum.Generic_F103RCT6.build.board=GENERIC_F103RCT6
895895
GenF1.menu.pnum.Generic_F103RCT6.build.product_line=STM32F103xE
896896
GenF1.menu.pnum.Generic_F103RCT6.build.variant=Generic_F103Rx
897897

898-
GenF1.menu.pnum.Generic_F103RET6=Generic F103RET6 (Blue Button)
898+
GenF1.menu.pnum.Generic_F103RET6=Generic F103RET6
899899
GenF1.menu.pnum.Generic_F103RET6.upload.maximum_size=524288
900900
GenF1.menu.pnum.Generic_F103RET6.upload.maximum_data_size=65536
901901
GenF1.menu.pnum.Generic_F103RET6.build.board=GENERIC_F103RET6

‎variants/Generic_F103Rx/variant.cpp

Lines changed: 40 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ extern "C" {
2323
#endif
2424

2525
const PinName digitalPin[] = {
26+
PA_0,
27+
PA_1,
28+
PA_2,
29+
PA_3,
30+
PA_4,
31+
PA_5,
32+
PA_6,
33+
PA_7,
2634
PA_8,
2735
PA_9, // RXD
2836
PA_10, // TXD
@@ -31,6 +39,8 @@ const PinName digitalPin[] = {
3139
PA_13, // JTDI
3240
PA_14, // JTCK
3341
PA_15,
42+
PB_0,
43+
PB_1,
3444
PB_2,
3545
PB_3, // JTDO
3646
PB_4, // JTRST
@@ -45,6 +55,12 @@ const PinName digitalPin[] = {
4555
PB_13,
4656
PB_14,
4757
PB_15,
58+
PC_0,
59+
PC_1,
60+
PC_2,
61+
PC_3,
62+
PC_4,
63+
PC_5,
4864
PC_6,
4965
PC_7,
5066
PC_8,
@@ -53,28 +69,31 @@ const PinName digitalPin[] = {
5369
PC_11,
5470
PC_12,
5571
PC_13,
56-
NC, // PC_14 OSC32_1
57-
NC, // PC_15 OSC32_2
58-
NC, // PD_0 OSCIN
59-
NC, // PD_1 OSCOUT
60-
PD_2,
72+
PC_14, // OSC32_1
73+
PC_15, // OSC32_2
74+
PD_0, // OSCIN
75+
PD_1, // OSCOUT
76+
PD_2
77+
};
6178

62-
PA_0,
63-
PA_1,
64-
PA_2,
65-
PA_3,
66-
PA_4,
67-
PA_5,
68-
PA_6,
69-
PA_7,
70-
PB_0,
71-
PB_1,
72-
PC_0,
73-
PC_1,
74-
PC_2,
75-
PC_3,
76-
PC_4,
77-
PC_5
79+
// Analog (Ax) pin number array
80+
const uint32_t analogInputPin[] = {
81+
0, // A0, PA0
82+
1, // A1, PA1
83+
2, // A2, PA2
84+
3, // A3, PA3
85+
4, // A4, PA4
86+
5, // A5, PA5
87+
6, // A6, PA6
88+
7, // A7, PA7
89+
16, // A8, PB0
90+
17, // A9, PB1
91+
32, // A10, PC0
92+
33, // A11, PC1
93+
34, // A12, PC2
94+
35, // A13, PC3
95+
36, // A14, PC4
96+
37 // A15, PC5
7897
};
7998

8099
#ifdef __cplusplus

‎variants/Generic_F103Rx/variant.h

Lines changed: 57 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -27,67 +27,70 @@ extern "C" {
2727
* Pins
2828
*----------------------------------------------------------------------------*/
2929

30-
#define PA8 0
31-
#define PA9 1
32-
#define PA10 2
33-
#define PA11 3
34-
#define PA12 4
35-
#define PA13 5
36-
#define PA14 6
37-
#define PA15 7
38-
#define PB2 8
39-
#define PB3 9
40-
#define PB4 10
41-
#define PB5 11
42-
#define PB6 12
43-
#define PB7 13
44-
#define PB8 14
45-
#define PB9 15
46-
#define PB10 16
47-
#define PB11 17
48-
#define PB12 18
49-
#define PB13 19
50-
#define PB14 20
51-
#define PB15 21
52-
#define PC6 22
53-
#define PC7 23
54-
#define PC8 24
55-
#define PC9 25
56-
#define PC10 26
57-
#define PC11 27
58-
#define PC12 28
59-
#define PC13 29
60-
#define PC14 30
61-
#define PC15 31
62-
#define PD0 32
63-
#define PD1 33
64-
#define PD2 34
65-
66-
#define PA0 35
67-
#define PA1 36
68-
#define PA2 37
69-
#define PA3 38
70-
#define PA4 39
71-
#define PA5 40
72-
#define PA6 41
73-
#define PA7 42
74-
#define PB0 43
75-
#define PB1 44
76-
#define PC0 45
77-
#define PC1 46
78-
#define PC2 47
79-
#define PC3 48
80-
#define PC4 49
81-
#define PC5 50
30+
#define PA0 A0
31+
#define PA1 A1
32+
#define PA2 A2
33+
#define PA3 A3
34+
#define PA4 A4
35+
#define PA5 A5
36+
#define PA6 A6
37+
#define PA7 A7
38+
#define PA8 8
39+
#define PA9 9
40+
#define PA10 10
41+
#define PA11 11
42+
#define PA12 12
43+
#define PA13 13
44+
#define PA14 14
45+
#define PA15 15
46+
47+
#define PB0 A8
48+
#define PB1 A9
49+
#define PB2 18
50+
#define PB3 19
51+
#define PB4 20
52+
#define PB5 21
53+
#define PB6 22
54+
#define PB7 23
55+
#define PB8 24
56+
#define PB9 25
57+
#define PB10 26
58+
#define PB11 27
59+
#define PB12 28
60+
#define PB13 29
61+
#define PB14 30
62+
#define PB15 31
63+
64+
#define PC0 A10
65+
#define PC1 A11
66+
#define PC2 A12
67+
#define PC3 A13
68+
#define PC4 A14
69+
#define PC5 A15
70+
#define PC6 38
71+
#define PC7 39
72+
#define PC8 40
73+
#define PC9 41
74+
#define PC10 42
75+
#define PC11 43
76+
#define PC12 44
77+
#define PC13 45
78+
#define PC14 46
79+
#define PC15 47
80+
81+
#define PD0 48
82+
#define PD1 49
83+
#define PD2 50
8284

8385
// This must be a literal
8486
#define NUM_DIGITAL_PINS 51
8587
// This must be a literal with a value less than or equal to to MAX_ANALOG_INPUTS
8688
#define NUM_ANALOG_INPUTS 16
87-
#define NUM_ANALOG_FIRST 35
8889

8990
// On-board LED pin number
90-
#define LED_BUILTIN PB11
91+
#ifndef LED_BUILTIN
92+
#define LED_BUILTIN PB11 // On some generic board with a blue button
93+
#endif
9194
#define LED_GREEN LED_BUILTIN
9295

9396
// Override default Arduino configuration

1 commit comments

Comments
 (1)

MCUdude commented on Apr 15, 2020

@MCUdude
Contributor

@fpistm shouldn't the *T6 suffix be removed from the names (Generic F103RBT6 -> Generic F103RB) to make it similar to all the generic STM32F4 targets? BTW I also see that a few F103Rx targets are missing. Specifically, F103R4, F103R6, F103RD, F103RF, and F103RG. Does all F103Rx series use the same HAL files? Is it as simple as adding the missing targets to boards.txt, and it will just work?

Please sign in to comment.