开源改变世界!!

使用 PlatformIO 构建 grblHAL #4

推推 grbl 2年前 (2023-02-08) 547次浏览
打开
noahwilliamsson 打开了这个问题 2021 年 8 月 11 日 · 15条评论
打开

使用 PlatformIO 构建 grblHAL#4

noahwilliamsson 打开了这个问题 2021 年 8 月 11 日 · 15条评论

评论

使用 PlatformIO 构建 grblHAL #4
贡献者

我想试用#2中正在开发的 BTT SKR E3 Mini v2.0 板的代码。我知道 Eclipse 是 grblHAL 的首选 IDE,但我更愿意使用对我来说投资较少的东西,例如标准 Linux/macOS 和 Python 包管理器。

由于您在另一个线程中提到了 PlatformIO,我已经探索了这条路线并且它看起来很有吸引力,因为:

  • platform run(build process) 自动下载合适的平台工具链和SDK框架
  • 您可以过滤源文件(下面未使用)
  • 它支持覆盖库的弱符号(不确定 STM32CubeMX 是否使用这些符号?)
  • 它可以通过 Linux 和 macOS 上的命令行快速安装和开箱即用(对我来说很好)

(PlatformIO 期望目录和库中的源代码src/,例如grblmotors,在它们自己的目录中lib/,但可以使用 、 和 来解决include_dir这个src_dir问题build_flagslib_extra_dirs

到目前为止,我想出了以下platformio.ini文件:

# file: platformio.ini
[platformio]
default_envs = BTT_SKR_MINI_E3_V20
include_dir = Inc
src_dir = Src

[common]
build_flags = 
  -I Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc
  -I Middlewares/ST/STM32_USB_Device_Library/Core/Inc
  # various source code does `#include "grbl/*.h"`
  -I .
  # code under Src does `#include "grbl.h"`
  #-I grbl
lib_deps =
  Class
  Core
  grbl
  motors
lib_extra_dirs =
  # this is so we can lib_deps=grbl eeprom motors
  . 
  Middlewares/ST/STM32_USB_Device_Library/Class
  Middlewares/ST/STM32_USB_Device_Library

[env]
platform = ststm32
framework = stm32cube
# Do not produce .a files for lib deps (which would prevent them from overriden weak symbols)
lib_archive = no

[env:BTT_SKR_MINI_E3_V20]
# See also: GRBL Driver STM32F103C8.ioc
board = genericSTM32F103RC
#board_build.ldscript = TBD
build_flags =
  ${common.build_flags}
  # Values from Inc/my_machine.h
  -D BTT_SKR_MINI_E3_V20=
  -D EEPROM_ENABLE=1
lib_deps =
  ${common.lib_deps}
  eeprom
  trinamic
lib_extra_dirs =
  ${common.lib_extra_dirs}

在项目目录的根目录中安装此文件,安装PlatformIO 核心 (CLI),您可以开始构建项目:

platform run -v
  1. ARM GCC 工具链在trinamic/. 我在包含标头路径的反斜杠中发布了一个修复程序,实际上是 UB

  2. 由于似乎缺少 USB 相关.{c,h}文件,编译失败。我之前没有使用过 STM32CubeMX,所以我希望我能在 GitHub 组织中为预期版本(假设v1.7.0基于)找到类似命名的文件。GRBL Driver STM32F103C8.ioc不幸的是,我并没有 100% 成功地使用这种方法。

我注意到您之前已经在 GitHub 组织的其他项目中提交了“添加丢失的 USB 文件”,所以也许这在这个 repo 中也是必要的?我注意到.mxproject似乎列出了这些似乎丢失的文件中的一些(或全部?):

	Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc/usbd_cdc_if.h
	Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Src/usbd_cdc_if.c
	Middlewares/ST/STM32_USB_Device_Library/Core/Inc/usb_device.h
	Middlewares/ST/STM32_USB_Device_Library/Core/Inc/usbd_conf.h
	Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_conf.c

(我怀疑它usb_device.c也不见了,我只是在编译时没有走那么远)

您是否有机会帮助找到这些文件?

谢谢!

使用 PlatformIO 构建 grblHAL #4
贡献者
  1. 合并
  2. 添加了丢失的文件,请注意,当我更新到最新的 ST 驱动程序代码时,它们已移至 USB_DEVICE 目录。

请注意,不应使用 .ioc 文件重新生成库代码,因为我已修改生成的代码以使其与 grblHAL 一起使用。

STM32F103RCTX_FLASH.ld 链接器脚本必须用于 BTT_SKR_MINI_E3_V20 板的链接,STM32F103C8TX_FLASH.ld 用于所有其他板,

使用 PlatformIO 构建 grblHAL #4
贡献者作者
诺威廉姆森 评论了 2021 年 8 月 11 日  

谢谢!

使用更新的platformio.ini文件,我设法编译了它。我还没有测试出来。

[platformio]
include_dir = Inc
src_dir = Src

[common]
build_flags =
  -I .
  -I Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc
  -I Middlewares/ST/STM32_USB_Device_Library/Core/Inc
  -I USB_DEVICE/Target
lib_deps =
  grbl
  keypad
  motors
  odometer
  sdcard
  # USB
  Core
  Class
  App
  Target
lib_extra_dirs =
  . 
  Middlewares/ST/STM32_USB_Device_Library
  USB_DEVICE

[env]
platform = ststm32
framework = stm32cube
# Do not produce .a files for lib deps (which would prevent them from overriding weak symbols)
lib_archive = no
lib_ldf_mode = off
debug_tool = stlink
upload_protocol = stlink

[env:BTT_SKR_MINI_E3_V20]
# Upload is not supported for this board as BOOT0 is tied to GND
board = genericSTM32F103RC
board_build.ldscript = STM32F103RCTX_FLASH.ld
build_flags =
  ${common.build_flags}
  # See Inc/my_machine.h for options
  -D BTT_SKR_MINI_E3_V20=
  -D EEPROM_ENABLE=1
lib_deps =
  ${common.lib_deps}
  eeprom
  trinamic
lib_extra_dirs = ${common.lib_extra_dirs}

[env:bluepill]
board = bluepill_f103c8_128k
board_build.ldscript = STM32F103C8TX_FLASH.ld
build_flags =
  ${common.build_flags}
  -D EEPROM_ENABLE=1
lib_deps =
  ${common.lib_deps}
  eeprom
lib_extra_dirs = ${common.lib_extra_dirs}

示例输出:

% platformio run -v 
Processing BTT_SKR_MINI_E3_V20 (board: genericSTM32F103RC; board_build.ldscript: STM32F103RCTX_FLASH.ld; build_flags: -I ., -I Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc, -I Middlewares/ST/STM32_USB_Device_Library/Core/Inc, -I USB_DEVICE/Target, -D BTT_SKR_MINI_E3_V20=, -D EEPROM_ENABLE=1; lib_deps: grbl, keypad, motors, odometer, Core, Class, App, Target, eeprom, trinamic; lib_extra_dirs: ., Middlewares/ST/STM32_USB_Device_Library, USB_DEVICE; platform: ststm32; framework: stm32cube; lib_archive: False; lib_ldf_mode: off)
------------------------------------------------------------------------------------------------------------------------------------
CONFIGURATION: https://docs.platformio.org/page/boards/ststm32/genericSTM32F103RC.html
PLATFORM: ST STM32 (14.1.0) > STM32F103RC (48k RAM. 256k Flash)
HARDWARE: STM32F103RCT6 72MHz, 48KB RAM, 256KB Flash
DEBUG: Current (blackmagic) External (blackmagic, cmsis-dap, jlink, stlink)
PACKAGES: 
 - framework-stm32cubef1 1.8.3 
 - tool-ldscripts-ststm32 0.1.0 
 - toolchain-gccarmnoneeabi 1.70201.0 (7.2.1)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ off, Compatibility ~ soft
Found 50 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <grbl> (/private/tmp/STM32F1xx/grbl)
|-- <keypad> (/private/tmp/STM32F1xx/keypad)
|-- <motors> (/private/tmp/STM32F1xx/motors)
|-- <odometer> (/private/tmp/STM32F1xx/odometer)
|-- <Core> (/private/tmp/STM32F1xx/Middlewares/ST/STM32_USB_Device_Library/Core)
|-- <Class> (/private/tmp/STM32F1xx/Middlewares/ST/STM32_USB_Device_Library/Class)
|-- <App> (/private/tmp/STM32F1xx/USB_DEVICE/App)
|-- <Target> (/private/tmp/STM32F1xx/USB_DEVICE/Target)
|-- <eeprom> (/private/tmp/STM32F1xx/eeprom)
|-- <trinamic> (/private/tmp/STM32F1xx/trinamic)
Building in release mode
MethodWrapper(["checkprogsize"], [".pio/build/BTT_SKR_MINI_E3_V20/firmware.elf"])
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [====      ]  35.7% (used 17556 bytes from 49152 bytes)
Flash: [=====     ]  48.2% (used 126304 bytes from 262144 bytes)
.pio/build/BTT_SKR_MINI_E3_V20/firmware.elf  :
section               size        addr
.isr_vector            484   134217728
.text               104420   134218216
.rodata              20776   134322640
.ARM.extab               0   134343416
.ARM                     0   134343416
.preinit_array           0   134343416
.init_array              4   134343416
.fini_array              4   134343420
.data                 1108   536870912
.bss                 16448   536872020
._user_heap_stack     9220   536888468
.ARM.attributes         41           0
.comment               126           0
.debug_frame          5664           0
Total               158295
=================================================== [SUCCESS] Took 1.10 seconds ===================================================

Processing bluepill (board: bluepill_f103c8_128k; board_build.ldscript: STM32F103C8TX_FLASH.ld; build_flags: -I ., -I Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc, -I Middlewares/ST/STM32_USB_Device_Library/Core/Inc, -I USB_DEVICE/Target, -D EEPROM_ENABLE=1; lib_deps: grbl, keypad, motors, odometer, sdcard, Core, Class, App, Target, eeprom; lib_extra_dirs: ., Middlewares/ST/STM32_USB_Device_Library, USB_DEVICE; platform: ststm32; framework: stm32cube; lib_archive: False; lib_ldf_mode: off; debug_tool: stlink; upload_protocol: stlink)
------------------------------------------------------------------------------------------------------------------------------------
CONFIGURATION: https://docs.platformio.org/page/boards/ststm32/bluepill_f103c8_128k.html
PLATFORM: ST STM32 (14.1.0) > BluePill F103C8 (128k)
HARDWARE: STM32F103C8T6 72MHz, 20KB RAM, 128KB Flash
DEBUG: Current (stlink) External (blackmagic, cmsis-dap, jlink, stlink)
PACKAGES: 
 - framework-stm32cubef1 1.8.3 
 - tool-ldscripts-ststm32 0.1.0 
 - toolchain-gccarmnoneeabi 1.70201.0 (7.2.1)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ off, Compatibility ~ soft
Found 50 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <grbl> (/private/tmp/STM32F1xx/grbl)
|-- <keypad> (/private/tmp/STM32F1xx/keypad)
|-- <motors> (/private/tmp/STM32F1xx/motors)
|-- <odometer> (/private/tmp/STM32F1xx/odometer)
|-- <sdcard> (/private/tmp/STM32F1xx/sdcard)
|-- <Core> (/private/tmp/STM32F1xx/Middlewares/ST/STM32_USB_Device_Library/Core)
|-- <Class> (/private/tmp/STM32F1xx/Middlewares/ST/STM32_USB_Device_Library/Class)
|-- <App> (/private/tmp/STM32F1xx/USB_DEVICE/App)
|-- <Target> (/private/tmp/STM32F1xx/USB_DEVICE/Target)
|-- <eeprom> (/private/tmp/STM32F1xx/eeprom)
Building in release mode
MethodWrapper(["checkprogsize"], [".pio/build/bluepill/firmware.elf"])
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [========  ]  76.4% (used 15656 bytes from 20480 bytes)
Flash: [========= ]  85.0% (used 111464 bytes from 131072 bytes)
.pio/build/bluepill/firmware.elf  :
section               size        addr
.isr_vector            268   134217728
.text                90980   134218000
.rodata              19416   134308984
.ARM.extab               0   134328400
.ARM                     0   134328400
.preinit_array           0   134328400
.init_array              4   134328400
.fini_array              4   134328404
.data                 1068   536870912
.bss                 14588   536871980
._user_heap_stack     4096   536886568
.ARM.attributes         41           0
.comment               126           0
.debug_frame          5280           0
Total               135871
=================================================== [SUCCESS] Took 1.15 seconds ===================================================
使用 PlatformIO 构建 grblHAL #4
贡献者

太好了,我想应该添加一个新的链接描述文件,以便可以使用引导加载程序对芯片进行编程?请参阅问题#3

MEMORY 和可能的 .isr_vector 设置必须为此更改吗?以下是来自F4xx 驱动程序的代码,可以作为更改内容的有用提示:

/* Memories definition */
MEMORY
{
  RAM    (xrw)    : ORIGIN = 0x20000000,   LENGTH = 64K
  BOOT_FLASH    (rx)    : ORIGIN = 0x8000000,   LENGTH = 16K
  EEPROM_EMUL(xrw)      : ORIGIN = 0x8004000,   LENGTH = 16K
  FLASH    (rx)    : ORIGIN = 0x8008000,   LENGTH = 224K
}

/* Sections */
SECTIONS
{
  /* The startup code into "FLASH" Rom type memory */
  .isr_vector :
  {
    . = ALIGN(4);
    KEEP(*(.isr_vector)) /* Startup code */
    . = ALIGN(4);
  } >BOOT_FLASH

由于我没有我可以测试的电路板,而且由于链接器脚本是我不习惯使用的东西,所以我无法判断正确的设置应该是什么。

使用 PlatformIO 构建 grblHAL #4
贡献者作者

抱歉延迟,我花了一些时间试图弄清楚为什么我无法启动在我的原始 SKR Mini E3 V2.0 板上生成的文件 PlatformIO。没有出现 USB 设备,USART1 上没有输出,尽管在HAL_GPIO_*()之前进行了相关调用,但也无法切换任何引脚grbl_enter()。此外,我的 ST-Link V2 克隆无法通过 SWD 连接到电路板(无法连接到目标,并且没有成功--connect-under-reset——可能是因为缺少nRST引脚)。

我不确定这些板开箱即用的是哪种引导加载程序。我对这些板进行闪存的唯一经验是firmware.bin在 SD 卡上放置一个文件。一旦你给电路板加电,它就会刷新这个文件的内容,将它重命名为FIRMWARE.CUR并重置。

FWIW,firmware.bin是使用诸如~/.platformio/packages/toolchain-gccarmnoneeabi/arm-none-eabi/bin/objcopy -O firmware.bin firmware.elf. 当使用 PlatformIO 编译时,这两个文件都是自动创建的(例如.pio/build/<env name>/firmware.{bin,elf})。

我花了几天时间才意识到我必须向链接器脚本中的闪存 ORIGIN 添加一个 28KB (0x7000) 偏移量Src/system_stm32f1xx.c:VECT_TAB_OFFSET并使其工作(并理解您对引导加载程序/链接器脚本的评论——谢谢!)。

我不确定这些板开箱即用的是哪种引导加载程序,是标准的还是其他的,但这是我通过研究https://github.com/bigtreetech/BIGTREETECH发现的- SKR-迷你-E3

有了它,我就可以通过 USART1 在 USB 串口关闭的情况下获得 grblHAL 提示。

接下来,我无法-D USB_SERIAL_CDC=1上班。似乎在(PA14) 和(PA12)之间有一个MOSFET 晶体管,我不明白其用途或功能(除了如果您通过 USB 而不是 12/24V DCIN 为电路板供电时它会破坏 SWD..)。SWCLKUSB D+

使用 PlatformIO 构建 grblHAL #4

此外,似乎这些 ST-Link v2 克隆没有附带nRST引脚(只有 STM8 的复位引脚)所以我已经订购了一个 ST-LINK/V3SET 和一个 Nucleo F411RE (STLINK-V2-1) 希望它将使将来的事情变得更容易。

至于通过引导加载程序对芯片进行编程,我还没有真正研究过,但我会注意到Klipper 的 STM32 引导加载程序注释说:

HID 引导加载程序是一种紧凑的无驱动程序引导加载程序,能够通过 USB 进行闪存。还提供了专用于 SKR Mini E3 1.2 的前叉。

对于通用的 STM32F103 板,如蓝色药丸,可以使用 stm32flash 通过 3.3v 串行闪存引导加载程序,如上面 stm32duino 部分所述,将文件名替换为所需的 hid 引导加载程序二进制文件(即:hid_generic_pc13.bin 为蓝色药丸).

不能将 stm32flash 用于 SKR Mini E3,因为 boot0 引脚直接接地,而不是通过插头引脚断开。

使用 PlatformIO 构建 grblHAL #4

(通过BTT SKR MINI E3 V2.0SCHpdf.PDF)。

据我了解应用笔记 AN2586,这意味着它将从主闪存启动(并且可以选择通过 SWD 对芯片进行编程,假设它与适当的 ST-Link 设备一起工作)。

话虽如此,我提出了以下更改:

STM32F103RCTX_FLASH.ld:

diff --git a/STM32F103RCTX_FLASH.ld b/STM32F103RCTX_FLASH.ld
index cbc801e..e56563e 100644
--- a/STM32F103RCTX_FLASH.ld
+++ b/STM32F103RCTX_FLASH.ld
@@ -33,11 +33,14 @@ _estack = ORIGIN(RAM) + LENGTH(RAM);    /* end of "RAM" Ram type memory */
 _Min_Heap_Size = 0x2000; /* required amount of heap  */
 _Min_Stack_Size = 0x400;    /* required amount of stack */
 
+/* Dummy symbol we can override using -Wl,--defsym on the command line */
+LD_VECT_TAB_OFFSET = DEFINED(LD_VECT_TAB_OFFSET)? LD_VECT_TAB_OFFSET : 0;
+
 /* Memories definition */
 MEMORY
 {
   RAM    (xrw)    : ORIGIN = 0x20000000,   LENGTH = 48K
-  FLASH    (rx)    : ORIGIN = 0x8000000,   LENGTH = 256K
+  FLASH    (rx)    : ORIGIN = 0x8000000 + LD_VECT_TAB_OFFSET,   LENGTH = 256K - LD_VECT_TAB_OFFSET - 2*2K
 }

Src/system_stm32f1xx.c:

diff --git a/Src/system_stm32f1xx.c b/Src/system_stm32f1xx.c
index af3759a..d59da48 100644
--- a/Src/system_stm32f1xx.c
+++ b/Src/system_stm32f1xx.c
@@ -110,8 +110,10 @@
 /*!< Uncomment the following line if you need to relocate your vector Table in
      Internal SRAM. */ 
 /* #define VECT_TAB_SRAM */
+#if !defined (VECT_TAB_OFFSET)
 #define VECT_TAB_OFFSET  0x00000000U /*!< Vector Table base offset field. 
                                   This value must be a multiple of 0x200. */
+#endif

通过允许编译时定义VECT_TAB_OFFSET在命令行(额外的构建标志)。-D VECT_TAB_OFFSET=...LD_VECT_TAB_OFFSET-Wl,--defsym=LD_VECT_TAB_OFFSET=...

另一种选择是定义一个特定的板VECT_TAB_OFFSET并拆分链接脚本,可能是通过利用 GNU ld 对包含的支持(以包含公共部分)。

你怎么认为?

接下来,为了让 USB 串行在这个板上工作,我只是对Src/main.c做了以下更改:

diff --git a/Src/main.c b/Src/main.c
index 1786291..9435b5f 100644
--- a/Src/main.c
+++ b/Src/main.c
@@ -36,6 +36,14 @@ int main(void)
     __HAL_RCC_GPIOB_CLK_ENABLE();
     __HAL_RCC_GPIOC_CLK_ENABLE();
 
+    GPIO_InitTypeDef GPIO_Init = {
+        .Mode = GPIO_MODE_OUTPUT_PP,
+        .Pin = GPIO_PIN_14,
+        .Speed = GPIO_SPEED_FREQ_LOW,
+    };
+    HAL_GPIO_Init(GPIOA, &GPIO_Init);
+    HAL_GPIO_WritePin(GPIOA, GPIO_PIN_14, GPIO_PIN_RESET);
+
     grbl_enter();
 }

显然这是一个问题,但是在 grblHAL 中用某个特定值初始化输出引脚的正确方法是什么?能否以某种方式将它们添加到Src/driver.c中?

最后,为了支持使用 PlatformIO 为 SKR Mini E3 V2.0 构建 grblHAL,我进行了以下更改。请注意,我默认禁用 USB 串行(不是真正的用户友好),以便能够同时构建 3.3V 串行版本和 USB 串行版本。

Inc/my_machine.h:

diff --git a/Inc/my_machine.h b/Inc/my_machine.h
index 4cd93d6..875e629 100644
--- a/Inc/my_machine.h
+++ b/Inc/my_machine.h
@@ -29,7 +29,7 @@
 // Configuration
 // Uncomment to enable.
 
-#define USB_SERIAL_CDC       1 // Serial communication via native USB. Comment out for UART communication.
+//#define USB_SERIAL_CDC       1 // Serial communication via native USB. Comment out for UART communication.
 //#define SDCARD_ENABLE      1 // Run gcode programs from SD card, requires sdcard plugin.
 //#define KEYPAD_ENABLE      1 // I2C keypad for jogging etc., requires keypad plugin.
 //#define ODOMETER_ENABLE    1 // Odometer plugin.

platformio.ini:

[platformio]
include_dir = Inc
src_dir = Src

[common]
build_flags =
  -I .
  -I FatFS
  -I Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc
  -I Middlewares/ST/STM32_USB_Device_Library/Core/Inc
  -I USB_DEVICE/Target
lib_deps =
  grbl
  keypad
  motors
  odometer
# To enable support for SD card, you must grab a copy FatFS:
#   curl -O http://elm-chan.org/fsw/ff/arc/ff14b.zip
#   unzip ff14b.zip 'source/*'
#   mv source FatFS
# ..before uncommenting the below option
# sdcard
  # For USB serial support
  Core
  Class
  App
  Target
lib_extra_dirs =
  . 
  Middlewares/ST/STM32_USB_Device_Library
  USB_DEVICE

[env]
platform = ststm32
framework = stm32cube
# Do not produce .a files for lib deps (which would prevent them from overriding weak symbols)
lib_archive = no
lib_ldf_mode = off

[env:BTT_SKR_MINI_E3_V20]
board = genericSTM32F103RC
board_build.ldscript = STM32F103RCTX_FLASH.ld
build_flags = ${common.build_flags}
  # See Inc/my_machine.h for options
  -D BTT_SKR_MINI_E3_V20=
  -D EEPROM_ENABLE=3
  -D USB_SERIAL_CDC=0
  # Relocate the vector table where the boot loader expects to find them
  -D VECT_TAB_OFFSET=0x7000
  -Wl,--defsym=LD_VECT_TAB_OFFSET=0x7000
lib_deps = ${common.lib_deps}
  eeprom
  trinamic
lib_extra_dirs = ${common.lib_extra_dirs}
# Upload is not supported for this board since BOOT0 is tied to GND.
# With the default boot loader, you must deploy new firmware by copying
# .pio/build/<env name>/firmware.bin (produced by `pio run`) to the SD card.

[env:BTT_SKR_MINI_E3_V20_USB]
board = genericSTM32F103RC
board_build.ldscript = STM32F103RCTX_FLASH.ld
build_flags = ${common.build_flags}
  # See Inc/my_machine.h for options
  -D BTT_SKR_MINI_E3_V20=
  -D EEPROM_ENABLE=3
  -D USB_SERIAL_CDC=1
  # Relocate the vector table where the boot loader expects to find them
  -D VECT_TAB_OFFSET=0x7000
  -Wl,--defsym=LD_VECT_TAB_OFFSET=0x7000
lib_deps = ${common.lib_deps}
  eeprom
  trinamic
lib_extra_dirs = ${common.lib_extra_dirs}
# Upload is not supported for this board since BOOT0 is tied to GND.
# With the default boot loader, you must deploy new firmware by copying
# .pio/build/<env name>/firmware.bin (produced by `pio run`) to the SD card.

完成这些更改后,您可以:

(cd trinamic && git checkout master && git pull)   # the submodule have yet to be updated
pio run     # build all envs (or a single one: -e BTT_SKR_MINI_E3_V20_USB)

这将产生以下文件:

% ls -1  .pio/build/BTT*/firmware.*  
.pio/build/BTT_SKR_MINI_E3_V20/firmware.bin
.pio/build/BTT_SKR_MINI_E3_V20/firmware.elf
.pio/build/BTT_SKR_MINI_E3_V20_USB/firmware.bin
.pio/build/BTT_SKR_MINI_E3_V20_USB/firmware.elf

我很乐意贡献一个 PR 来支持这个 repo 中的 PlatformIO 假设你有兴趣并且可以解决上面提到的怪癖。一旦我订购的 Nucleo 板出现,我也许可以对 STM32F4xx 存储库进行同样的尝试。

使用 PlatformIO 构建 grblHAL #4
Contributor

Apologies for the delay

喜欢 (0)