Skip to content

Commit 0631786

Browse files
author
rogerclarkmelbourne
committed
Added Maple RET6 board provided by @skyng22003. Tested and compiles OK, but I'm unable to test as I don't have that hardware
1 parent 5fd0efa commit 0631786

21 files changed

Lines changed: 1424 additions & 8 deletions

STM32F1/boards.txt

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,14 @@ maple.build.gcc_ver=gcc-arm-none-eabi-4.8.3-2014q1
8080
##############################################################
8181
mapleRET6.name=LeafLabs Maple RET6 to Flash
8282

83+
8384
mapleRET6.upload.tool=maple_upload
8485
mapleRET6.upload.protocol=maple_dfu
85-
mapleRET6.upload.maximum_size=492000
86+
mapleRET6.upload.maximum_size=262144
8687
mapleRET6.upload.use_1200bps_touch=false
8788
mapleRET6.upload.file_type=bin
88-
mapleRET6.upload.ram.maximum_size=61000
89-
mapleRET6.upload.flash.maximum_size=492000
89+
mapleRET6.upload.ram.maximum_size=492152
90+
mapleRET6.upload.flash.maximum_size=262144
9091
mapleRET6.upload.usbID=1EAF:0003
9192
mapleRET6.upload.altID=1
9293
mapleRET6.upload.auto_reset=true
@@ -95,13 +96,14 @@ mapleRET6.build.mcu=cortex-m3
9596
mapleRET6.build.f_cpu=72000000L
9697
mapleRET6.build.board=MAPLE_RET6
9798
mapleRET6.build.core=maple
98-
mapleRET6.build.extra_flags=-DMCU_STM32F103RE -mthumb -DSERIAL_USB -march=armv7-m -D__STM32F1__
99+
mapleRET6.build.extra_flags=-DMCU_STM32F103RE -mthumb -march=armv7-m -D__STM32F1__ -DSERIAL_USB
100+
101+
102+
mapleRET6.build.ldscript=ld/stm32f103re-bootloader.ld
103+
mapleRET6.build.variant=maple_ret6
104+
99105

