Skip to content

Commit

Permalink
boards/stm32f4discovery: default to stdio via CDC ACM
Browse files Browse the repository at this point in the history
  • Loading branch information
benpicco committed Feb 9, 2023
1 parent 247b8d0 commit d452afb
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
9 changes: 9 additions & 0 deletions boards/stm32f4discovery/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,21 @@ config BOARD_STM32F4DISCOVERY
# Various other features (if any)
select HAS_ARDUINO
select HAS_TINYUSB_DEVICE
select HAS_HIGHLEVEL_STDIO

# Clock configuration
select BOARD_HAS_HSE

select HAVE_SAUL_GPIO

select MODULE_USBUS_CDC_ACM if TEST_KCONFIG && !PACKAGE_TINYUSB
select PACKAGE_TINYUSB if TEST_KCONFIG && !MODULE_USBUS

choice STDIO_IMPLEMENTATION
default MODULE_STDIO_CDC_ACM if MODULE_USBUS
default MODULE_STDIO_TINYUSB_CDC_ACM if PACKAGE_TINYUSB
endchoice

source "$(RIOTBOARD)/common/stm32/Kconfig"

config ERROR_MODULES_CONFLICT
Expand Down
2 changes: 2 additions & 0 deletions boards/stm32f4discovery/Makefile.dep
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
ifneq (,$(filter saul_default,$(USEMODULE)))
USEMODULE += saul_gpio
endif

include $(RIOTBOARD)/common/makefiles/stdio_cdc_acm.dep.mk
2 changes: 2 additions & 0 deletions boards/stm32f4discovery/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ FEATURES_PROVIDED += periph_usbdev
FEATURES_PROVIDED += arduino
FEATURES_PROVIDED += tinyusb_device

FEATURES_PROVIDED += highlevel_stdio

# TODO: re-think concept for conflicts based on actual used peripherals...
FEATURES_CONFLICT += periph_spi:periph_dac
FEATURES_CONFLICT_MSG += "On stm32f4discovery boards there are the same pins for the DAC and/or SPI_0."
4 changes: 4 additions & 0 deletions boards/stm32f4discovery/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ arbitrary and can be altered by editing the
LEDs LD7 and LD8 are used by the USB connector for over-current (LD8) and
data (LD7) indication.

### USB Device Interface

The board has a micro USB port that can be used for USB device mode.
As the ST-Link on the board does not provide a USB-UART interface, the STDIO is
mapped to the micro USB port by default (via CDC ACM).

### Accelerometer

Expand Down

0 comments on commit d452afb

Please sign in to comment.