-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
boards/stm32f4discovery: default to stdio via CDC ACM #19259
boards/stm32f4discovery: default to stdio via CDC ACM #19259
Conversation
@@ -0,0 +1,3 @@ | |||
CONFIG_MODULE_USBUS=y |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO, this will cause a problem when compiling tinyUSB
apps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm I just copied that from stm32f429i-disco
, not sure how this could be done better in Kconfig.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TEST_KCONFIG=1 BOARD=stm32f4discovery make -C tests/pkg_tinyusb_cdc_msc info-modules
=== [ATTENTION] Testing Kconfig dependency modelling ===
[genconfig.py]:ERROR-=> The choice MODULE_STDIO_CDC_ACM (defined at /home/gs/src/RIOT-Xtensa-ESP.esp-idf-4.4/sys/usb/usbus/cdc/acm/Kconfig:57) was selected but was not set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have also problems with stm32f429i-disco
. Maybe they are not compiled with TEST_KCONFIG=1
in CI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's the reason why enabling the tinyusb_device
feature for boards with a single USB interface doesn't work and why PR #18998 which tried to enable tinyusb_device
for all such boards hangs since 3 months.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably the problem in Kconfig could be solved for the moment as in boards/esp32s3-pros3/Kconfig
by overriding the default settings in STDIO_IMPLEMENTATION
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
choice STDIO_IMPLEMENTATION
bool "STDIO implementation"
depends on TEST_KCONFIG
default MODULE_STDIO_CDC_ACM if MODULE_USBUS
default MODULE_STDIO_TINYUSB_CDC_ACM if MODULE_TINYUSB_DEVICE
endchoice
5448d0f
to
a1ec273
Compare
bors try |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets try it with that config.
tryBuild succeeded: |
I used to have this board and iirc the UART was available via stlink. I think some people in Berlin or Hamburg have it for testing. |
I see. So we should have the same hack as with |
Ok so the new version is called I reckon the UART to the ST-Link on the new board is already configured correctly if you have it. |
I think we can stop the discussion about renaming. While writing this comment, I realized that my board is already that new version. While looking for the USART pins used for ST-LINK connection I had to realize that there is still no connection. For comparison the ST-LINK connection of STM32F429i-DISC1 looks like. |
@benpicco The following changes solve the default selection problem of the STDIO backend in Kconfig. The diff --git a/boards/stm32f4discovery/Kconfig b/boards/stm32f4discovery/Kconfig
index 9a006f678d..39e929f976 100644
--- a/boards/stm32f4discovery/Kconfig
+++ b/boards/stm32f4discovery/Kconfig
@@ -35,6 +35,14 @@ config BOARD_STM32F4DISCOVERY
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
diff --git a/boards/stm32f4discovery/stm32f4discovery.config b/boards/stm32f4discovery/stm32f4discovery.config
deleted file mode 100644
index 7699f35a5c..0000000000
--- a/boards/stm32f4discovery/stm32f4discovery.config
+++ /dev/null
@@ -1,3 +0,0 @@
-CONFIG_MODULE_USBUS=y
-CONFIG_MODULE_USBUS_CDC_ACM=y
-CONFIG_MODULE_STDIO_CDC_ACM=y |
Please squash. |
31fa60c
to
b31ec28
Compare
Uh but looks like Kconfig is not happy. |
b31ec28
to
c57ff38
Compare
I went back to the original solution as at least that one is accepted by CI. |
But this is a wrong picture. Once you try to compile any tinyUSB app with |
The problem is that `boards/stm32f4discovery/stm32f4discovery.config hard codes the USBUS CDC ACM interface. IMHO, the problem is of course the wrong modelling approach of STDIO backends in Kconfig and I really hope we can solve it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I chaned to Request changes
to avoid an accidental merge as long as I investigate the Kconfig problem.
Could you try the following please? diff --git a/boards/stm32f4discovery/Kconfig b/boards/stm32f4discovery/Kconfig
index 9a006f678d..e405c8b46f 100644
--- a/boards/stm32f4discovery/Kconfig
+++ b/boards/stm32f4discovery/Kconfig
@@ -35,6 +35,14 @@ config BOARD_STM32F4DISCOVERY
select HAVE_SAUL_GPIO
+ select MODULE_USBUS if TEST_KCONFIG && !PACKAGE_TINYUSB
+ select MODULE_USBUS_CDC_ACM if TEST_KCONFIG && !PACKAGE_TINYUSB
+
+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
diff --git a/boards/stm32f4discovery/stm32f4discovery.config b/boards/stm32f4discovery/stm32f4discovery.config
deleted file mode 100644
index 7699f35a5c..0000000000
--- a/boards/stm32f4discovery/stm32f4discovery.config
+++ /dev/null
@@ -1,3 +0,0 @@
-CONFIG_MODULE_USBUS=y
-CONFIG_MODULE_USBUS_CDC_ACM=y
-CONFIG_MODULE_STDIO_CDC_ACM=y Using I wished it would be the same for |
With these changes, the board should use |
Thank you, CI seems to like this one. |
Please squash. |
e42c85d
to
1cd2c16
Compare
bors merge |
Build succeeded: |
Contribution description
Looks like
stm32f4discovery
also has one of the old on-board ST-Links that don't implement a USB-UART interface (like onstm32f429i-disco
).Since wiring up a USB-UART interface manually is annoying and the board provides a micro-USB port, default to
stdio_cdc_acm
so the user only needs an extra USB cable to access the shell.Testing procedure
Connect a micro-USB cable to he port of the
stm32f4discovery
.It should be recognized as a CDC ACM interface and
make term
should automatically connect to it.I don't have this board.
Issues/PRs references
#19248 (comment)