Browse Source

Support for MEEB 3DP board (#18138)

cccc 4 years ago
parent
commit
2bf63e29c6

+ 1 - 0
Marlin/src/core/boards.h

@@ -305,6 +305,7 @@
 #define BOARD_MKS_ROBIN_E3D           4026  // MKS Robin E3D (STM32F103RCT6)
 #define BOARD_MKS_ROBIN_E3            4027  // MKS Robin E3 (STM32F103RCT6)
 #define BOARD_MALYAN_M300             4028  // STM32F070-based delta
+#define BOARD_CCROBOT_MEEB_3DP        4029  // ccrobot-online.com MEEB_3DP (STM32F103RC)
 
 //
 // ARM Cortex-M4F

+ 2 - 0
Marlin/src/pins/pins.h

@@ -534,6 +534,8 @@
   #include "stm32f1/pins_MKS_ROBIN_E3D.h"       // STM32F1                                env:mks_robin_e3
 #elif MB(MKS_ROBIN_E3)
   #include "stm32f1/pins_MKS_ROBIN_E3.h"        // STM32F1                                env:mks_robin_e3
+#elif MB(CCROBOT_MEEB_3DP)
+  #include "stm32f1/pins_CCROBOT_MEEB_3DP.h"    // STM32F1                                env:STM32F103RC_cc_meeb_3dp
 
 //
 // ARM Cortex-M4F

+ 173 - 0
Marlin/src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h

@@ -0,0 +1,173 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program 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.
+ *
+ * This program 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/>.
+ *
+ */
+#pragma once
+
+#ifndef TARGET_STM32F1
+  #error "Oops! Select an STM32F1 board in 'Tools > Board.'"
+#elif HOTENDS > 1 || E_STEPPERS > 1
+  #error "CCROBOT-ONLINE MEEB_3DP only supports 1 hotend / E-stepper. Comment out this line to continue."
+#endif
+
+// https://github.com/ccrobot-online/MEEB_3DP
+// Pin assignments for 32-bit MEEB_3DP
+#define BOARD_INFO_NAME "CCROBOT-ONLINE MEEB_3DP"
+#define DEFAULT_MACHINE_NAME "STM32F103RCT6"
+#define BOARD_WEBSITE_URL "ccrobot-online.com"
+
+//
+// Release PB4 from JTAG NRST role
+//
+#define DISABLE_JTAG
+
+//
+// EEPROM
+//
+#if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION)
+  #define FLASH_EEPROM_EMULATION
+  #define EEPROM_PAGE_SIZE     0x800U             // 2KB
+  #define EEPROM_START_ADDRESS (0x8000000UL + (STM32_FLASH_SIZE) * 1024UL - (EEPROM_PAGE_SIZE) * 2UL)
+  #define MARLIN_EEPROM_SIZE   0x1000             // 4KB
+#endif
+
+//
+// Servos
+//
+#define SERVO0_PIN                          PA1
+
+//
+// Limit Switches
+//
+#define X_STOP_PIN                          PC0
+#define Y_STOP_PIN                          PC1
+#define Z_STOP_PIN                          PC2
+
+//
+// Z Probe must be this pin
+//
+#define Z_MIN_PROBE_PIN                     PC15  // "PROBE"
+
+//
+// TMC2208 stepper drivers
+//
+#define X_ENABLE_PIN                        PB4
+#define X_STEP_PIN                          PC12
+#define X_DIR_PIN                           PC11
+
+#define Y_ENABLE_PIN                        PC10
+#define Y_STEP_PIN                          PB14
+#define Y_DIR_PIN                           PB13
+
+#define Z_ENABLE_PIN                        PB12
+#define Z_STEP_PIN                          PB2
+#define Z_DIR_PIN                           PB1
+
+#define E0_ENABLE_PIN                       PB0
+#define E0_STEP_PIN                         PA6
+#define E0_DIR_PIN                          PA5
+
+// Stepper drivers Serial UART
+#define X_SERIAL_TX_PIN                     PB3
+#define X_SERIAL_RX_PIN                     PD2
+#define Y_SERIAL_TX_PIN                     PA15
+#define Y_SERIAL_RX_PIN                     PC6
+#define Z_SERIAL_TX_PIN                     PB11
+#define Z_SERIAL_RX_PIN                     PB10
+#define E0_SERIAL_TX_PIN                    PC5
+#define E0_SERIAL_RX_PIN                    PC4
+
+// Reduce baud rate to improve software serial reliability
+#define TMC_BAUD_RATE 19200
+
+//
+// Temperature Sensors
+//
+#define TEMP_0_PIN                          PA0   // TH0
+#define TEMP_BED_PIN                        PC3   // THB
+
+//
+// Heaters / Fans
+//
+#define HEATER_0_PIN                        PC8   // HEATER0
+#define HEATER_BED_PIN                      PC9   // HOT BED
+
+#define FAN_PIN                             PA7   // FAN  (fan2 on board) model cool fan
+#define FAN1_PIN                            PA8   // FAN  (fan0 on board) e0 cool fan
+#define FAN2_PIN                            PB9   // FAN  (fan1 on board) controller cool fan
+
+// One neopixel onboard and a connector for other neopixels
+#define NEOPIXEL_PIN                        PC7   // The NEOPIXEL LED driving pin
+
+/**
+ *     1 _____ 2
+ *  PB5 | · · | PB6
+ *  PA2 | · · | RESET
+ *  PA3 | · · | PB8
+ *  PB7 | · · | PA4
+ *  GND | · · | VCC5
+ *     9 ----- 10
+ *      LCD EXP
+ */
+
+//
+// LCD / Controller
+//
+#if ENABLED(CR10_STOCKDISPLAY)
+  #define BEEPER_PIN                        PB5
+  #define BTN_EN1                           PA2
+  #define BTN_EN2                           PA3
+  #define BTN_ENC                           PB6
+
+  #define LCD_PINS_RS                       PB7   // CS -- SOFT SPI for ENDER3 LCD
+  #define LCD_PINS_D4                       PB8   // SCLK
+  #define LCD_PINS_ENABLE                   PA4   // DATA MOSI
+#endif
+
+// Alter timing for graphical display
+#if HAS_GRAPHICAL_LCD
+  #define BOARD_ST7920_DELAY_1 DELAY_NS(125)
+  #define BOARD_ST7920_DELAY_2 DELAY_NS(125)
+  #define BOARD_ST7920_DELAY_3 DELAY_NS(125)
+#endif
+
+//
+// Camera
+//
+#define CHDK_PIN                            PB15
+
+#if 0
+
+//
+// SD-NAND
+//
+#if SD_CONNECTION_IS(ONBOARD)
+  #define ENABLE_SPI1
+  #define SD_DETECT_PIN                     -1
+  #define SCK_PIN                           PA5
+  #define MISO_PIN                          PA6
+  #define MOSI_PIN                          PA7
+  #define SS_PIN                            PA4
+#endif
+
+#define ON_BOARD_SPI_DEVICE 1                     // SPI1
+#define ONBOARD_SD_CS_PIN                   PA4   // Chip select for SD-NAND
+
+#endif

+ 53 - 0
buildroot/share/PlatformIO/boards/MEEB_3DP.json

@@ -0,0 +1,53 @@
+{
+  "build": {
+    "core": "maple",
+    "cpu": "cortex-m3",
+    "extra_flags": "-DSTM32F103xE -DSTM32F1",
+    "f_cpu": "72000000L",
+    "hwids": [
+      [
+        "0x1EAF",
+        "0x0003"
+      ],
+      [
+        "0x1EAF",
+        "0x0004"
+      ]
+    ],
+    "libopencm3": {
+      "ldscript": "stm32f103xc.ld"
+    },
+    "mcu": "stm32f103rct6",
+    "variant": "MEEB_3DP"
+  },
+  "debug": {
+    "jlink_device": "STM32F103RC",
+    "openocd_target": "stm32f1x",
+    "svd_path": "STM32F103xx.svd"
+  },
+  "frameworks": [
+    "arduino",
+    "cmsis",
+    "libopencm3",
+    "stm32cube"
+  ],
+  "name": "3D Printer control board for MEEB with 512k flash/rs422 bus/tmc2208 drivers",
+  "upload": {
+    "disable_flushing": false,
+    "maximum_ram_size": 49152,
+    "maximum_size": 524288,
+    "protocol": "dfu",
+    "protocols": [
+      "jlink",
+      "stlink",
+      "blackmagic",
+      "serial",
+      "dfu"
+    ],
+    "require_upload_port": true,
+    "use_1200bps_touch": false,
+    "wait_for_upload_port": false
+  },
+  "url": "https://github.com/ccrobot-online/MEEB_3DP",
+  "vendor": "CCROBOT-ONLINE"
+}

+ 14 - 0
buildroot/share/PlatformIO/ldscripts/STM32F103RC_MEEB_3DP.ld

@@ -0,0 +1,14 @@
+MEMORY
+{
+  ram (rwx) : ORIGIN = 0x20000000, LENGTH = 48K - 40
+  rom (rx)  : ORIGIN = 0x08002000, LENGTH = 512K - 8K - 4K
+}
+
+/* Provide memory region aliases for common.inc */
+REGION_ALIAS("REGION_TEXT", rom);
+REGION_ALIAS("REGION_DATA", ram);
+REGION_ALIAS("REGION_BSS", ram);
+REGION_ALIAS("REGION_RODATA", rom);
+
+/* Let common.inc handle the real work. */
+INCLUDE common.inc

+ 61 - 0
buildroot/share/PlatformIO/scripts/STM32F103RC_MEEB_3DP.py

@@ -0,0 +1,61 @@
+try:
+    import configparser
+except ImportError:
+    import ConfigParser as configparser
+
+import os
+Import("env", "projenv")
+# access to global build environment
+print(env)
+# access to project build environment (is used source files in "src" folder)
+print(projenv)
+
+config = configparser.ConfigParser()
+config.read("platformio.ini")
+
+#com_port = config.get("env:STM32F103RC_cc_meeb_3dp", "upload_port")
+#print('Use the {0:s} to reboot the board to dfu mode.'.format(com_port))
+
+#
+# Upload actions
+#
+
+def before_upload(source, target, env):
+    print("before_upload")
+    # do some actions
+    # use com_port
+    #
+    env.Execute("pwd")
+
+def after_upload(source, target, env):
+    print("after_upload")
+    # do some actions
+    #
+    #
+    env.Execute("pwd")
+
+print("Current build targets", map(str, BUILD_TARGETS))
+
+env.AddPreAction("upload", before_upload)
+env.AddPostAction("upload", after_upload)
+
+flash_size = 0
+vect_tab_addr = 0
+
+for define in env['CPPDEFINES']:
+    if define[0] == "VECT_TAB_ADDR":
+        vect_tab_addr = define[1]
+    if define[0] == "STM32_FLASH_SIZE":
+        flash_size = define[1]
+
+print('Use the {0:s} address as the marlin app entry point.'.format(vect_tab_addr))        
+print('Use the {0:d}KB flash version of stm32f103rct6 chip.'.format(flash_size))
+
+custom_ld_script = os.path.abspath("buildroot/share/PlatformIO/ldscripts/STM32F103RC_MEEB_3DP.ld")
+for i, flag in enumerate(env["LINKFLAGS"]):
+    if "-Wl,-T" in flag:
+        env["LINKFLAGS"][i] = "-Wl,-T" + custom_ld_script
+    elif flag == "-T":
+        env["LINKFLAGS"][i + 1] = custom_ld_script
+        
+        

+ 34 - 0
buildroot/share/PlatformIO/scripts/STM32F103RC_MEEB_3DP_create_variant.py

@@ -0,0 +1,34 @@
+import os,shutil
+from SCons.Script import DefaultEnvironment
+from platformio import util
+
+def copytree(src, dst, symlinks=False, ignore=None):
+    for item in os.listdir(src):
+        s = os.path.join(src, item)
+        d = os.path.join(dst, item)
+        if os.path.isdir(s):
+            shutil.copytree(s, d, symlinks, ignore)
+        else:
+            shutil.copy2(s, d)
+
+env = DefaultEnvironment()
+platform = env.PioPlatform()
+board = env.BoardConfig()
+
+FRAMEWORK_DIR = platform.get_package_dir("framework-arduinoststm32-maple")
+assert os.path.isdir(FRAMEWORK_DIR)
+assert os.path.isdir("buildroot/share/PlatformIO/variants")
+
+variant = board.get("build.variant")
+variant_dir = os.path.join(FRAMEWORK_DIR, "STM32F1", "variants", variant)
+
+source_dir = os.path.join("buildroot/share/PlatformIO/variants", variant)
+assert os.path.isdir(source_dir)
+
+if os.path.isdir(variant_dir):
+    shutil.rmtree(variant_dir)
+    
+if not os.path.isdir(variant_dir):
+    os.mkdir(variant_dir)
+
+copytree(source_dir, variant_dir)

+ 162 - 0
buildroot/share/PlatformIO/variants/MEEB_3DP/board.cpp

@@ -0,0 +1,162 @@
+/******************************************************************************
+ * The MIT License
+ *
+ * Copyright (c) 2011 LeafLabs, LLC.
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use, copy,
+ * modify, merge, publish, distribute, sublicense, and/or sell copies
+ * of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *****************************************************************************/
+
+/**
+ * @file   wirish/boards/maple/board.cpp
+ * @author Marti Bolivar <mbolivar@leaflabs.com>
+ * @brief  Maple board file.
+ */
+
+#include <board/board.h>         // For this board's header file
+
+
+/* Roger Clark. Added next to includes for changes to Serial */
+#include <libmaple/usart.h>
+#include <HardwareSerial.h>
+
+#include <wirish_types.h> // For stm32_pin_info and its contents
+                                 // (these go into PIN_MAP).
+
+#include "boards_private.h"      // For PMAP_ROW(), which makes
+                                 // PIN_MAP easier to read.
+
+// boardInit(): nothing special to do for Maple.
+//
+// When defining your own board.cpp, you can put extra code in this
+// function if you have anything you want done on reset, before main()
+// or setup() are called.
+//
+// If there's nothing special you need done, feel free to leave this
+// function out, as we do here.
+
+void boardInit(void) {
+    // afio_remap(AFIO_REMAP_I2C1);
+}
+
+
+// Pin map: this lets the basic I/O functions (digitalWrite(),
+// analogRead(), pwmWrite()) translate from pin numbers to STM32
+// peripherals.
+//
+// PMAP_ROW() lets us specify a row (really a struct stm32_pin_info)
+// in the pin map. Its arguments are:
+//
+// - GPIO device for the pin (&gpioa, etc.)
+// - GPIO bit for the pin (0 through 15)
+// - Timer device, or NULL if none
+// - Timer channel (1 to 4, for PWM), or 0 if none
+// - ADC device, or NULL if none
+// - ADC channel, or ADCx if none
+
+extern const stm32_pin_info PIN_MAP[BOARD_NR_GPIO_PINS] = {
+/*
+    gpio_dev *gpio_device;      GPIO device 
+    timer_dev *timer_device;    Pin's timer device, if any.
+    const adc_dev *adc_device;  ADC device, if any. 
+    uint8 gpio_bit;             Pin's GPIO port bit. 
+    uint8 timer_channel;        Timer channel, or 0 if none. 
+    uint8 adc_channel;          Pin ADC channel, or ADCx if none. 
+*/
+
+    {&gpioa, &timer2, &adc1,  0, 1,    0}, /* PA0 */
+    {&gpioa, &timer2, &adc1,  1, 2,    1}, /* PA1 */
+	{&gpioa, &timer2, &adc1,  2, 3,    2}, /* PA2 */
+    {&gpioa, &timer2, &adc1,  3, 4,    3}, /* PA3 */
+	{&gpioa,   NULL, &adc1,  4, 0,    4}, /* PA4 */	
+    {&gpioa,   NULL, &adc1,  5, 0,    5}, /* PA5 */
+    {&gpioa, &timer3, &adc1,  6, 1,    6}, /* PA6 */
+    {&gpioa, &timer3, &adc1,  7, 2,    7}, /* PA7 */
+    {&gpioa, &timer1, NULL,  8, 1, ADCx}, /* PA8 */
+    {&gpioa, &timer1, NULL,  9, 2, ADCx}, /* PA9 */
+    {&gpioa, &timer1, NULL, 10, 3, ADCx}, /* PA10 */
+    {&gpioa,   NULL, NULL, 11, 0, ADCx}, /* PA11 */
+    {&gpioa,   NULL, NULL, 12, 0, ADCx}, /* PA12 */	
+    {&gpioa,   NULL, NULL, 13, 0, ADCx}, /* PA13 */
+    {&gpioa,   NULL, NULL, 14, 0, ADCx}, /* PA14 */
+    {&gpioa,   NULL, NULL, 15, 0, ADCx}, /* PA15 */
+	
+	{&gpiob, &timer3, &adc1,  0, 3,    8}, /* PB0 */
+	{&gpiob, &timer3, &adc1,  1, 4,    9}, /* PB1 */
+	{&gpiob,   NULL, NULL,  2, 0, ADCx}, /* PB2  */	
+	{&gpiob,   NULL, NULL,  3, 0, ADCx}, /* PB3  */
+    {&gpiob,   NULL, NULL,  4, 0, ADCx}, /* PB4  */
+    {&gpiob,   NULL, NULL,  5, 0, ADCx}, /* PB5 */
+    {&gpiob, &timer4, NULL,  6, 1, ADCx}, /* PB6 */
+    {&gpiob, &timer4, NULL,  7, 2, ADCx}, /* PB7 */
+    {&gpiob, &timer4, NULL,  8, 3, ADCx}, /* PB8 */
+	{&gpiob,   NULL, NULL,  9, 0, ADCx}, /* PB9 */
+    {&gpiob,   NULL, NULL, 10, 0, ADCx}, /* PB10 */
+    {&gpiob,   NULL, NULL, 11, 0, ADCx}, /* PB11 */
+    {&gpiob,   NULL, NULL, 12, 0, ADCx}, /* PB12 */
+    {&gpiob,   NULL, NULL, 13, 0, ADCx}, /* PB13 */
+    {&gpiob,   NULL, NULL, 14, 0, ADCx}, /* PB14 */
+    {&gpiob,   NULL, NULL, 15, 0, ADCx}, /* PB15 */
+
+
+    {&gpioc,   NULL, &adc1,  0, 0,   10}, /* PC0 */
+    {&gpioc,   NULL, &adc1,  1, 0,   11}, /* PC1 */
+    {&gpioc,   NULL, &adc1,  2, 0,   12}, /* PC2 */
+    {&gpioc,   NULL, &adc1,  3, 0,   13}, /* PC3 */
+    {&gpioc,   NULL, &adc1,  4, 0,   14}, /* PC4 */
+    {&gpioc,   NULL, &adc1,  5, 0,   15}, /* PC5 */
+    {&gpioc, &timer8, NULL,  6, 1, ADCx}, /* PC6 */	
+	{&gpioc, &timer8, NULL,  7, 2, ADCx}, /* PC7 */
+    {&gpioc, &timer8, NULL,  8, 3, ADCx}, /* PC8 */
+    {&gpioc, &timer8, NULL,  9, 4, ADCx}, /* PC9 */
+    {&gpioc,   NULL, NULL, 10, 0, ADCx}, /* PC10 UART4_TX/SDIO_D2 */
+    {&gpioc,   NULL, NULL, 11, 0, ADCx}, /* PC11 UART4_RX/SDIO_D3 */
+    {&gpioc,   NULL, NULL, 12, 0, ADCx}, /* PC12 UART5_TX/SDIO_CK */	
+    {&gpioc,   NULL, NULL, 13, 0, ADCx}, /* PC13 TAMPER-RTC */
+    {&gpioc,   NULL, NULL, 14, 0, ADCx}, /* PC14 OSC32_IN */
+    {&gpioc,   NULL, NULL, 15, 0, ADCx}, /* PC15 OSC32_OUT */
+
+	{&gpiod,   NULL, NULL,   0, 0, ADCx} , /* PD0 OSC_IN */
+	{&gpiod,   NULL, NULL,   1, 0, ADCx} , /* PD1  OSC_OUT */
+	{&gpiod,   NULL, NULL,   2, 0, ADCx} , /* PD2  TIM3_ETR/UART5_RX SDIO_CMD */
+};
+
+/*  Basically everything that is defined as having a timer us PWM */
+extern const uint8 boardPWMPins[BOARD_NR_PWM_PINS] __FLASH__ = {
+    PA0,PA1,PA2,PA3,PA6,PA7,PA8,PA9,PA10,PB0,PB1,PB6,PB7,PB8,PB9,PC6,PC7,PC8,PC9
+};
+
+/*  Basically everything that is defined having ADC */
+extern const uint8 boardADCPins[BOARD_NR_ADC_PINS] __FLASH__ = {
+    PA0,PA1,PA2,PA3,PA4,PA5,PA6,PA7,PB0,PB1,PC0,PC1,PC2,PC3,PC4,PC5
+};
+
+/* not sure what this us used for */
+extern const uint8 boardUsedPins[BOARD_NR_USED_PINS] __FLASH__ = {
+    BOARD_JTMS_SWDIO_PIN,
+    BOARD_JTCK_SWCLK_PIN, BOARD_JTDI_PIN, BOARD_JTDO_PIN, BOARD_NJTRST_PIN
+};
+
+DEFINE_HWSERIAL(Serial1, 1);
+DEFINE_HWSERIAL(Serial2, 2);
+DEFINE_HWSERIAL(Serial3, 3);
+DEFINE_HWSERIAL_UART(Serial4, 4);
+DEFINE_HWSERIAL_UART(Serial5, 5);
+

+ 125 - 0
buildroot/share/PlatformIO/variants/MEEB_3DP/board/board.h

@@ -0,0 +1,125 @@
+/******************************************************************************
+ * The MIT License
+ *
+ * Copyright (c) 2011 LeafLabs, LLC.
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use, copy,
+ * modify, merge, publish, distribute, sublicense, and/or sell copies
+ * of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *****************************************************************************/
+
+/**
+ * @file   maple_RET6.h
+ * @author Marti Bolivar <mbolivar@leaflabs.com>
+ * @brief  Private include file for Maple RET6 Edition in boards.h
+ *
+ * See maple.h for more information on these definitions.
+ */
+
+#ifndef _BOARDS_GENERIC_STM32F103R_H_
+#define _BOARDS_GENERIC_STM32F103R_H_
+
+/* A few of these values will seem strange given that it's a
+ * high-density board. */
+
+#define CYCLES_PER_MICROSECOND  72
+#define SYSTICK_RELOAD_VAL     (F_CPU/1000) - 1 /* takes a cycle to reload */
+
+// USARTS
+#define BOARD_NR_USARTS         5
+#define BOARD_USART1_TX_PIN     PA9
+#define BOARD_USART1_RX_PIN     PA10
+
+#define BOARD_USART2_TX_PIN     PA2
+#define BOARD_USART2_RX_PIN     PA3
+
+#define BOARD_USART3_TX_PIN     PB10
+#define BOARD_USART3_RX_PIN     PB11
+
+#define BOARD_USART4_TX_PIN     PC10
+#define BOARD_USART4_RX_PIN     PC11
+
+#define BOARD_USART5_TX_PIN     PC12
+#define BOARD_USART5_RX_PIN     PD2
+
+/* Note:
+ *
+ * SPI3 is unusable due to pin 43 (PB4) and NRST tie-together :(, but
+ * leave the definitions so as not to clutter things up.  This is only
+ * OK since RET6 Ed. is specifically advertised as a beta board. */
+#define BOARD_NR_SPI            3
+#define BOARD_SPI1_NSS_PIN      PA4
+#define BOARD_SPI1_SCK_PIN      PA5
+#define BOARD_SPI1_MISO_PIN     PA6
+#define BOARD_SPI1_MOSI_PIN     PA7
+
+
+
+#define BOARD_SPI2_NSS_PIN      PB12
+#define BOARD_SPI2_SCK_PIN      PB13
+#define BOARD_SPI2_MISO_PIN     PB14
+#define BOARD_SPI2_MOSI_PIN     PB15
+
+
+#define BOARD_SPI3_NSS_PIN      PA15
+#define BOARD_SPI3_SCK_PIN      PB3
+#define BOARD_SPI3_MISO_PIN     PB4
+#define BOARD_SPI3_MOSI_PIN     PB5
+
+
+/* GPIO A to E = 5 * 16  - BOOT1 not used = 79*/
+#define BOARD_NR_GPIO_PINS      51
+/* Note: NOT 19. The missing one is D38 a.k.a. BOARD_BUTTON_PIN, which
+ * isn't broken out to a header and is thus unusable for PWM. */
+#define BOARD_NR_PWM_PINS       19
+#define BOARD_NR_ADC_PINS       16
+#define BOARD_NR_USED_PINS      7
+
+#define BOARD_JTMS_SWDIO_PIN    39
+#define BOARD_JTCK_SWCLK_PIN    40
+#define BOARD_JTDI_PIN          41
+#define BOARD_JTDO_PIN          42
+#define BOARD_NJTRST_PIN        43
+
+/* USB configuration.  BOARD_USB_DISC_DEV is the GPIO port containing
+ * the USB_DISC pin, and BOARD_USB_DISC_BIT is that pin's bit. */
+#define BOARD_USB_DISC_DEV      GPIOC
+#define BOARD_USB_DISC_BIT      12
+
+/*
+ * SDIO Pins
+ */
+#define BOARD_SDIO_D0 			PC8
+#define BOARD_SDIO_D1 			PC9
+#define BOARD_SDIO_D2 			PC10
+#define BOARD_SDIO_D3 			PC11
+#define BOARD_SDIO_CLK 			PC12
+#define BOARD_SDIO_CMD 			PD2
+
+/* Pin aliases: these give the GPIO port/bit for each pin as an
+ * enum. These are optional, but recommended. They make it easier to
+ * write code using low-level GPIO functionality. */
+enum {
+PA0,PA1,PA2,PA3,PA4,PA5,PA6,PA7,PA8,PA9,PA10,PA11,PA12,PA13,PA14,PA15,
+PB0,PB1,PB2,PB3,PB4,PB5,PB6,PB7,PB8,PB9,PB10,PB11,PB12,PB13,PB14,PB15,
+PC0,PC1,PC2,PC3,PC4,PC5,PC6,PC7,PC8,PC9,PC10,PC11,PC12,PC13,PC14,PC15,
+PD0,PD1,PD2
+};/* Note PB2 is skipped as this is Boot1 and is not going to be much use as its likely to be pulled permanently low */
+
+#endif

+ 18 - 0
buildroot/share/PlatformIO/variants/MEEB_3DP/ld/bootloader.ld

@@ -0,0 +1,18 @@
+/*
+ * Linker script for Generic STM32F103RE boards, using the generic bootloader (which takes the lower 8k of memory)
+ */
+MEMORY
+{
+	ram (rwx) : ORIGIN = 0x20000000, LENGTH = 64K
+	rom (rx) : ORIGIN = 0x08002000, LENGTH = 504K
+}
+
+
+/* Provide memory region aliases for common.inc */
+REGION_ALIAS("REGION_TEXT", rom);
+REGION_ALIAS("REGION_DATA", ram);
+REGION_ALIAS("REGION_BSS", ram);
+REGION_ALIAS("REGION_RODATA", rom);
+
+/* Let common.inc handle the real work. */
+INCLUDE common.inc

Some files were not shown because too many files changed in this diff