From 908a3d128fd04d9b7c198560ee8bc64401012244 Mon Sep 17 00:00:00 2001 From: hathach Date: Mon, 1 Mar 2021 21:34:45 +0700 Subject: fix ci build for rp2040 --- tools/build_family.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tools') diff --git a/tools/build_family.py b/tools/build_family.py index 23a08c663..65d0e8fc2 100644 --- a/tools/build_family.py +++ b/tools/build_family.py @@ -98,12 +98,12 @@ def build_size(example, board): def skip_example(example, board): ex_dir = 'examples/' + example + # family CMake + board_mk = 'hw/bsp/{}/family.cmake'.format(family) + # family.mk - board_mk = 'hw/bsp/{}/family.mk'.format(family) - - # family.cmake if not os.path.exists(board_mk): - board_mk = 'hw/bsp/{}/family.cmake'.format(family) + board_mk = 'hw/bsp/{}/family.mk'.format(family) with open(board_mk) as mk: mk_contents = mk.read() -- cgit v1.3.1 From 4c31a29ff05a9f08afb6932eb3089bb154d59106 Mon Sep 17 00:00:00 2001 From: hathach Date: Thu, 4 Mar 2021 12:35:43 +0700 Subject: update doc, skip board_test in esp32s2 ci --- docs/boards.md | 6 ++++-- tools/build_esp32s2.py | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'tools') diff --git a/docs/boards.md b/docs/boards.md index bff3f32be..275143118 100644 --- a/docs/boards.md +++ b/docs/boards.md @@ -94,9 +94,11 @@ This code base already had supported for a handful of following boards (sorted a - [LPCXpresso 11u68](https://www.nxp.com/support/developer-resources/evaluation-and-development-boards/lpcxpresso-boards/lpcxpresso-board-for-lpc11u68:OM13058) - [LPCXpresso 1347](https://www.nxp.com/support/developer-resources/evaluation-and-development-boards/lpcxpresso-boards/lpcxpresso-board-for-lpc1347:OM13045) - [LPCXpresso 1769](https://www.nxp.com/support/developer-resources/evaluation-and-development-boards/lpcxpresso-boards/lpcxpresso-board-for-lpc1769:OM13000) +- [LPCXpresso18S37 Development Board](https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/lpc4000-cortex-m4/lpcxpresso18s37-development-board:OM13076) - [LPCXpresso 51U68](https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/lpcxpresso51u68-for-the-lpc51u68-mcus:OM40005) - [LPCXpresso 54114](https://www.nxp.com/design/microcontrollers-developer-resources/lpcxpresso-boards/lpcxpresso54114-board:OM13089) -- [LPCXpresso 55s69 EVK](https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/lpc5500-cortex-m33/lpcxpresso55s69-development-board:LPC55S69-EVK) +- [LPCXpresso 55s28 EVK](https://www.nxp.com/design/software/development-software/lpcxpresso55s28-development-board:LPC55S28-EVK) +- [LPCXpresso 55s69 EVK](https://www.nxp.com/design/development-boards/lpcxpresso-boards/lpcxpresso55s69-development-board:LPC55S69-EVK) - [NGX LPC4330-Xplorer](https://www.nxp.com/design/designs/lpc4330-xplorer-board:OM13027) - [Double M33 Express](https://www.crowdsupply.com/steiert-solutions/double-m33-express) @@ -104,7 +106,7 @@ This code base already had supported for a handful of following boards (sorted a - [Adafruit Feather RP2040](https://www.adafruit.com/product/4884) - [Adafruit ItsyBitsy RP2040](https://www.adafruit.com/product/4888) -- Adafruit QT RP2040 +- [Adafruit QT Py RP2040](https://www.adafruit.com/product/4900) - [Raspberry Pi Pico](https://www.raspberrypi.org/products/raspberry-pi-pico/) ### Sony diff --git a/tools/build_esp32s2.py b/tools/build_esp32s2.py index 6580b6562..0ef05023c 100644 --- a/tools/build_esp32s2.py +++ b/tools/build_esp32s2.py @@ -27,8 +27,8 @@ def filter_with_input(mylist): # Build all examples if not specified all_examples = [] for entry in os.scandir("examples/device"): - # Only includes example with CMakeLists.txt for esp32s - if entry.is_dir() and os.path.exists(entry.path + "/sdkconfig.defaults"): + # Only includes example with CMakeLists.txt for esp32s, and skip board_test to speed up ci + if entry.is_dir() and os.path.exists(entry.path + "/sdkconfig.defaults") and entry.name != 'board_test': all_examples.append(entry.name) filter_with_input(all_examples) all_examples.sort() -- cgit v1.3.1 From 4a73b6a21930c71368153fe4197b96f9d100fc4c Mon Sep 17 00:00:00 2001 From: hathach Date: Wed, 10 Mar 2021 11:23:44 +0700 Subject: update doc for BOARD name, add note for udev on Linux --- docs/getting_started.md | 4 ++++ examples/device/99-tinyusb.rules | 14 ++++++++++++++ examples/device/webusb_serial/src/main.c | 20 ++++++++++++++++++++ tools/usb_drivers/99-tinyusb.rules | 18 ------------------ 4 files changed, 38 insertions(+), 18 deletions(-) create mode 100644 examples/device/99-tinyusb.rules delete mode 100644 tools/usb_drivers/99-tinyusb.rules (limited to 'tools') diff --git a/docs/getting_started.md b/docs/getting_started.md index 870491fe2..8ec0ea748 100644 --- a/docs/getting_started.md +++ b/docs/getting_started.md @@ -47,6 +47,8 @@ $ git submodule update --init lib In addition, MCU driver submodule is also needed to provide low-level MCU peripheral's driver. Luckily, it will be fetched if needed when you run the `make` to build your board. +Note: some examples especially those that uses Vendor class (e.g webUSB) may requires udev permission on Linux (and/or macOS) to access usb device. It depends on your OS distro, typically copy `/examples/device/99-tinyusb.rules` file to /etc/udev/rules.d/ then run `sudo udevadm control --reload-rules && sudo udevadm trigger` is good enough. + ### Build To build example, first change directory to an example folder. @@ -61,6 +63,8 @@ Then compile with `make BOARD=[board_name] all`, for example $ make BOARD=feather_nrf52840_express all ``` +Note: `BOARD` can be found as directory name in `hw/bsp`, either in its family/boards or directly under bsp (no family). + #### Port Selection If a board has several ports, one port is chosen by default in the individual board.mk file. Use option `PORT=x` To choose another port. For example to select the HS port of a STM32F746Disco board, use: diff --git a/examples/device/99-tinyusb.rules b/examples/device/99-tinyusb.rules new file mode 100644 index 000000000..e6372ed58 --- /dev/null +++ b/examples/device/99-tinyusb.rules @@ -0,0 +1,14 @@ +# Copy this file to the location of your distribution's udev rules, for example on Ubuntu: +# sudo cp 99-tinyusb.rules /etc/udev/rules.d/ +# Then reload udev configuration by executing: +# sudo udevadm control --reload-rules +# sudo udevadm trigger + +# Check SUBSYSTEM +SUBSYSTEMS=="hidraw", KERNEL=="hidraw*", MODE="0666", GROUP="dialout" + +# Rule applies to all TinyUSB example +ATTRS{idVendor}=="cafe", MODE="0666", GROUP="dialout" + +# Rule to blacklist TinyUSB example from being manipulated by ModemManager. +SUBSYSTEMS=="usb", ATTRS{idVendor}=="cafe", ENV{ID_MM_DEVICE_IGNORE}="1" diff --git a/examples/device/webusb_serial/src/main.c b/examples/device/webusb_serial/src/main.c index 143a73374..6a5a9fa61 100644 --- a/examples/device/webusb_serial/src/main.c +++ b/examples/device/webusb_serial/src/main.c @@ -23,6 +23,26 @@ * */ +/* This example demonstrates WebUSB as web serial with browser with WebUSB support (e.g Chrome). + * After enumerated successfully, browser will pop-up notification + * with URL to landing page, click on it to test + * - Click "Connect" and select device, When connected the on-board LED will litted up. + * - Any charters received from either webusb/Serial will be echo back to webusb and Serial + * + * Note: + * - The WebUSB landing page notification is currently disabled in Chrome + * on Windows due to Chromium issue 656702 (https://crbug.com/656702). You have to + * go to landing page (below) to test + * + * - On Windows 7 and prior: You need to use Zadig tool to manually bind the + * WebUSB interface with the WinUSB driver for Chrome to access. From windows 8 and 10, this + * is done automatically by firmware. + * + * - On Linux/macOS, udev permission may need to be updated by + * - copying '/examples/device/99-tinyusb.rules' file to /etc/udev/rules.d/ then + * - run 'sudo udevadm control --reload-rules && sudo udevadm trigger' + */ + #include #include #include diff --git a/tools/usb_drivers/99-tinyusb.rules b/tools/usb_drivers/99-tinyusb.rules deleted file mode 100644 index 334159f9a..000000000 --- a/tools/usb_drivers/99-tinyusb.rules +++ /dev/null @@ -1,18 +0,0 @@ -# Copy this file to the location of your distribution's udev rules, for example on Ubuntu: -# sudo cp 99-tinyusb.rules /etc/udev/rules.d/ -# Then reload udev configuration by executing: -# sudo udevadm control --reload-rules -# sudo udevadm trigger - -# Check SUBSYSTEM -SUBSYSTEMS=="hidraw", KERNEL=="hidraw*", MODE="0666", GROUP="dialout" - -# Rule applies to all TinyUSB example -ATTRS{idVendor}=="cafe", MODE="0666", GROUP="dialout" - -# Rule to blacklist TinyUSB example from being manipulated by ModemManager. -SUBSYSTEMS=="usb", ATTRS{idVendor}=="cafe", ENV{ID_MM_DEVICE_IGNORE}="1" - -# Xplained Pro SamG55 Device -SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2111", MODE="0666", GROUP="users", ENV{ID_MM_DEVICE_IGNORE}="1" -SUBSYSTEMS=="tty", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2111", MODE="0666", GROUP="users", ENV{ID_MM_DEVICE_IGNORE}="1" -- cgit v1.3.1