From 54c67364ca30fed518b9e24f1079152c7d70853f Mon Sep 17 00:00:00 2001 From: valeros Date: Mon, 30 Sep 2024 16:34:11 +0300 Subject: [PATCH 01/12] Enable Arduino framework for nucleo_f439zi Resolves #802 --- boards/nucleo_f439zi.json | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/boards/nucleo_f439zi.json b/boards/nucleo_f439zi.json index b5ecb98a..227ebf7e 100644 --- a/boards/nucleo_f439zi.json +++ b/boards/nucleo_f439zi.json @@ -1,10 +1,14 @@ { "build": { + "arduino": { + "variant_h": "variant_NUCLEO_F4x9ZI.h" + }, "cpu": "cortex-m4", "extra_flags": "-DSTM32F4 -DSTM32F439xx", "f_cpu": "180000000L", "mcu": "stm32f439zit6", - "product_line": "STM32F439xx" + "product_line": "STM32F439xx", + "variant": "STM32F4xx/F427Z(G-I)T_F429ZET_F429Z(G-I)(T-Y)_F437Z(G-I)T_F439Z(G-I)(T-Y)" }, "connectivity": [ "can", @@ -23,6 +27,7 @@ "svd_path": "STM32F439x.svd" }, "frameworks": [ + "arduino", "cmsis", "mbed", "stm32cube", @@ -30,7 +35,7 @@ ], "name": "ST Nucleo F439ZI", "upload": { - "maximum_ram_size": 262144, + "maximum_ram_size": 196608, "maximum_size": 2097152, "protocol": "stlink", "protocols": [ @@ -41,6 +46,6 @@ "mbed" ] }, - "url": "https://developer.mbed.org/platforms/ST-Nucleo-F439ZI/", + "url": "https://www.st.com/en/evaluation-tools/nucleo-f439zi.html", "vendor": "ST" } From 152b47ac7ce74f895f7accf17c2a865cf22522d4 Mon Sep 17 00:00:00 2001 From: Maximilian Gerhardt Date: Fri, 18 Oct 2024 13:07:49 +0200 Subject: [PATCH 02/12] Enable mbed-os for nucleo_u575zi_q (#805) --- boards/nucleo_u575zi_q.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/boards/nucleo_u575zi_q.json b/boards/nucleo_u575zi_q.json index ed2d669c..cfd83d0c 100644 --- a/boards/nucleo_u575zi_q.json +++ b/boards/nucleo_u575zi_q.json @@ -25,7 +25,8 @@ "openocd_target": "stm32u5x" }, "frameworks": [ - "arduino" + "arduino", + "mbed" ], "name": "ST Nucleo U575ZI-Q", "upload": { From 62a48b6c8cd1a4a9fa79a808c7a6cdfbf728cd84 Mon Sep 17 00:00:00 2001 From: valeros Date: Wed, 23 Oct 2024 15:04:08 +0300 Subject: [PATCH 03/12] Remove redundant HWIDs for Arduino Giga & Nicla boards Fixes #794 --- boards/giga_r1_m4.json | 8 -------- boards/giga_r1_m7.json | 8 -------- boards/nicla_vision.json | 12 ------------ boards/nicla_vision_m4.json | 12 ------------ 4 files changed, 40 deletions(-) diff --git a/boards/giga_r1_m4.json b/boards/giga_r1_m4.json index b4c86526..d8ad78ba 100644 --- a/boards/giga_r1_m4.json +++ b/boards/giga_r1_m4.json @@ -15,14 +15,6 @@ [ "0x2341", "0x0366" - ], - [ - "0x2341", - "0x0266" - ], - [ - "0x2341", - "0x0466" ] ] }, diff --git a/boards/giga_r1_m7.json b/boards/giga_r1_m7.json index 06f6ad11..e481b16e 100644 --- a/boards/giga_r1_m7.json +++ b/boards/giga_r1_m7.json @@ -15,14 +15,6 @@ [ "0x2341", "0x0366" - ], - [ - "0x2341", - "0x0266" - ], - [ - "0x2341", - "0x0466" ] ] }, diff --git a/boards/nicla_vision.json b/boards/nicla_vision.json index c8ff7e26..f329ea23 100644 --- a/boards/nicla_vision.json +++ b/boards/nicla_vision.json @@ -15,18 +15,6 @@ [ "0x2341", "0x035F" - ], - [ - "0x2341", - "0x025F" - ], - [ - "0x2341", - "0x045F" - ], - [ - "0x2341", - "0x055F" ] ] }, diff --git a/boards/nicla_vision_m4.json b/boards/nicla_vision_m4.json index feb797d6..82de95c5 100644 --- a/boards/nicla_vision_m4.json +++ b/boards/nicla_vision_m4.json @@ -15,18 +15,6 @@ [ "0x2341", "0x035F" - ], - [ - "0x2341", - "0x025F" - ], - [ - "0x2341", - "0x045F" - ], - [ - "0x2341", - "0x055F" ] ] }, From 2302d1b479c28277f8022d73006800b10d5da86a Mon Sep 17 00:00:00 2001 From: Eli Tayrien Date: Tue, 12 Nov 2024 03:59:59 -0800 Subject: [PATCH 04/12] Update electrosmith_daisy board config's variant (#813) --- boards/electrosmith_daisy.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boards/electrosmith_daisy.json b/boards/electrosmith_daisy.json index 7b354d7e..363b7c9b 100644 --- a/boards/electrosmith_daisy.json +++ b/boards/electrosmith_daisy.json @@ -12,7 +12,7 @@ }, "mcu": "stm32h750ibk6", "product_line": "STM32H750xx", - "variant": "STM32H7xx/H742I(G-I)(K-T)_H743I(G-I)(K-T)_H750IB(K-T)_H753II(K-T)" + "variant": "STM32H7xx/H742I(G-I)K_H743I(G-I)K_H750IBK_H753IIK" }, "connectivity": [ "can" From 9f7c0d8db95cc2495bb803b05b4d631b2248aad2 Mon Sep 17 00:00:00 2001 From: valeros Date: Tue, 12 Nov 2024 14:06:15 +0200 Subject: [PATCH 05/12] Update variant names for several boards Updated variants for the following boards: - Electrosmith Daisy Patch SM - Electrosmith Daisy Petal SM - MKR Sharky --- boards/electrosmith_daisy_patch_sm.json | 4 ++-- boards/electrosmith_daisy_petal_sm.json | 4 ++-- boards/mkr_sharky.json | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/boards/electrosmith_daisy_patch_sm.json b/boards/electrosmith_daisy_patch_sm.json index 50d72e66..0243161f 100644 --- a/boards/electrosmith_daisy_patch_sm.json +++ b/boards/electrosmith_daisy_patch_sm.json @@ -9,11 +9,11 @@ "extra_flags": "-DSTM32H7 -DSTM32H7xx -DSTM32H750xx", "f_cpu": "400000000L", "framework_extra_flags": { - "arduino": "-DCUSTOM_PERIPHERAL_PINS" + "arduino": "-DCUSTOM_PERIPHERAL_PINS -DARDUINO_DAISY_PATCH_SM" }, "mcu": "stm32h750ibk6", "product_line": "STM32H750xx", - "variant": "STM32H7xx/H742I(G-I)(K-T)_H743I(G-I)(K-T)_H750IB(K-T)_H753II(K-T)" + "variant": "STM32H7xx/H742I(G-I)K_H743I(G-I)K_H750IBK_H753IIK" }, "connectivity": [ "can" diff --git a/boards/electrosmith_daisy_petal_sm.json b/boards/electrosmith_daisy_petal_sm.json index 5ef1160b..ddf8485c 100644 --- a/boards/electrosmith_daisy_petal_sm.json +++ b/boards/electrosmith_daisy_petal_sm.json @@ -9,11 +9,11 @@ "extra_flags": "-DSTM32H7 -DSTM32H7xx -DSTM32H750xx", "f_cpu": "400000000L", "framework_extra_flags": { - "arduino": "-DCUSTOM_PERIPHERAL_PINS" + "arduino": "-DCUSTOM_PERIPHERAL_PINS -DARDUINO_DAISY_PETAL_SM" }, "mcu": "stm32h750ibk6", "product_line": "STM32H750xx", - "variant": "STM32H7xx/H742I(G-I)(K-T)_H743I(G-I)(K-T)_H750IB(K-T)_H753II(K-T)" + "variant": "STM32H7xx/H742I(G-I)K_H743I(G-I)K_H750IBK_H753IIK" }, "connectivity": [ "can" diff --git a/boards/mkr_sharky.json b/boards/mkr_sharky.json index 0440c3a5..8ebd64c5 100644 --- a/boards/mkr_sharky.json +++ b/boards/mkr_sharky.json @@ -5,7 +5,7 @@ "extra_flags": "-DSTM32WB -DSTM32WBxx -DSTM32WB55xx", "f_cpu": "64000000L", "mcu": "stm32wb55cg", - "variant": "STM32WBxx/WB55C(C-E-G)U" + "variant": "STM32WBxx/WB35C(C-E)UxA_WB55C(C-E-G)U" }, "connectivity": [ "bluetooth" From 458e22573c35a24148b7933c265ce91ada6a7077 Mon Sep 17 00:00:00 2001 From: valeros Date: Thu, 28 Nov 2024 16:19:23 +0200 Subject: [PATCH 06/12] Update Arduino core to v2.9.0 --- platform.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform.json b/platform.json index 5041f02d..e1c92cf9 100644 --- a/platform.json +++ b/platform.json @@ -190,7 +190,7 @@ "type": "framework", "optional": true, "owner": "platformio", - "version": "~4.20801.0" + "version": "~4.20900.0" }, "framework-arduinoststm32-maple": { "type": "framework", From dd3869208f32ac87da20821cc3e1fe1bcfe4c62c Mon Sep 17 00:00:00 2001 From: valeros Date: Thu, 28 Nov 2024 16:20:51 +0200 Subject: [PATCH 07/12] Update variants for Nucleo G4 boards --- boards/nucleo_g431rb.json | 2 +- boards/nucleo_g474re.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/boards/nucleo_g431rb.json b/boards/nucleo_g431rb.json index 07d4625d..8f4f0729 100644 --- a/boards/nucleo_g431rb.json +++ b/boards/nucleo_g431rb.json @@ -6,7 +6,7 @@ "f_cpu": "170000000L", "mcu": "stm32g431rbt6", "product_line": "STM32G431xx", - "variant": "STM32G4xx/G431R(6-8-B)(I-T)_G441RB(I-T)" + "variant": "STM32G4xx/G431R(6-8)(I-T)_G431RB(I-T)x(Z)_G441RB(I-T)" }, "connectivity": [ "can" diff --git a/boards/nucleo_g474re.json b/boards/nucleo_g474re.json index 7d8dd619..e0ede08f 100644 --- a/boards/nucleo_g474re.json +++ b/boards/nucleo_g474re.json @@ -6,7 +6,7 @@ "f_cpu": "170000000L", "mcu": "stm32g474ret6", "product_line": "STM32G474xx", - "variant": "STM32G4xx/G473R(B-C-E)T_G474R(B-C-E)T_G483RET_G484RET" + "variant": "STM32G4xx/G473R(B-C)T_G473RETx(Z)_G474R(B-C-E)T_G483RET_G484RET" }, "connectivity": [ "can" From 71ab204a3906663c403d6ab21468eaa282829e68 Mon Sep 17 00:00:00 2001 From: valeros Date: Thu, 28 Nov 2024 16:23:15 +0200 Subject: [PATCH 08/12] Update Zephyr to v4.0 - Update package version - Sync examples --- examples/zephyr-blink/src/main.c | 28 ++++++++-------- examples/zephyr-blink/zephyr/CMakeLists.txt | 4 +-- .../zephyr/CMakeLists.txt | 4 +-- .../zephyr-drivers-can/zephyr/CMakeLists.txt | 10 +++--- examples/zephyr-net-https-client/src/main.c | 13 +++++--- .../zephyr/CMakeLists.txt | 9 ++---- .../zephyr-net-https-client/zephyr/prj.conf | 22 +++++++++---- .../include/sample_usbd.h | 32 +++++++++++++++++++ .../zephyr-subsys-usb-hid-mouse/src/main.c | 10 +++--- .../src/sample_usbd_init.c | 12 ++++--- .../zephyr/CMakeLists.txt | 2 +- platform.json | 2 +- 12 files changed, 100 insertions(+), 48 deletions(-) create mode 100644 examples/zephyr-subsys-usb-hid-mouse/include/sample_usbd.h diff --git a/examples/zephyr-blink/src/main.c b/examples/zephyr-blink/src/main.c index 9c9ab430..4cab4969 100644 --- a/examples/zephyr-blink/src/main.c +++ b/examples/zephyr-blink/src/main.c @@ -4,11 +4,12 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include #include #include /* 1000 msec = 1 sec */ -#define SLEEP_TIME_MS 300 +#define SLEEP_TIME_MS 1000 /* The devicetree node identifier for the "led0" alias. */ #define LED0_NODE DT_ALIAS(led0) @@ -19,28 +20,29 @@ */ static const struct gpio_dt_spec led = GPIO_DT_SPEC_GET(LED0_NODE, gpios); -void main(void) +int main(void) { int ret; + bool led_state = true; - if (!gpio_is_ready_dt(&led)) - { - return; + if (!gpio_is_ready_dt(&led)) { + return 0; } ret = gpio_pin_configure_dt(&led, GPIO_OUTPUT_ACTIVE); - if (ret < 0) - { - return; + if (ret < 0) { + return 0; } - while (1) - { + while (1) { ret = gpio_pin_toggle_dt(&led); - if (ret < 0) - { - return; + if (ret < 0) { + return 0; } + + led_state = !led_state; + printf("LED state: %s\n", led_state ? "ON" : "OFF"); k_msleep(SLEEP_TIME_MS); } + return 0; } diff --git a/examples/zephyr-blink/zephyr/CMakeLists.txt b/examples/zephyr-blink/zephyr/CMakeLists.txt index dce86233..5272a405 100644 --- a/examples/zephyr-blink/zephyr/CMakeLists.txt +++ b/examples/zephyr-blink/zephyr/CMakeLists.txt @@ -1,7 +1,7 @@ # SPDX-License-Identifier: Apache-2.0 -cmake_minimum_required(VERSION 3.13.1) -include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE) +cmake_minimum_required(VERSION 3.20.0) +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) project(blinky) target_sources(app PRIVATE ../src/main.c) diff --git a/examples/zephyr-cpp-synchronization/zephyr/CMakeLists.txt b/examples/zephyr-cpp-synchronization/zephyr/CMakeLists.txt index 0fa9ce86..1ed7c6b6 100644 --- a/examples/zephyr-cpp-synchronization/zephyr/CMakeLists.txt +++ b/examples/zephyr-cpp-synchronization/zephyr/CMakeLists.txt @@ -1,7 +1,7 @@ # SPDX-License-Identifier: Apache-2.0 -cmake_minimum_required(VERSION 3.13.1) -include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE) +cmake_minimum_required(VERSION 3.20.0) +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) project(cpp_synchronization) target_sources(app PRIVATE ../src/main.cpp) diff --git a/examples/zephyr-drivers-can/zephyr/CMakeLists.txt b/examples/zephyr-drivers-can/zephyr/CMakeLists.txt index 31126969..dd59da24 100644 --- a/examples/zephyr-drivers-can/zephyr/CMakeLists.txt +++ b/examples/zephyr-drivers-can/zephyr/CMakeLists.txt @@ -1,8 +1,8 @@ # SPDX-License-Identifier: Apache-2.0 -cmake_minimum_required(VERSION 3.13.1) +cmake_minimum_required(VERSION 3.20.0) +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) +project(babbling) -include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE) -project(CAN) - -target_sources(app PRIVATE ../src/main.c) +FILE(GLOB app_sources ../src/*.c) +target_sources(app PRIVATE ${app_sources}) diff --git a/examples/zephyr-net-https-client/src/main.c b/examples/zephyr-net-https-client/src/main.c index 933f4b18..5c89fb42 100644 --- a/examples/zephyr-net-https-client/src/main.c +++ b/examples/zephyr-net-https-client/src/main.c @@ -141,6 +141,8 @@ static int connect_socket(sa_family_t family, const char *server, int port, LOG_ERR("Cannot connect to %s remote (%d)", family == AF_INET ? "IPv4" : "IPv6", -errno); + close(*sock); + *sock = -1; ret = -errno; } @@ -360,20 +362,23 @@ int main(void) { int iterations = CONFIG_NET_SAMPLE_SEND_ITERATIONS; int i = 0; - int ret; + int ret = 0; while (iterations == 0 || i < iterations) { ret = run_queries(); if (ret < 0) { - exit(1); + ret = 1; + break; } if (iterations > 0) { i++; if (i >= iterations) { + ret = 0; break; } } else { + ret = 0; break; } } @@ -382,6 +387,6 @@ int main(void) k_sleep(K_FOREVER); } - exit(0); - return 0; + exit(ret); + return ret; } diff --git a/examples/zephyr-net-https-client/zephyr/CMakeLists.txt b/examples/zephyr-net-https-client/zephyr/CMakeLists.txt index e4afe9e0..29bc61b5 100644 --- a/examples/zephyr-net-https-client/zephyr/CMakeLists.txt +++ b/examples/zephyr-net-https-client/zephyr/CMakeLists.txt @@ -1,10 +1,7 @@ # SPDX-License-Identifier: Apache-2.0 -cmake_minimum_required(VERSION 3.13.1) - -set (CONF_FILE "prj.conf overlay-tls.conf") - -include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE) +cmake_minimum_required(VERSION 3.20.0) +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) project(http_client) FILE(GLOB app_sources ../src/*.c) @@ -16,4 +13,4 @@ generate_inc_file_for_target( app ../src/https-cert.der ${gen_dir}/https-cert.der.inc -) + ) diff --git a/examples/zephyr-net-https-client/zephyr/prj.conf b/examples/zephyr-net-https-client/zephyr/prj.conf index dda4d34b..6f0e8af7 100644 --- a/examples/zephyr-net-https-client/zephyr/prj.conf +++ b/examples/zephyr-net-https-client/zephyr/prj.conf @@ -1,3 +1,7 @@ +# General config +CONFIG_MAIN_STACK_SIZE=3072 +CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048 + # Networking config CONFIG_NETWORKING=y CONFIG_NET_IPV4=y @@ -7,12 +11,19 @@ CONFIG_NET_SHELL=y # Sockets CONFIG_NET_SOCKETS=y -CONFIG_NET_SOCKETS_POSIX_NAMES=y -CONFIG_NET_SOCKETS_POLL_MAX=4 +CONFIG_ZVFS_POLL_MAX=4 +CONFIG_POSIX_API=y # Network driver config CONFIG_TEST_RANDOM_GENERATOR=y +# Network buffers +CONFIG_NET_PKT_RX_COUNT=16 +CONFIG_NET_PKT_TX_COUNT=16 +CONFIG_NET_BUF_RX_COUNT=128 +CONFIG_NET_BUF_TX_COUNT=128 +CONFIG_NET_CONTEXT_NET_PKT_POOL=y + # Network address config CONFIG_NET_CONFIG_SETTINGS=y CONFIG_NET_CONFIG_NEED_IPV4=y @@ -30,9 +41,8 @@ CONFIG_HTTP_CLIENT=y # Network debug config CONFIG_LOG=y -CONFIG_LOG_MODE_IMMEDIATE=y CONFIG_NET_LOG=y CONFIG_NET_SOCKETS_LOG_LEVEL_DBG=n -CONFIG_NET_HTTP_LOG_LEVEL_DBG=y - -CONFIG_MAIN_STACK_SIZE=2048 +CONFIG_NET_HTTP_LOG_LEVEL_DBG=n +CONFIG_NET_IPV6_LOG_LEVEL_DBG=n +CONFIG_NET_IPV6_ND_LOG_LEVEL_DBG=n diff --git a/examples/zephyr-subsys-usb-hid-mouse/include/sample_usbd.h b/examples/zephyr-subsys-usb-hid-mouse/include/sample_usbd.h new file mode 100644 index 00000000..11779fef --- /dev/null +++ b/examples/zephyr-subsys-usb-hid-mouse/include/sample_usbd.h @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef ZEPHYR_SAMPLES_SUBSYS_USB_COMMON_SAMPLE_USBD_H +#define ZEPHYR_SAMPLES_SUBSYS_USB_COMMON_SAMPLE_USBD_H + +#include +#include + +/* + * The scope of this header is limited to use in USB samples together with the + * new experimental USB device stack, you should not use it in your own + * application. However, you can use the code as a template. + */ + +/* + * This function uses Kconfig.sample_usbd options to configure and initialize a + * USB device. It configures sample's device context, default string descriptors, + * USB device configuration, registers any available class instances, and + * finally initializes USB device. It is limited to a single device with a + * single configuration instantiated in sample_usbd_init.c, which should be + * enough for a simple USB device sample. + * + * It returns the configured and initialized USB device context on success, + * otherwise it returns NULL. + */ +struct usbd_context *sample_usbd_init_device(usbd_msg_cb_t msg_cb); + +#endif /* ZEPHYR_SAMPLES_SUBSYS_USB_COMMON_SAMPLE_USBD_H */ diff --git a/examples/zephyr-subsys-usb-hid-mouse/src/main.c b/examples/zephyr-subsys-usb-hid-mouse/src/main.c index 84913f79..4e579832 100644 --- a/examples/zephyr-subsys-usb-hid-mouse/src/main.c +++ b/examples/zephyr-subsys-usb-hid-mouse/src/main.c @@ -55,10 +55,12 @@ static ALWAYS_INLINE void rwup_if_suspended(void) } } -static void input_cb(struct input_event *evt) +static void input_cb(struct input_event *evt, void *user_data) { static uint8_t tmp[MOUSE_REPORT_COUNT]; + ARG_UNUSED(user_data); + switch (evt->code) { case INPUT_KEY_0: rwup_if_suspended(); @@ -95,7 +97,7 @@ static void input_cb(struct input_event *evt) } -INPUT_CALLBACK_DEFINE(NULL, input_cb); +INPUT_CALLBACK_DEFINE(NULL, input_cb, NULL); #if defined(CONFIG_USB_DEVICE_STACK_NEXT) static int enable_usb_device_next(void) @@ -174,11 +176,11 @@ int main(void) } while (true) { - uint8_t __aligned(sizeof(void *)) report[MOUSE_REPORT_COUNT]; + UDC_STATIC_BUF_DEFINE(report, MOUSE_REPORT_COUNT); k_msgq_get(&mouse_msgq, &report, K_FOREVER); - ret = hid_int_ep_write(hid_dev, report, sizeof(report), NULL); + ret = hid_int_ep_write(hid_dev, report, MOUSE_REPORT_COUNT, NULL); if (ret) { LOG_ERR("HID write error, %d", ret); } else { diff --git a/examples/zephyr-subsys-usb-hid-mouse/src/sample_usbd_init.c b/examples/zephyr-subsys-usb-hid-mouse/src/sample_usbd_init.c index 1cca20d8..1428a956 100644 --- a/examples/zephyr-subsys-usb-hid-mouse/src/sample_usbd_init.c +++ b/examples/zephyr-subsys-usb-hid-mouse/src/sample_usbd_init.c @@ -33,6 +33,9 @@ USBD_DESC_PRODUCT_DEFINE(sample_product, CONFIG_SAMPLE_USBD_PRODUCT); USBD_DESC_SERIAL_NUMBER_DEFINE(sample_sn); /* doc string instantiation end */ +USBD_DESC_CONFIG_DEFINE(fs_cfg_desc, "FS Configuration"); +USBD_DESC_CONFIG_DEFINE(hs_cfg_desc, "HS Configuration"); + /* doc configuration instantiation start */ static const uint8_t attributes = (IS_ENABLED(CONFIG_SAMPLE_USBD_SELF_POWERED) ? USB_SCD_SELF_POWERED : 0) | @@ -42,12 +45,12 @@ static const uint8_t attributes = (IS_ENABLED(CONFIG_SAMPLE_USBD_SELF_POWERED) ? /* Full speed configuration */ USBD_CONFIGURATION_DEFINE(sample_fs_config, attributes, - CONFIG_SAMPLE_USBD_MAX_POWER); + CONFIG_SAMPLE_USBD_MAX_POWER, &fs_cfg_desc); /* High speed configuration */ USBD_CONFIGURATION_DEFINE(sample_hs_config, attributes, - CONFIG_SAMPLE_USBD_MAX_POWER); + CONFIG_SAMPLE_USBD_MAX_POWER, &hs_cfg_desc); /* doc configuration instantiation end */ /* @@ -69,6 +72,7 @@ static void sample_fix_code_triple(struct usbd_context *uds_ctx, /* Always use class code information from Interface Descriptors */ if (IS_ENABLED(CONFIG_USBD_CDC_ACM_CLASS) || IS_ENABLED(CONFIG_USBD_CDC_ECM_CLASS) || + IS_ENABLED(CONFIG_USBD_CDC_NCM_CLASS) || IS_ENABLED(CONFIG_USBD_AUDIO2_CLASS)) { /* * Class with multiple interfaces have an Interface @@ -159,8 +163,8 @@ struct usbd_context *sample_usbd_init_device(usbd_msg_cb_t msg_cb) } if (IS_ENABLED(CONFIG_SAMPLE_USBD_20_EXTENSION_DESC)) { - (void)usbd_device_set_bcd(&sample_usbd, USBD_SPEED_FS, 0x0201); - (void)usbd_device_set_bcd(&sample_usbd, USBD_SPEED_HS, 0x0201); + (void)usbd_device_set_bcd_usb(&sample_usbd, USBD_SPEED_FS, 0x0201); + (void)usbd_device_set_bcd_usb(&sample_usbd, USBD_SPEED_HS, 0x0201); err = usbd_add_descriptor(&sample_usbd, &sample_usbext); if (err) { diff --git a/examples/zephyr-subsys-usb-hid-mouse/zephyr/CMakeLists.txt b/examples/zephyr-subsys-usb-hid-mouse/zephyr/CMakeLists.txt index b2f8c307..3ab90126 100644 --- a/examples/zephyr-subsys-usb-hid-mouse/zephyr/CMakeLists.txt +++ b/examples/zephyr-subsys-usb-hid-mouse/zephyr/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.20.0) find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) -project(hid-keyboard) +project(hid-mouse) include(${ZEPHYR_BASE}/samples/subsys/usb/common/common.cmake) FILE(GLOB app_sources ../src/*.c) diff --git a/platform.json b/platform.json index e1c92cf9..bb69c768 100644 --- a/platform.json +++ b/platform.json @@ -298,7 +298,7 @@ "type": "framework", "optional": true, "owner": "platformio", - "version": "~2.30700.0" + "version": "~2.40000.0" }, "tool-stm32duino": { "type": "uploader", From 5c0f918174d26e1929af850ab60084709fc7f6e4 Mon Sep 17 00:00:00 2001 From: valeros Date: Thu, 28 Nov 2024 16:58:28 +0200 Subject: [PATCH 09/12] Switch CI to Python to v3.10 --- .github/workflows/examples.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index 5e36e037..1ad90ec8 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -54,7 +54,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v3 with: - python-version: "3.9" + python-version: "3.10" - name: Install dependencies run: | pip install -U https://github.com/platformio/platformio/archive/develop.zip From 810b08c9c5c0dee00f009e410bbb6b3cac723be2 Mon Sep 17 00:00:00 2001 From: valeros Date: Thu, 28 Nov 2024 17:53:58 +0200 Subject: [PATCH 10/12] Update Arduino-mbed core to v4.2.1 --- platform.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform.json b/platform.json index e1c92cf9..30267aa7 100644 --- a/platform.json +++ b/platform.json @@ -214,7 +214,7 @@ "type": "framework", "optional": true, "owner": "platformio", - "version": "~4.1.5" + "version": "~4.2.1" }, "framework-stm32cubef0": { "type": "framework", From 34aea81136466f07497175458e0241fd3722f59a Mon Sep 17 00:00:00 2001 From: Hugh-rymcu <57855411+Hugh-rymcu@users.noreply.github.com> Date: Fri, 29 Nov 2024 17:19:04 +0800 Subject: [PATCH 11/12] Add RYMCU F103 and F407 boards (#816) --- boards/rymcu_f407ve.json | 62 +++++++++++++++++++++++++++++++ boards/rymcu_nebulapi_f103ve.json | 55 +++++++++++++++++++++++++++ 2 files changed, 117 insertions(+) create mode 100644 boards/rymcu_f407ve.json create mode 100644 boards/rymcu_nebulapi_f103ve.json diff --git a/boards/rymcu_f407ve.json b/boards/rymcu_f407ve.json new file mode 100644 index 00000000..19a96953 --- /dev/null +++ b/boards/rymcu_f407ve.json @@ -0,0 +1,62 @@ +{ + "build": { + "arduino": { + "variant_h": "variant_generic.h" + }, + "core": "stm32", + "cpu": "cortex-m4", + "extra_flags": "-DSTM32F407xx -DARDUINO_GENERIC_F407VETX -DSTM32F4", + "f_cpu": "168000000L", + "hwids": [ + [ + "0x1EAF", + "0x0003" + ], + [ + "0x0483", + "0x3748" + ] + ], + "mcu": "stm32f407vet6", + "product_line": "STM32F407xx", + "variant": "STM32F4xx/F407V(E-G)T_F417V(E-G)T" + }, + "debug": { + "default_tools": [ + "stlink" + ], + "jlink_device": "STM32F407VE", + "openocd_extra_args": [ + "-c", + "reset_config none" + ], + "openocd_target": "stm32f4x", + "svd_path": "STM32F40x.svd" + }, + "frameworks": [ + "arduino", + "cmsis", + "stm32cube", + "libopencm3" + ], + "name": "RYMCU STM32F407VE (192k RAM. 512k Flash)", + "upload": { + "disable_flushing": false, + "maximum_ram_size": 131072, + "maximum_size": 514288, + "protocol": "stlink", + "protocols": [ + "jlink", + "cmsis-dap", + "stlink", + "blackmagic", + "serial", + "dfu" + ], + "require_upload_port": true, + "use_1200bps_touch": false, + "wait_for_upload_port": false + }, + "url": "https://rymcu.com/products", + "vendor": "RYMCU" +} diff --git a/boards/rymcu_nebulapi_f103ve.json b/boards/rymcu_nebulapi_f103ve.json new file mode 100644 index 00000000..aaa16270 --- /dev/null +++ b/boards/rymcu_nebulapi_f103ve.json @@ -0,0 +1,55 @@ +{ + "build": { + "arduino": { + "variant_h": "variant_generic.h" + }, + "core": "stm32", + "cpu": "cortex-m3", + "extra_flags": "-DSTM32F103xE -DSTM32F1 -DARDUINO_GENERIC_F103VETX", + "f_cpu": "72000000L", + "hwids": [ + [ + "0x1EAF", + "0x0003" + ], + [ + "0x1EAF", + "0x0004" + ] + ], + "mcu": "stm32f103vet6", + "product_line": "STM32F103xE", + "variant": "STM32F1xx/F103V(C-D-E)(H-T)" + }, + "debug": { + "jlink_device": "STM32F103VE", + "openocd_target": "stm32f1x", + "svd_path": "STM32F103xx.svd" + }, + "frameworks": [ + "arduino", + "cmsis", + "libopencm3", + "stm32cube" + ], + "name": "RYMCU Nebula Pi F103VE (64k RAM. 512k Flash)", + "upload": { + "disable_flushing": false, + "maximum_ram_size": 65536, + "maximum_size": 524288, + "protocol": "stlink", + "protocols": [ + "jlink", + "cmsis-dap", + "stlink", + "blackmagic", + "serial", + "dfu" + ], + "require_upload_port": true, + "use_1200bps_touch": false, + "wait_for_upload_port": false + }, + "url": "https://rymcu.com/products", + "vendor": "RYMCU" +} From f42a4979b9186bc4b940ab56fa3cdfd1fad9f4d2 Mon Sep 17 00:00:00 2001 From: valeros Date: Fri, 29 Nov 2024 18:08:30 +0200 Subject: [PATCH 12/12] Bump version to 18.0.0 --- platform.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform.json b/platform.json index ea1f44ec..61e56880 100644 --- a/platform.json +++ b/platform.json @@ -18,7 +18,7 @@ "type": "git", "url": "https://github.com/platformio/platform-ststm32.git" }, - "version": "17.6.0", + "version": "18.0.0", "frameworks": { "mbed": { "package": "framework-mbed",