File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -113,6 +113,8 @@ Our custom data is in the following folders:
113113- ** ESP-IDF v5.4.2** (tested with the ESP32-P4 target)
114114- ** Python 3.8+** (for build scripts)
115115- Toolchain installed per [ Espressif instructions] ( https://docs.espressif.com/projects/esp-idf/en/latest/esp32p4/get-started/ )
116+ - ** libusb-1.0 runtime** (required by OpenOCD). On Debian/Ubuntu install via
117+ ` sudo apt-get install libusb-1.0-0 ` ; on macOS use ` brew install libusb ` .
116118
117119> Tested with ESP-IDF v5.4.2 for esp32p4; newer releases may require additional fixes.
118120
Original file line number Diff line number Diff line change @@ -16,6 +16,45 @@ for cmd in git python3 bash; do
1616 fi
1717done
1818
19+ check_libusb () {
20+ python3 - << 'PY '
21+ import ctypes
22+ import sys
23+
24+ NAMES = (
25+ "libusb-1.0.so.0",
26+ "libusb-1.0.dylib",
27+ "libusb-1.0.dll",
28+ )
29+
30+ for name in NAMES:
31+ try:
32+ ctypes.CDLL(name)
33+ except OSError:
34+ continue
35+ else:
36+ sys.exit(0)
37+
38+ sys.exit(1)
39+ PY
40+ }
41+
42+ if ! check_libusb; then
43+ case " $( uname -s) " in
44+ Linux)
45+ echo " Error: libusb-1.0 runtime not found. Install it with 'sudo apt-get install libusb-1.0-0'" \
46+ " or the equivalent package for your distribution." >&2
47+ ;;
48+ Darwin)
49+ echo " Error: libusb runtime not found. Install it with 'brew install libusb'." >&2
50+ ;;
51+ * )
52+ echo " Error: libusb runtime not found. Please install libusb-1.0 for your platform." >&2
53+ ;;
54+ esac
55+ exit 1
56+ fi
57+
1958mkdir -p " ${ESP_IDF_ROOT} "
2059
2160if [ -d " ${IDF_PATH} " ] && [ ! -d " ${IDF_PATH} /.git" ]; then
You can’t perform that action at this time.
0 commit comments