aboutsummaryrefslogtreecommitdiffstats
path: root/os
diff options
context:
space:
mode:
Diffstat (limited to 'os')
-rw-r--r--os/common/ports/ARMCMx/compilers/GCC/ld/STM32F103xE_maplemini_bootloader.ld32
-rw-r--r--os/hal/boards/MAPLEMINI_STM32_F103/board.c2
-rw-r--r--os/hal/boards/MAPLEMINI_STM32_F103/board.h70
3 files changed, 96 insertions, 8 deletions
diff --git a/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F103xE_maplemini_bootloader.ld b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F103xE_maplemini_bootloader.ld
new file mode 100644
index 000000000..0c7553296
--- /dev/null
+++ b/os/common/ports/ARMCMx/compilers/GCC/ld/STM32F103xE_maplemini_bootloader.ld
@@ -0,0 +1,32 @@
+/*
+ ChibiOS/RT - Copyright (C) 2006-2015 Giovanni Di Sirio
+
+ This file is part of ChibiOS.
+
+ ChibiOS is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ ChibiOS is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+/*
+ * ST32F103xE memory setup for use with the maplemini bootloader.
+ * You will have to
+ * #define CORTEX_VTOR_INIT 0x5000
+ * in your projects chconf.h
+ */
+MEMORY
+{
+ flash : org = 0x08005000, len = 512k - 0x5000
+ ram : org = 0x20000C00, len = 64k - 0xC00
+}
+
+INCLUDE rules.ld
diff --git a/os/hal/boards/MAPLEMINI_STM32_F103/board.c b/os/hal/boards/MAPLEMINI_STM32_F103/board.c
index e90f4db3f..b620f2ba4 100644
--- a/os/hal/boards/MAPLEMINI_STM32_F103/board.c
+++ b/os/hal/boards/MAPLEMINI_STM32_F103/board.c
@@ -1,5 +1,5 @@
/*
- ChibiOS/RT - Copyright (C) 2006-2014 Giovanni Di Sirio
+ ChibiOS/RT - Copyright (C) 2006-2015 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/os/hal/boards/MAPLEMINI_STM32_F103/board.h b/os/hal/boards/MAPLEMINI_STM32_F103/board.h
index 6201ce031..51f83339b 100644
--- a/os/hal/boards/MAPLEMINI_STM32_F103/board.h
+++ b/os/hal/boards/MAPLEMINI_STM32_F103/board.h
@@ -1,5 +1,5 @@
/*
- ChibiOS/RT - Copyright (C) 2006-2014 Giovanni Di Sirio
+ ChibiOS/RT - Copyright (C) 2006-2015 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -39,9 +39,64 @@
#define STM32F10X_MD
/*
- * IO pins assignments.
+ * IO pins assignments
+ *
+ * numbering is sorted by onboard/connectors, as from the schematics in
+ * https://github.com/leaflabs/maplemini
*/
-/* Missing.*/
+
+/* on-board */
+
+#define GPIOB_LED 1
+#define GPIOB_USB_DISC 9
+#define GPIOD_OSC_IN 0
+#define GPIOD_OSC_OUT 1
+
+/* J1 connector */
+
+// pin 1: AV+
+// pin 2: AV-
+// pin 3: VBAT
+#define GPIOC_TAMPER_RTC 13 // pin 4
+#define GPIOC_OSC32_IN 14 // pin 5
+#define GPIOC_OSD32_OUT 15 // pin 6
+// pin 7: RESET
+#define GPIOA_USART2_CTS 0 // pin 8
+#define GPIOA_USART2_RTS 1 // pin 9
+#define GPIOA_USART2_TX 2 // pin 10
+#define GPIOA_USART2_RX 3 // pin 11
+#define GPIOA_SPI1_NSS 4 // pin 12
+#define GPIOA_SPI1_SCK 5 // pin 13
+#define GPIOA_SPI1_MISO 6 // pin 14
+#define GPIOA_SPI1_MOSI 7 // pin 15
+#define GPIOB_ADC12_IN8 0 // pin 16
+#define GPIOB_BOOT1 2 // pin 17
+#define GPIOB_I2C2_SCL 10 // pin 18
+#define GPIOB_I2C2_SDA 11 // pin 19
+// pin 20: VIN
+
+/* J2 connector */
+
+#define GPIOB_SPI2_NSS 12 // pin 1
+#define GPIOB_SPI2_SCK 13 // pin 2
+#define GPIOB_SPI2_MISO 14 // pin 3
+#define GPIOB_SPI2_MOSI 15 // pin 4
+#define GPIOA_USART1_CK 8 // pin 5
+#define GPIOA_USART1_TX 9 // pin 6
+#define GPIOA_USART1_RX 10 // pin 7
+#define GPIOA_USBDM 11 // pin 8
+#define GPIOA_USBDP 12 // pin 9
+#define GPIOA_JTMS 13 // pin 10
+#define GPIOA_JTCK 14 // pin 11
+#define GPIOA_JTDI 15 // pin 12
+#define GPIOB_JTDO 3 // pin 13
+#define GPIOB_JTRST 4 // pin 14
+#define GPIOB_I2C1_SMBA 5 // pin 15
+#define GPIOB_I2C1_SCL 6 // pin 16
+#define GPIOB_I2C1_SDA 7 // pin 17
+#define GPIOB_BOOT0_BUTTON 8 // pin 18
+// pin 19: GND
+// pin 20: VCC
/*
* I/O ports initial setup, this configuration is established soon after reset
@@ -82,10 +137,11 @@
/*
* Port B setup.
* Everything input with pull-up except:
- * PB1 - Push Pull output (LED).
+ * PB1 - Push Pull output (LED).
+ * PB9 - Push Pull output (USB switch).
*/
#define VAL_GPIOBCRL 0x88888838 /* PB7...PB0 */
-#define VAL_GPIOBCRH 0x88888888 /* PB15...PB8 */
+#define VAL_GPIOBCRH 0x88888838 /* PB15...PB8 */
#define VAL_GPIOBODR 0xFFFFFFFF
/*
@@ -117,12 +173,12 @@
/*
* USB bus activation macro, required by the USB driver.
*/
-#define usb_lld_connect_bus(usbp) palClearPad(GPIOC, GPIOC_USB_DISC)
+#define usb_lld_connect_bus(usbp) palClearPad(GPIOB, GPIOB_USB_DISC)
/*
* USB bus de-activation macro, required by the USB driver.
*/
-#define usb_lld_disconnect_bus(usbp) palSetPad(GPIOC, GPIOC_USB_DISC)
+#define usb_lld_disconnect_bus(usbp) palSetPad(GPIOB, GPIOB_USB_DISC)
#if !defined(_FROM_ASM_)
#ifdef __cplusplus