summaryrefslogtreecommitdiff
path: root/tools/build.py
AgeCommit message (Collapse)Author
2026-07-15dwc2: fix EP0 OUT dcache invalidate range; run usbtest on espressif s3/p4 ↵hathach
and mimxrt1015 edpt_schedule_packets() advanced xfer->buffer past each armed EP0 chunk, so the OUT-complete handler invalidated the cache at the ADVANCED pointer: one line past the received data. The CPU then read stale cached bytes instead of the DMA'd packet, and the misplaced invalidate discarded a dirty line of whatever variable follows the buffer - random neighbor corruption on every control-OUT data stage. Found by usbtest ctrl_out (cases 14/21) on espressif_p4_function_ev with DMA enabled, the first DWC2 target combining buffer DMA with a data cache: usbd control state wedged after the first control write (every later request stalled), and one build layout panicked in the usbd memcpy with a wild pointer. Rework the EP0 chunk bookkeeping so xfer->buffer always points at the un-consumed position: the arm no longer advances it; instead the EP0 re-arm paths advance past each completed (full) chunk, invalidating it first on the OUT side. The final OUT completion invalidates exactly the received bytes of its last chunk, taken from DOEPDMA ("incremented on every AHB transaction", databook 7.1.83 - the same semantics the SETUP path relies on) before dma_setup_prepare() re-targets it. EP0 chunking state (ep0_pending) is now also dropped on bus reset and on a new SETUP, so a stale latched completion can no longer re-arm EP0 DMA from dead state. No behavior change for targets without dcache. While root-causing, the FIFO layout was cross-checked against the DWC2 databook/programming guide v4.20a: the existing GDFIFOCFG programming (EPInfoBaseAddr = otg_dfifo_depth - 2*ep_count, one SPRAM word per endpoint direction for buffer DMA) is conformant and needs no change; the P4 HS instance's reset GDFIFOCFG (0x03800400) merely reflects a scatter/gather-sized EP_LOC_CNT of 128 that buffer DMA does not need. With the fix in place, enable the usbtest battery on the espressif fleet: tools/build.py allowlists device/usbtest (a plain IDF component like board_test/video_capture) and both espressif boards' only-lists gain device/usbtest. Also re-enable device/usbtest on mimxrt1015_evk: its skip predated the dcd_ci_hs stale-ACTIVE-overlay fix (already on this branch), which cured the battery that previously killed the uPD720201 host controller twice (2026-07-11 ROM fw, 2026-07-13 case 27 on fw 2.0.2.6); rig-validated 30/30 three consecutive runs. Validated on rig (all 30/30): espressif_p4_function_ev(-DMA) (was 22/30 under DMA), espressif_s3_devkitm(-DMA), stm32f723disco(-DMA), mimxrt1015_evk; p4/s3 slave-mode unaffected (DMA-only code path); compile-checked stm32h743nucleo +TUD DMA, stm32f407disco, stm32l476disco (device ports currently on the dead hub). Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_017TQZrFfU3K4Y198aLsUpBC
2026-06-30build.py: keep only raspberry_pi_pico in rp2040 ci_preferred_boardshathach
The one-board selector uses preferred_list[0] anyway, so pico is the board built. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
2026-06-30build.py: prefer pico/pico2 for rp2040 CI; skill: drop one-time 0.20.0 ↵hathach
backfill note - ci_preferred_boards: rp2040 -> raspberry_pi_pico, raspberry_pi_pico2 so the one-board CI/metrics build uses a Pico (the first-alphabetical board failed). - make-release skill: the metrics backfill was a one-time 0.20.0 task, not a recurring release step; keep only the CI auto-compare note. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
2026-06-11HIL: replace build.flags_on with named build variants (#3687)Ha Thach
* test/hil: replace build.flags_on with named variant schema Boards declare build variants as `variant: [{name, flags}]` instead of `build.flags_on`. The variant `name` is the build dir (cmake-build-<name>) and the HIL report row; `flags` is the raw CFLAGS string (-D...=1) injected via CFLAGS_CLI. No `variant` => a single build named after the board. - build.py: --build-name <name> (dir) + --cflag=<token> (raw CFLAGS, repeatable, =form survives the matrix's shell word-splitting); drop -f1/CFLAGS wrapping. - hil_ci_set_matrix.py: emit one build arg per variant. - hil_test.py: iterate variants; report row + build dir = variant name. - hil_ci.sh: copy all cmake-build-<board>* dirs for -b runs. - get_deps.py: accept (ignore) --build-name/--cflag from matrix args. - tinyusb.json: migrate all 6 flags_on boards to variant. * board_test: park CI build with busy spin instead of wfe
2026-02-12refactor build scripts to support multiple build targets and improve ↵hathach
argument handling
2026-02-11add build target argument to improve flexibility of build scripts and workflowshathach
membrowse-upload upload with --identical if elf file does not exist
2026-02-10add membrowse-upload target and use it in ci after buildhathach
2026-01-09apply copilot suggestionhathach
2025-12-05Run CI build with fixed set of boards (#3389)Ha Thach
* run cmake ci build on github with a fixed set of board to keep the size stable * Size Difference Report contain major >1% and minor <1& table
2025-12-04fine tune ci to build more with circleci (#3386)Ha Thach
* fine tune ci to build more with circleci * skip make for arm-iar, esp-idf * skip make + clang for circleci since llvm-objcopy got killed due to memory issue.
2025-12-03upload metrics.json and aggregate code metrics, post metrics commenthathach
fine tune ci matrix run
2025-12-03upload metrics.json and aggregate code metrics, fine tune ci matrix runhathach
2025-12-02adding metrics for computing average compiled sizehathach
2025-12-02adding metrics for computing average compiled sizehathach
2025-12-01run linkermap as post build for size analyzehathach
2025-07-09add option to pass symbol defines to ci build.pyhathach
add build.args option for hil json add MAX3421_HOST=1 for metro m4 express
2025-07-02remove make wrapper for rp2040/espressifhathach
2025-07-02update esp build, replace TUSB_MCU_VENDOR_ESPRESSIF by ESP_PLATFORMhathach
2025-05-28add OPT_MCU_MAX32665hathach
2025-05-19limit hil-hfp iar build to 4 parallel jobshathach
2025-04-17- run arm-iar using github actionhathach
- add skip_ci.txt to family folder to skip boards in ci run
2024-12-11limit parallel for circlecihathach
2024-12-05try to run arm-iar with circleci with new token (#2890)Ha Thach
* try to run arm-iar with circleci with new token * limit iar ci parallel build to 4 for medium+ and 6 for large * add hil-hfp to compile and test with IAR
2024-11-27minor clean uphathach
2024-11-12update host/device_info to build with freertos for espressif board. Add hil ↵hathach
test for host/device_info
2024-10-07Merge pull request #2809 from shuffle2/masterHa Thach
make all python files executable and standardize interpreter
2024-10-04add hil_ci_set_matrix.py, starting to support hil with additional build flagshathach
2024-09-30update build script to correctly skip non max3421 enabled for espressif boardshathach
2024-09-17make all python files executable and standardize interpreterShawn Hoffman
2024-08-21update circle ci to build make (#2769)Ha Thach
* update build.py script to work with circleci * build make with circle ci * build vm for esp only * nrf imxrt with large resource * nrf imxrt with large resource * remove 2 of nrf boards
2024-05-13Ci tweak3 (#2643)Ha Thach
- enable --one-per-family to build 1 board per family, also skip family if board specified in -b also present - minimize ci run for push event - only build one board per family - skip hil test on both pi4 and hfp - full build will be runn for PR event - IAR always build 1 board per family regardless of event - update build.py to optimize make - remove all setup python since we don't really need it
2024-05-10More ci tweak (#2636)Ha Thach
* change concurrency group to ${{ github.workflow }}-${{ github.ref }} * use argparse for build.py hil_test.py, remove the need to install click * move ci win/mac to build_cmake.yml * rename build_family.yml to build_util.yml * build_util.yml support esp32 * integrate build-espressif into build.yml * build.py support make with --board option * add get_deps action * update hil test to reuse action
2024-05-09Rework ci (#2631)Ha Thach
* add name field to usbd_class_driver_t * ci: use set matrix py script * add riscv32 and cmake support for ch32v307, fomu, gd32vf103 * update build_cmake.py to take --family --board --toolchain * separate hil test to its own workflow * move esp32 board into separated hil json * add make build to ci * remov build_make.py * build.py support esp32 board * setup toolchain support esp-idf * fix missing click * merge family in matrix build to reduce jobs * skip cifuzz since it still has issue with get_deps and click