Skip to content

Commit e2c9574

Browse files
Added support for Hy-Tiny STM32F103T
1 parent 34b6bd9 commit e2c9574

23 files changed

+1469
-0
lines changed

STM32F1/boards.txt

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,68 @@ genericSTM32F103Z.menu.upload_method.BMPMethod.upload.protocol=gdb_bmp
462462
genericSTM32F103Z.menu.upload_method.BMPMethod.upload.tool=bmp_upload
463463
genericSTM32F103Z.menu.upload_method.BMPMethod.build.upload_flags=-DCONFIG_MAPLE_MINI_NO_DISABLE_DEBUG
464464

465+
###################### HYTiny STM32F103T ########################################
466+
467+
hytiny-stm32f103t.name=HYTiny STM32F103T series
468+
hytiny-stm32f103t.vid.0=0x1EAF
469+
hytiny-stm32f103t.pid.0=0x0004
470+
hytiny-stm32f103t.build.variant=hytiny_stm32f103t
471+
hytiny-stm32f103t.build.vect=VECT_TAB_ADDR=0x8000000
472+
hytiny-stm32f103t.build.core=maple
473+
hytiny-stm32f103t.build.board=HYTINY_STM32F103T
474+
hytiny-stm32f103t.upload.use_1200bps_touch=false
475+
hytiny-stm32f103t.upload.file_type=bin
476+
hytiny-stm32f103t.upload.auto_reset=true
477+
478+
## STM32F103C8 -------------------------
479+
hytiny-stm32f103t.menu.device_variant.STM32F103C8=STM32F103C8 (20k RAM. 64k Flash)
480+
hytiny-stm32f103t.menu.device_variant.STM32F103C8.build.cpu_flags=-DMCU_STM32F103C8
481+
hytiny-stm32f103t.menu.device_variant.STM32F103C8.build.ldscript=ld/jtag_c8.ld
482+
hytiny-stm32f103t.menu.device_variant.STM32F103C8.upload.maximum_size=65536
483+
hytiny-stm32f103t.menu.device_variant.STM32F103C8.upload.ram.maximum_size=20480
484+
hytiny-stm32f103t.menu.device_variant.STM32F103C8.upload.flash.maximum_size=65536
485+
486+
## STM32F103CB -------------------------
487+
hytiny-stm32f103t.menu.device_variant.STM32F103CB=STM32F103CB (20k RAM. 128k Flash)
488+
hytiny-stm32f103t.menu.device_variant.STM32F103CB.build.cpu_flags=-DMCU_STM32F103CB
489+
hytiny-stm32f103t.menu.device_variant.STM32F103CB.build.ldscript=ld/jtag.ld
490+
hytiny-stm32f103t.menu.device_variant.STM32F103CB.upload.maximum_size=131072
491+
hytiny-stm32f103t.menu.device_variant.STM32F103CB.upload.ram.maximum_size=20480
492+
hytiny-stm32f103t.menu.device_variant.STM32F103CB.upload.flash.maximum_size=131072
493+
494+
#---------------------------- UPLOAD METHODS ---------------------------
495+
496+
hytiny-stm32f103t.menu.upload_method.DFUUploadMethod=STM32duino bootloader
497+
hytiny-stm32f103t.menu.upload_method.DFUUploadMethod.upload.protocol=maple_dfu
498+
hytiny-stm32f103t.menu.upload_method.DFUUploadMethod.upload.tool=maple_upload
499+
hytiny-stm32f103t.menu.upload_method.DFUUploadMethod.build.upload_flags=-DSERIAL_USB
500+
hytiny-stm32f103t.menu.upload_method.DFUUploadMethod.build.vect=VECT_TAB_ADDR=0x8002000
501+
hytiny-stm32f103t.menu.upload_method.DFUUploadMethod.build.ldscript=ld/bootloader_20.ld
502+
hytiny-stm32f103t.menu.upload_method.DFUUploadMethod.upload.usbID=1EAF:0003
503+
hytiny-stm32f103t.menu.upload_method.DFUUploadMethod.upload.altID=2
504+
505+
hytiny-stm32f103t.menu.upload_method.serialMethod=Serial
506+
hytiny-stm32f103t.menu.upload_method.serialMethod.upload.protocol=maple_serial
507+
hytiny-stm32f103t.menu.upload_method.serialMethod.upload.tool=serial_upload
508+
509+
510+
hytiny-stm32f103t.menu.upload_method.STLinkMethod=STLink
511+
hytiny-stm32f103t.menu.upload_method.STLinkMethod.upload.protocol=STLink
512+
hytiny-stm32f103t.menu.upload_method.STLinkMethod.upload.tool=stlink_upload
513+
hytiny-stm32f103t.menu.upload_method.STLinkMethod.build.upload_flags=-DCONFIG_MAPLE_MINI_NO_DISABLE_DEBUG=1 -DSERIAL_USB -DGENERIC_BOOTLOADER
514+
515+
hytiny-stm32f103t.menu.upload_method.BMPMethod=BMP (Black Magic Probe)
516+
hytiny-stm32f103t.menu.upload_method.BMPMethod.upload.protocol=gdb_bmp
517+
hytiny-stm32f103t.menu.upload_method.BMPMethod.upload.tool=bmp_upload
518+
hytiny-stm32f103t.menu.upload_method.BMPMethod.build.upload_flags=-DCONFIG_MAPLE_MINI_NO_DISABLE_DEBUG
519+
520+
521+
hytiny-stm32f103t.menu.upload_method.jlinkMethod=JLink
522+
hytiny-stm32f103t.menu.upload_method.jlinkMethod.upload.protocol=jlink
523+
hytiny-stm32f103t.menu.upload_method.jlinkMethod.upload.tool=jlink_upload
524+
hytiny-stm32f103t.menu.upload_method.jlinkMethod.build.upload_flags=-DCONFIG_MAPLE_MINI_NO_DISABLE_DEBUG=1 -DSERIAL_USB -DGENERIC_BOOTLOADER
525+
526+
465527
###################### Generic GD32F103C ########################################
466528