100-
mapleRET6.build.ldscript=ld/flashRET6.ld
101-
mapleRET6.build.variant=maple
102-
mapleRET6.build.variant_system_lib=libmapleRET6.a
103106
mapleRET6.build.vect=VECT_TAB_ADDR=0x8005000
104-
mapleRET6.build.density=STM32_HIGH_DENSITY
105107
mapleRET6.build.error_led_port=GPIOA
106108
mapleRET6.build.error_led_pin=5
107109
mapleRET6.build.gcc_ver=gcc-arm-none-eabi-4.8.3-2014q1
Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
/******************************************************************************
2+
* The MIT License
3+
*
4+
* Copyright (c) 2011 LeafLabs, LLC.
5+
*
6+
* Permission is hereby granted, free of charge, to any person
7+
* obtaining a copy of this software and associated documentation
8+
* files (the "Software"), to deal in the Software without
9+
* restriction, including without limitation the rights to use, copy,
10+
* modify, merge, publish, distribute, sublicense, and/or sell copies
11+
* of the Software, and to permit persons to whom the Software is
12+
* furnished to do so, subject to the following conditions:
13+
*
14+
* The above copyright notice and this permission notice shall be
15+
* included in all copies or substantial portions of the Software.
16+
*
17+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20+
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
21+
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
22+
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
23+
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24+
* SOFTWARE.
25+
*****************************************************************************/
26+
27+
/**
28+
* @file wirish/boards/maple/board.cpp
29+
* @author Marti Bolivar <mbolivar@leaflabs.com>
30+
* @brief Maple board file.
31+
*/
32+
33+
#include <board/board.h> // For this board's header file
34+
35+
#include <wirish_types.h> // For stm32_pin_info and its contents
36+
// (these go into PIN_MAP).
37+
38+
#include "boards_private.h" // For PMAP_ROW(), which makes
39+
// PIN_MAP easier to read.
40+
41+
// boardInit(): nothing special to do for Maple.
42+
//
43+
// When defining your own board.cpp, you can put extra code in this
44+
// function if you have anything you want done on reset, before main()
45+
// or setup() are called.
46+
//
47+
// If there's nothing special you need done, feel free to leave this
48+
// function out, as we do here.
49+
/*
50+
void boardInit(void) {
51+
}
52+
*/
53+
54+
// Pin map: this lets the basic I/O functions (digitalWrite(),
55+
// analogRead(), pwmWrite()) translate from pin numbers to STM32
56+
// peripherals.
57+
//
58+
// PMAP_ROW() lets us specify a row (really a struct stm32_pin_info)
59+
// in the pin map. Its arguments are:
60+
//
61+
// - GPIO device for the pin (GPIOA, etc.)
62+
// - GPIO bit for the pin (0 through 15)
63+
// - Timer device, or NULL if none
64+
// - Timer channel (1 to 4, for PWM), or 0 if none
65+
// - ADC device, or NULL if none
66+
// - ADC channel, or ADCx if none
67+
68+
extern const stm32_pin_info PIN_MAP[BOARD_NR_GPIO_PINS] = {
69+
/*
70+
gpio_dev *gpio_device; GPIO device
71+
timer_dev *timer_device; Pin's timer device, if any.
72+
const adc_dev *adc_device; ADC device, if any.
73+
uint8 gpio_bit; Pin's GPIO port bit.
74+
uint8 timer_channel; Timer channel, or 0 if none.
75+
uint8 adc_channel; Pin ADC channel, or ADCx if none.
76+
uint8 pinMode; mode specific by pinMode call (Roger Clark added to optimize compatibility with Arduino API
77+
*/
78+
79+
/* Top header */
80+
81+
{ GPIOA, TIMER2, ADC1, 3, 4, 3 }, /* D0/PA3 */
82+
{ GPIOA, TIMER2, ADC1, 2, 3, 2 }, /* D1/PA2 */
83+
{ GPIOA, TIMER2, ADC1, 0, 1, 0 }, /* D2/PA0 */
84+
{ GPIOA, TIMER2, ADC1, 1, 2, 1 }, /* D3/PA1 */
85+
{ GPIOB, NULL, NULL, 5, 0, ADCx }, /* D4/PB5 */
86+
{ GPIOB, TIMER4, NULL, 6, 1, ADCx }, /* D5/PB6 */
87+
{ GPIOA, TIMER1, NULL, 8, 1, ADCx }, /* D6/PA8 */
88+
{ GPIOA, TIMER1, NULL, 9, 2, ADCx }, /* D7/PA9 */
89+
{ GPIOA, TIMER1, NULL, 10, 3, ADCx }, /* D8/PA10 */
90+
{ GPIOB, TIMER4, NULL, 7, 2, ADCx }, /* D9/PB7 */
91+
{ GPIOA, NULL, ADC1, 4, 0, 4 }, /* D10/PA4 */
92+
{ GPIOA, TIMER3, ADC1, 7, 2, 7 }, /* D11/PA7 */
93+
{ GPIOA, TIMER3, ADC1, 6, 1, 6 }, /* D12/PA6 */
94+
{ GPIOA, NULL, ADC1, 5, 0, 5 }, /* D13/PA5 (LED) */
95+
{ GPIOB, TIMER4, NULL, 8, 3, ADCx }, /* D14/PB8 */
96+
97+
/* Little header */
98+
99+
{ GPIOC, NULL, ADC1, 0, 0, 10 }, /* D15/PC0 */
100+
{ GPIOC, NULL, ADC1, 1, 0, 11 }, /* D16/PC1 */
101+
{ GPIOC, NULL, ADC1, 2, 0, 12 }, /* D17/PC2 */
102+
{ GPIOC, NULL, ADC1, 3, 0, 13 }, /* D18/PC3 */
103+
{ GPIOC, NULL, ADC1, 4, 0, 14 }, /* D19/PC4 */
104+
{ GPIOC, NULL, ADC1, 5, 0, 15 }, /* D20/PC5 */
105+
106+
/* External header */
107+
108+
{ GPIOC, NULL, NULL, 13, 0, ADCx }, /* D21/PC13 */
109+
{ GPIOC, NULL, NULL, 14, 0, ADCx }, /* D22/PC14 */
110+
{ GPIOC, NULL, NULL, 15, 0, ADCx }, /* D23/PC15 */
111+
{ GPIOB, TIMER4, NULL, 9, 4, ADCx }, /* D24/PB9 */
112+
{ GPIOD, NULL, NULL, 2, 0, ADCx }, /* D25/PD2 */
113+
{ GPIOC, NULL, NULL, 10, 0, ADCx }, /* D26/PC10 */
114+
{ GPIOB, TIMER3, ADC1, 0, 3, 8 }, /* D27/PB0 */
115+
{ GPIOB, TIMER3, ADC1, 1, 4, 9 }, /* D28/PB1 */
116+
{ GPIOB, NULL, NULL, 10, 0, ADCx }, /* D29/PB10 */
117+
{ GPIOB, NULL, NULL, 11, 0, ADCx }, /* D30/PB11 */
118+
{ GPIOB, NULL, NULL, 12, 0, ADCx }, /* D31/PB12 */
119+
{ GPIOB, NULL, NULL, 13, 0, ADCx }, /* D32/PB13 */
120+
{ GPIOB, NULL, NULL, 14, 0, ADCx }, /* D33/PB14 */
121+
{ GPIOB, NULL, NULL, 15, 0, ADCx }, /* D34/PB15 */
122+
{ GPIOC, TIMER8, NULL, 6, 1, ADCx }, /* D35/PC6 */
123+
{ GPIOC, TIMER8, NULL, 7, 2, ADCx }, /* D36/PC7 */
124+
{ GPIOC, TIMER8, NULL, 8, 3, ADCx }, /* D37/PC8 */
125+
{ GPIOC, TIMER8, NULL, 9, 4, ADCx }, /* D38/PC9 (BUT) */
126+
127+
/* JTAG header */
128+
129+
{ GPIOA, NULL, NULL, 13, 0, ADCx }, /* D39/PA13 */
130+
{ GPIOA, NULL, NULL, 14, 0, ADCx }, /* D40/PA14 */
131+
{ GPIOA, NULL, NULL, 15, 0, ADCx }, /* D41/PA15 */
132+
{ GPIOB, NULL, NULL, 3, 0, ADCx }, /* D42/PB3 */
133+
{ GPIOB, NULL, NULL, 4, 0, ADCx }, /* D43/PB4 */
134+
135+
{ GPIOC, NULL, NULL, 11, 0, ADCx }, /* D44/PC11 UART4_RX/SDIO_D3 */
136+
{ GPIOC, NULL, NULL, 12, 0, ADCx }, /* D45/PC12 UART5_TX/SDIO_CK */
137+
138+
{ GPIOD, NULL, NULL, 0, 0, ADCx }, /* PD0 OSC_IN */
139+
{ GPIOD, NULL, NULL, 1, 0, ADCx }, /* PD1 OSC_OUT */
140+
{ GPIOB, NULL, NULL, 2, 0, ADCx }, /* PB2 */
141+
};
142+
143+
/* Basically everything that is defined as having a timer us PWM */
144+
extern const uint8 boardPWMPins[BOARD_NR_PWM_PINS] __FLASH__ = {
145+
PA0,PA1,PA2,PA3,PA6,PA7,PA8,PA9,PA10,PB0,PB1,PB6,PB7,PB8,PB9,PC6,PC7,PC8,PC9
146+
};
147+
148+
/* Basically everything that is defined having ADC */
149+
extern const uint8 boardADCPins[BOARD_NR_ADC_PINS] __FLASH__ = {
150+
PA0,PA1,PA2,PA3,PA4,PA5,PA6,PA7,PB0,PB1,PC0,PC1,PC2,PC3,PC4,PC5
151+
};
152+
153+
/* not sure what this us used for */
154+
extern const uint8 boardUsedPins[BOARD_NR_USED_PINS] __FLASH__ = {
155+
BOARD_JTMS_SWDIO_PIN,
156+
BOARD_JTCK_SWCLK_PIN, BOARD_JTDI_PIN, BOARD_JTDO_PIN, BOARD_NJTRST_PIN
157+
};
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
/******************************************************************************
2+
* The MIT License
3+
*
4+
* Copyright (c) 2011 LeafLabs, LLC.
5+
*
6+
* Permission is hereby granted, free of charge, to any person
7+
* obtaining a copy of this software and associated documentation
8+
* files (the "Software"), to deal in the Software without
9+
* restriction, including without limitation the rights to use, copy,
10+
* modify, merge, publish, distribute, sublicense, and/or sell copies
11+
* of the Software, and to permit persons to whom the Software is
12+
* furnished to do so, subject to the following conditions:
13+
*
14+
* The above copyright notice and this permission notice shall be
15+
* included in all copies or substantial portions of the Software.
16+
*
17+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20+
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
21+
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
22+
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
23+
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24+
* SOFTWARE.
25+
*****************************************************************************/
26+
27+
/**
28+
* @file maple_RET6.h
29+
* @author Marti Bolivar <mbolivar@leaflabs.com>
30+
* @brief Private include file for Maple RET6 Edition in boards.h
31+
*
32+
* See maple.h for more information on these definitions.
33+
*/
34+
35+
#ifndef _BOARDS_GENERIC_STM32F103R_H_
36+
#define _BOARDS_GENERIC_STM32F103R_H_
37+
38+
/* A few of these values will seem strange given that it's a
39+
* high-density board. */
40+
41+
#define CYCLES_PER_MICROSECOND 72
42+
#define SYSTICK_RELOAD_VAL 71999 /* takes a cycle to reload */
43+
44+
// USARTS
45+
#define BOARD_NR_USARTS 5
46+
#define BOARD_USART1_TX_PIN PA9
47+
#define BOARD_USART1_RX_PIN PA10
48+
49+
#define BOARD_USART2_TX_PIN PA2
50+
#define BOARD_USART2_RX_PIN PA3
51+
52+
#define BOARD_USART3_TX_PIN PB10
53+
#define BOARD_USART3_RX_PIN PB11
54+
55+
#define BOARD_USART4_TX_PIN PC10
56+
#define BOARD_USART4_RX_PIN PC11
57+
58+
#define BOARD_USART5_TX_PIN PC12
59+
#define BOARD_USART5_RX_PIN PD2
60+
61+
/* Note:
62+
*
63+
* SPI3 is unusable due to pin 43 (PB4) and NRST tie-together :(, but
64+
* leave the definitions so as not to clutter things up. This is only
65+
* OK since RET6 Ed. is specifically advertised as a beta board. */
66+
#define BOARD_NR_SPI 3
67+
#define BOARD_SPI1_NSS_PIN PA4
68+
#define BOARD_SPI1_SCK_PIN PA5
69+
#define BOARD_SPI1_MISO_PIN PA6
70+
#define BOARD_SPI1_MOSI_PIN PA7
71+
72+
73+
74+
#define BOARD_SPI2_NSS_PIN PB12
75+
#define BOARD_SPI2_SCK_PIN PB13
76+
#define BOARD_SPI2_MISO_PIN PB14
77+
#define BOARD_SPI2_MOSI_PIN PB15
78+
79+
80+
#define BOARD_SPI3_NSS_PIN PA15
81+
#define BOARD_SPI3_SCK_PIN PB3
82+
#define BOARD_SPI3_MISO_PIN PB4
83+
#define BOARD_SPI3_MOSI_PIN PB5
84+
85+
86+
/* GPIO A to E = 5 * 16 - BOOT1 not used = 79*/
87+
#define BOARD_NR_GPIO_PINS 51
88+
/* Note: NOT 19. The missing one is D38 a.k.a. BOARD_BUTTON_PIN, which
89+
* isn't broken out to a header and is thus unusable for PWM. */
90+
#define BOARD_NR_PWM_PINS 19
91+
#define BOARD_NR_ADC_PINS 16
92+
#define BOARD_NR_USED_PINS 7
93+
94+
#define BOARD_JTMS_SWDIO_PIN 39
95+
#define BOARD_JTCK_SWCLK_PIN 40
96+
#define BOARD_JTDI_PIN 41
97+
#define BOARD_JTDO_PIN 42
98+
#define BOARD_NJTRST_PIN 43
99+
100+
/* USB configuration. BOARD_USB_DISC_DEV is the GPIO port containing
101+
* the USB_DISC pin, and BOARD_USB_DISC_BIT is that pin's bit. */
102+
#define BOARD_USB_DISC_DEV GPIOC
103+
#define BOARD_USB_DISC_BIT 12
104+
105+
/* Pin aliases: these give the GPIO port/bit for each pin as an
106+
* enum. These are optional, but recommended. They make it easier to
107+
* write code using low-level GPIO functionality. */
108+
enum {
109+
PA3, PA2, PA0, PA1, PB5, PB6, PA8, PA9, PA10, PB7, PA4, PA7, PA6, PA5, PB8,
110+
PC0, PC1, PC2, PC3, PC4, PC5, PC13, PC14, PC15, PB9, PD2, PC10, PB0, PB1,
111+
PB10, PB11, PB12, PB13, PB14, PB15, PC6, PC7, PC8, PC9, PA13, PA14, PA15,
112+
PB3, PB4, PC11, PC12
113+
};/* Note PB2 is skipped as this is Boot1 and is not going to be much use as its likely to be pulled permanently low */
114+
115+
#endif
116+
//0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
117+
118+
//15 16 17 18 19 20 21 22 23 24 25 26 27 28
119+
120+
//29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45

0 commit comments

Comments
 (0)