Skip to content

Commit

Permalink
minor cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
jscrane committed May 19, 2023
1 parent 40833ea commit a3dea8c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 16 deletions.
19 changes: 10 additions & 9 deletions docs/stm32.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
### stm32

menu items:
- MENU_XSERIAL: ```generic``` (```none```, ```disabled```)
- MENU_USB: ```CDCgen``` (```none```, ```CDC```, ```HID```)
- MENU_XUSB: ```FS``` (```HS```, ```HSFS```)
- MENU_OPT: ```osstd``` (```oslto```, ```o1std```, ```o1lto```, ```o2std```, ```o2lto```, ```o3std```, ```o3lto```, ```ogstd```, ```o0std```)
- MENU_DBG: ```none``` (```enable_sym```, ```enable_log```, ```enable_all```)
- MENU_RTLIB: ```nano``` (```nanofp```, ```nanofs```, ```nanofps```, ```full```)
- MENU_UPLOAD_METHOD: ```dfu2Method``` (```swdMethod```, ```dfuMethod```, ```bmpMethod```, ```hidMethod```, ```serialMethod```, ```dfuoMethod```)
- MENU_SERIAL_PORT: $(SERIAL_PORT) or ```/dev/ttyUSB0```
- PNUM: _mandatory_
- XSERIAL: ```generic``` (```none```, ```disabled```)
- USB: ```CDCgen``` (```none```, ```CDC```, ```HID```)
- XUSB: ```FS``` (```HS```, ```HSFS```)
- OPT: ```osstd``` (```oslto```, ```o1std```, ```o1lto```, ```o2std```, ```o2lto```, ```o3std```, ```o3lto```, ```ogstd```, ```o0std```)
- DBG: ```none``` (```enable_sym```, ```enable_log```, ```enable_all```)
- RTLIB: ```nano``` (```nanofp```, ```nanofs```, ```nanofps```, ```full```)
- UPLOAD_METHOD: ```dfu2Method``` (```swdMethod```, ```dfuMethod```, ```bmpMethod```, ```hidMethod```, ```serialMethod```, ```dfuoMethod```)

other variables:
- SERIAL_PORT: ```/dev/ttyACM0```
Expand All @@ -18,7 +18,8 @@ examples:

[HY-TINY](https://stm32duinoforum.com/forum/wiki_subdomain/index_title_HY-TinySTM103T.html):
```
BOARD := GenF1.menu.pnum.HY_TINYSTM103TB
BOARD := GenF1
PNUM := HY_TINYSTM103TB
include stm32.mk
```
17 changes: 10 additions & 7 deletions stm32.mk
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
VENDOR := STMicroelectronics
PROCESSOR_FAMILY := stm32
ifndef PNUM
$(error PNUM required)
endif

SERIAL_PORT ?= /dev/ttyACM0
TERMINAL_SPEED ?= 115200
STM_TOOLS ?= /usr/local

export PATH := $(PATH):$(STM_TOOLS)/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin

# menus
XSERIAL ?= generic
USB ?= CDCgen
Expand All @@ -16,11 +15,15 @@ DBG ?= none
RTLIB ?= nano
UPLOAD_METHOD ?= dfu2Method

VENDOR := STMicroelectronics
PROCESSOR_FAMILY := stm32

export PATH := $(PATH):$(STM_TOOLS)/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin

-include hardware.mk

FAMILY := $(firstword $(subst ., ,$(BOARD)))
build.bootloader_flags := $($(FAMILY).menu.upload_method.$(UPLOAD_METHOD).build.bootloader_flags)
build.st_extra_flags := $($(FAMILY).build.st_extra_flags)
build.bootloader_flags := $($(BOARD).menu.upload_method.$(UPLOAD_METHOD).build.bootloader_flags)
build.st_extra_flags := $($(BOARD).build.st_extra_flags)

LIBRARIES += SrcWrapper

Expand Down

0 comments on commit a3dea8c

Please sign in to comment.