467529
genericGD32F103C.name=Generic GD32F103C series
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
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_mini/board.cpp
29+
* &author Marti Bolivar <mbolivar&leaflabs.com>
30+
* &brief Maple Mini board file.
31+
*/
32+
33+
#include <board/board.h>
34+
35+
#include <libmaple/gpio.h>
36+
#include <libmaple/timer.h>
37+
38+
/* Roger Clark. Added next to includes for changes to Serial */
39+
#include <libmaple/usart.h>
40+
#include <HardwareSerial.h>
41+
42+
#include <wirish_debug.h>
43+
#include <wirish_types.h>
44+
45+
/* Since we want the Serial Wire/JTAG pins as GPIOs, disable both SW
46+
* and JTAG debug support, unless configured otherwise. */
47+
void boardInit(void) {
48+
#ifndef CONFIG_MAPLE_MINI_NO_DISABLE_DEBUG
49+
disableDebugPorts();
50+
#endif
51+
}
52+
53+
// Note. See the enum of pin names in board.h
54+
55+
extern const stm32_pin_info PIN_MAP[BOARD_NR_GPIO_PINS] = {
56+
57+
58+
{&gpioa, &timer2, &adc1, 0, 1, 0}, /* PA0 */
59+
{&gpioa, &timer2, &adc1, 1, 2, 1}, /* PA1 */
60+
{&gpioa, &timer2, &adc1, 2, 3, 2}, /* PA2 */
61+
{&gpioa, &timer2, &adc1, 3, 4, 3}, /* PA3 */
62+
{&gpioa, NULL, &adc1, 4, 0, 4}, /* PA4 */
63+
{&gpioa, NULL, &adc1, 5, 0, 5}, /* PA5 */
64+
{&gpioa, &timer3, &adc1, 6, 1, 6}, /* PA6 */
65+
{&gpioa, &timer3, &adc1, 7, 2, 7}, /* PA7 */
66+
{&gpioa, &timer1, NULL, 8, 1, ADCx}, /* PA8 */
67+
{&gpioa, &timer1, NULL, 9, 2, ADCx}, /* PA9 */
68+
{&gpioa, &timer1, NULL, 10, 3, ADCx}, /* PA10 */
69+
{&gpioa, &timer1, NULL, 11, 4, ADCx}, /* PA11 */
70+
{&gpioa, NULL, NULL, 12, 0, ADCx}, /* PA12 */
71+
{&gpioa, NULL, NULL, 13, 0, ADCx}, /* PA13 */
72+
{&gpioa, NULL, NULL, 14, 0, ADCx}, /* PA14 */
73+
{&gpioa, NULL, NULL, 15, 0, ADCx}, /* PA15 */
74+
75+
{&gpiob, &timer3, &adc1, 0, 3, 8}, /* PB0 */
76+
{&gpiob, &timer3, &adc1, 1, 4, 9}, /* PB1 */
77+
{&gpiob, NULL, NULL, 2, 0, ADCx}, /* PB2 */
78+
{&gpiob, NULL, NULL, 3, 0, ADCx}, /* PB3 */
79+
{&gpiob, NULL, NULL, 4, 0, ADCx}, /* PB4 */
80+
{&gpiob, NULL, NULL, 5, 0, ADCx}, /* PB5 */
81+
{&gpiob, &timer4, NULL, 6, 1, ADCx}, /* PB6 */
82+
{&gpiob, &timer4, NULL, 7, 2, ADCx}, /* PB7 */
83+
84+
};
85+
86+
extern const uint8 boardPWMPins[BOARD_NR_PWM_PINS] __FLASH__ = {
87+
PB0, PA7, PA6, PA3, PA2, PA1, PA0, PB7, PB6, PA10, PA9, PA8
88+
};
89+
90+
extern const uint8 boardADCPins[BOARD_NR_ADC_PINS] __FLASH__ = {
91+
PB0, PA7, PA6 , PA5 , PA4 , PA3 , PA2 , PA1 , PA0
92+
};
93+
94+
// Note. These defines are not really used by generic boards. They are for Maple Serial USB
95+
#define USB_DP PA12
96+
#define USB_DM PA11
97+
98+
// NOte. These definitions are not really used for generic boards, they only relate to boards modified to behave like Maple boards
99+
extern const uint8 boardUsedPins[BOARD_NR_USED_PINS] __FLASH__ = {
100+
USB_DP, USB_DM
101+
};
102+
103+
104+
/*
105+
* Roger Clark
106+
*
107+
* 2015/05/28
108+
*
109+
* Moved definitions for Hardware Serial devices from HardwareSerial.cpp so that each board can define which Arduino "Serial" instance
110+
* Maps to which hardware serial port on the microprocessor
111+
*/
112+
113+
#ifdef SERIAL_USB
114+
DEFINE_HWSERIAL(Serial1, 1);
115+
116+
DEFINE_HWSERIAL(Serial2, 2);
117+
118+
#else
119+
DEFINE_HWSERIAL(Serial, 1);
120+
121+
DEFINE_HWSERIAL(Serial1, 2);
122+
#endif
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
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_mini/include/board/board.h
29+
* @author Marti Bolivar <[email protected]>
30+
* @brief Maple Mini board header.
31+
*
32+
* See wirish/boards/maple/include/board/board.h for more information
33+
* on these definitions.
34+
*/
35+
36+
#ifndef _BOARD_GENERIC_STM32F103C_H_
37+
#define _BOARD_GENERIC_STM32F103C_H_
38+
39+
#define CYCLES_PER_MICROSECOND 72
40+
#define SYSTICK_RELOAD_VAL (F_CPU/1000) - 1 /* takes a cycle to reload */
41+
42+
#define BOARD_NR_USARTS 2
43+
#define BOARD_USART1_TX_PIN PA9
44+
#define BOARD_USART1_RX_PIN PA10
45+
#define BOARD_USART2_TX_PIN PA2
46+
#define BOARD_USART2_RX_PIN PA3
47+
48+
49+
#define BOARD_NR_SPI 1
50+
#define BOARD_SPI1_NSS_PIN PA4
51+
#define BOARD_SPI1_MOSI_PIN PA7
52+
#define BOARD_SPI1_MISO_PIN PA6
53+
#define BOARD_SPI1_SCK_PIN PA5
54+
55+
#define BOARD_NR_GPIO_PINS 35
56+
#define BOARD_NR_PWM_PINS 12
57+
#define BOARD_NR_ADC_PINS 9
58+
#define BOARD_NR_USED_PINS 4
59+
60+
#define BOARD_JTMS_SWDIO_PIN 22
61+
#define BOARD_JTCK_SWCLK_PIN 21
62+
#define BOARD_JTDI_PIN 20
63+
#define BOARD_JTDO_PIN 19
64+
#define BOARD_NJTRST_PIN 18
65+
66+
#define BOARD_USB_DISC_DEV GPIOA
67+
#define BOARD_USB_DISC_BIT 0
68+
69+
// Note this needs to match with the PIN_MAP array in board.cpp
70+
enum {
71+
PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10, PA11, PA12, PA13,PA14,PA15,
72+
PB0, PB1, PB2, PB3, PB4, PB5, PB6, PB7
73+
};
74+
75+
#endif
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* libmaple linker script for "Flash" builds.
3+
*
4+
* A Flash build puts .text (and .rodata) in Flash, and
5+
* .data/.bss/heap (of course) in SRAM, but offsets the sections by
6+
* enough space to store the Maple bootloader, which lives in low
7+
* Flash and uses low memory.
8+
*/
9+
10+
/*
11+
* This pulls in the appropriate MEMORY declaration from the right
12+
* subdirectory of stm32/mem/ (the environment must call ld with the
13+
* right include directory flags to make this happen). Boards can also
14+
* use this file to use any of libmaple's memory-related hooks (like
15+
* where the heap should live).
16+
*/
17+
MEMORY
18+
{
19+
ram (rwx) : ORIGIN = 0x20000000, LENGTH = 20K
20+
rom (rx) : ORIGIN = 0x08002000, LENGTH = 120K
21+
}
22+
23+
/* Provide memory region aliases for common.inc */
24+
REGION_ALIAS("REGION_TEXT", rom);
25+
REGION_ALIAS("REGION_DATA", ram);
26+
REGION_ALIAS("REGION_BSS", ram);
27+
REGION_ALIAS("REGION_RODATA", rom);
28+
29+
/* Let common.inc handle the real work. */
30+
INCLUDE common.inc

0 commit comments

Comments
 (0)