SoftwareSerialM for SKR STM32F1 boards (#15875)

This commit is contained in:
Jason Smith 2019-11-12 20:16:54 -08:00 committed by Scott Lahteine
parent 8e7d1004cf
commit 9fd35c84ce
21 changed files with 39 additions and 30 deletions

View File

@ -25,7 +25,7 @@
#include "math.h" #include "math.h"
#ifdef USBCON #ifdef USBCON
#include "HardwareSerial.h" #include <HardwareSerial.h>
#else #else
#define HardwareSerial_h // Hack to prevent HardwareSerial.h header inclusion #define HardwareSerial_h // Hack to prevent HardwareSerial.h header inclusion
#include "MarlinSerial.h" #include "MarlinSerial.h"

View File

@ -23,7 +23,7 @@
#include "../../inc/MarlinConfig.h" #include "../../inc/MarlinConfig.h"
#include "Stream.h" #include <Stream.h>
#ifndef RX_BUFFER_SIZE #ifndef RX_BUFFER_SIZE
#define RX_BUFFER_SIZE 128 #define RX_BUFFER_SIZE 128

View File

@ -26,10 +26,10 @@
#include "i2s.h" #include "i2s.h"
#include "../shared/Marduino.h" #include "../shared/Marduino.h"
#include "driver/periph_ctrl.h" #include <driver/periph_ctrl.h>
#include "rom/lldesc.h" #include <rom/lldesc.h>
#include "soc/i2s_struct.h" #include <soc/i2s_struct.h>
#include "freertos/queue.h" #include <freertos/queue.h>
#include "../../module/stepper.h" #include "../../module/stepper.h"
#define DMA_BUF_COUNT 8 // number of DMA buffers to store data #define DMA_BUF_COUNT 8 // number of DMA buffers to store data

View File

@ -27,7 +27,7 @@
#include <ESPmDNS.h> #include <ESPmDNS.h>
#include <WiFiUdp.h> #include <WiFiUdp.h>
#include <ArduinoOTA.h> #include <ArduinoOTA.h>
#include "driver/timer.h" #include <driver/timer.h>
void OTA_init() { void OTA_init() {
ArduinoOTA ArduinoOTA

View File

@ -23,10 +23,10 @@
#ifdef ARDUINO_ARCH_ESP32 #ifdef ARDUINO_ARCH_ESP32
#include <stdio.h> #include <stdio.h>
#include "esp_types.h" #include <esp_types.h>
#include "soc/timer_group_struct.h" #include <soc/timer_group_struct.h>
#include "driver/periph_ctrl.h" #include <driver/periph_ctrl.h>
#include "driver/timer.h" #include <driver/timer.h>
#include "HAL.h" #include "HAL.h"

View File

@ -22,7 +22,7 @@
#pragma once #pragma once
#include <stdint.h> #include <stdint.h>
#include "driver/timer.h" #include <driver/timer.h>
// Includes needed to get I2S_STEPPER_STREAM. Note that pins.h // Includes needed to get I2S_STEPPER_STREAM. Note that pins.h
// is included in case this header is being included early. // is included in case this header is being included early.

View File

@ -56,7 +56,7 @@
// ------------------------ // ------------------------
#if ENABLED(LPC_SOFTWARE_SPI) #if ENABLED(LPC_SOFTWARE_SPI)
#include "SoftwareSPI.h" #include <SoftwareSPI.h>
// Software SPI // Software SPI

View File

@ -46,7 +46,7 @@
#if ENABLED(FLASH_EEPROM_EMULATION) #if ENABLED(FLASH_EEPROM_EMULATION)
extern "C" { extern "C" {
#include "lpc17xx_iap.h" #include <lpc17xx_iap.h>
} }
#define SECTOR_START(sector) ((sector < 16) ? (sector * 0x1000) : ((sector - 14) * 0x8000)) #define SECTOR_START(sector) ((sector < 16) ? (sector * 0x1000) : ((sector - 14) * 0x8000))

View File

@ -60,7 +60,7 @@
#if ENABLED(U8GLIB_ST7920) #if ENABLED(U8GLIB_ST7920)
#include <U8glib.h> #include <U8glib.h>
#include "SoftwareSPI.h" #include <SoftwareSPI.h>
#include "../../shared/Delay.h" #include "../../shared/Delay.h"
#undef SPI_SPEED #undef SPI_SPEED

View File

@ -59,7 +59,7 @@
#if HAS_GRAPHICAL_LCD && DISABLED(U8GLIB_ST7920) #if HAS_GRAPHICAL_LCD && DISABLED(U8GLIB_ST7920)
#include "SoftwareSPI.h" #include <SoftwareSPI.h>
#undef SPI_SPEED #undef SPI_SPEED
#define SPI_SPEED 2 // About 2 MHz #define SPI_SPEED 2 // About 2 MHz

View File

@ -26,7 +26,7 @@
#if ENABLED(USE_WATCHDOG) #if ENABLED(USE_WATCHDOG)
#include "lpc17xx_wdt.h" #include <lpc17xx_wdt.h>
#include "watchdog.h" #include "watchdog.h"
void watchdog_init() { void watchdog_init() {

View File

@ -22,8 +22,8 @@
#ifdef __SAMD51__ #ifdef __SAMD51__
#include "../../inc/MarlinConfig.h" #include "../../inc/MarlinConfig.h"
#include "Adafruit_ZeroDMA.h" #include <Adafruit_ZeroDMA.h>
#include "wiring_private.h" #include <wiring_private.h>
// ------------------------ // ------------------------
// Local defines // Local defines

View File

@ -40,9 +40,9 @@
#if ENABLED(SRAM_EEPROM_EMULATION) #if ENABLED(SRAM_EEPROM_EMULATION)
#if STM32F7xx #if STM32F7xx
#include "stm32f7xx_ll_pwr.h" #include <stm32f7xx_ll_pwr.h>
#elif STM32F4xx #elif STM32F4xx
#include "stm32f4xx_ll_pwr.h" #include <stm32f4xx_ll_pwr.h>
#else #else
#error "SRAM_EEPROM_EMULATION is currently only supported for STM32F4xx and STM32F7xx" #error "SRAM_EEPROM_EMULATION is currently only supported for STM32F4xx and STM32F7xx"
#endif #endif

View File

@ -272,7 +272,7 @@ extern "C" {
// return free memory between end of heap (or end bss) and whatever is current // return free memory between end of heap (or end bss) and whatever is current
/* /*
#include "wirish/syscalls.c" #include <wirish/syscalls.c>
//extern caddr_t _sbrk(int incr); //extern caddr_t _sbrk(int incr);
#ifndef CONFIG_HEAP_END #ifndef CONFIG_HEAP_END
extern char _lm_heap_end; extern char _lm_heap_end;

View File

@ -20,7 +20,9 @@
#include <stdint.h> #include <stdint.h>
#ifndef HAVE_SW_SERIAL
#define SW_SERIAL_PLACEHOLDER 1 #define SW_SERIAL_PLACEHOLDER 1
#endif
class SoftwareSerial { class SoftwareSerial {
public: public:

View File

@ -36,3 +36,8 @@
#if ENABLED(FAST_PWM_FAN) #if ENABLED(FAST_PWM_FAN)
#error "FAST_PWM_FAN is not yet implemented for this platform." #error "FAST_PWM_FAN is not yet implemented for this platform."
#endif #endif
#if !defined(HAVE_SW_SERIAL) && HAS_TMC220x
#warning "With TMC2208/9 consider using SoftwareSerialM with HAVE_SW_SERIAL and appropriate SS_TIMER."
#error "Missing SoftwareSerial implementation."
#endif

View File

@ -64,7 +64,7 @@ extern "C" {
// return free memory between end of heap (or end bss) and whatever is current // return free memory between end of heap (or end bss) and whatever is current
/* /*
#include "wirish/syscalls.c" #include <wirish/syscalls.c>
//extern caddr_t _sbrk(int incr); //extern caddr_t _sbrk(int incr);
#ifndef CONFIG_HEAP_END #ifndef CONFIG_HEAP_END
extern char _lm_heap_end; extern char _lm_heap_end;

View File

@ -301,9 +301,10 @@ board = genericSTM32F103RC
platform_packages = tool-stm32duino platform_packages = tool-stm32duino
extra_scripts = buildroot/share/PlatformIO/scripts/STM32F103RC_SKR_MINI.py extra_scripts = buildroot/share/PlatformIO/scripts/STM32F103RC_SKR_MINI.py
build_flags = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py build_flags = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py
${common.build_flags} -DDEBUG_LEVEL=0 -std=gnu++14 ${common.build_flags} -DDEBUG_LEVEL=0 -std=gnu++14 -DHAVE_SW_SERIAL -DSS_TIMER=4
build_unflags = -std=gnu++11 build_unflags = -std=gnu++11
lib_deps = ${common.lib_deps} lib_deps = ${common.lib_deps}
SoftwareSerialM=https://github.com/FYSETC/SoftwareSerialM/archive/master.zip
lib_ignore = Adafruit NeoPixel, SPI lib_ignore = Adafruit NeoPixel, SPI
src_filter = ${common.default_src_filter} +<src/HAL/HAL_STM32F1> src_filter = ${common.default_src_filter} +<src/HAL/HAL_STM32F1>
monitor_speed = 115200 monitor_speed = 115200
@ -315,9 +316,10 @@ board = genericSTM32F103RC
platform_packages = tool-stm32duino platform_packages = tool-stm32duino
extra_scripts = buildroot/share/PlatformIO/scripts/STM32F103RC_SKR_MINI.py extra_scripts = buildroot/share/PlatformIO/scripts/STM32F103RC_SKR_MINI.py
build_flags = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py build_flags = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py
${common.build_flags} -DDEBUG_LEVEL=0 -std=gnu++14 -DUSE_USB_COMPOSITE ${common.build_flags} -DDEBUG_LEVEL=0 -std=gnu++14 -DUSE_USB_COMPOSITE -DHAVE_SW_SERIAL -DSS_TIMER=4
build_unflags = -std=gnu++11 build_unflags = -std=gnu++11
lib_deps = ${common.lib_deps} lib_deps = ${common.lib_deps}
SoftwareSerialM=https://github.com/FYSETC/SoftwareSerialM/archive/master.zip
lib_ignore = Adafruit NeoPixel, SPI lib_ignore = Adafruit NeoPixel, SPI
src_filter = ${common.default_src_filter} +<src/HAL/HAL_STM32F1> src_filter = ${common.default_src_filter} +<src/HAL/HAL_STM32F1>
monitor_speed = 115200 monitor_speed = 115200