Skip to content

fix(hle): build the tests again after the SPI frame CRC change - #160

Open
munzzyy wants to merge 1 commit into
HighCodeh:devfrom
munzzyy:fix/hle-build
Open

munzzyy wants to merge 1 commit into
HighCodeh:devfrom
munzzyy:fix/hle-build

Conversation

@munzzyy

@munzzyy munzzyy commented Sep 30, 2026

Copy link
Copy Markdown

The HLE Tests job has failed on every PR since the CRC-16 framing change in c91f956 (last run). spi_protocol.h includes esp_rom_crc.h and the HLE never got a host version of it. The job runs with continue-on-error, so it's easy to miss.

This adds host versions of esp_rom_crc32_le and esp_rom_crc16_le with the ROM's semantics, the esp_crc.h wrapper that config_sync.c uses, and a few tests: the standard check values, chaining, and a seal/validate round trip through spi_protocol.h. I also compared both functions against IDF's table-driven linux implementation on 60k random buffers, and broke the polynomial on purpose to make sure the check-value test fails.

It also sets CMAKE_POLICY_VERSION_MINIMUM around the cJSON FetchContent, because cJSON v1.7.18 still declares cmake_minimum_required(VERSION 3.0) and CMake 4 refuses to configure it. With both changes hle_tests is 33/33 locally (CMake 4.4, GCC 16).

This only gets hle_tests building again. hle_interactive has drifted further than that (new drivers, the app runtime, the vendored fatfs, and the PHY shim doesn't seal CRCs yet), and I'm working on it as a follow-up. Once this job is green, should it drop continue-on-error, or is that on purpose?

spi_protocol.h has included esp_rom_crc.h since c91f956 (CRC-16 frame
integrity), but the HLE never got a host version of that header. hle_shims
stopped compiling, and the HLE Tests job has failed on every PR since. It
runs with continue-on-error, so nobody saw it.

Add host versions of esp_rom_crc32_le and esp_rom_crc16_le with the ROM's
semantics (the value is inverted on entry and exit, so calls chain), plus
the esp_crc.h wrapper that config_sync.c uses. The tests cover the standard
check values, chaining, and a seal/validate round trip through
spi_protocol.h.

Also let the HLE configure on CMake 4. cJSON v1.7.18 still declares
cmake_minimum_required(VERSION 3.0), which CMake 4 refuses, so set
CMAKE_POLICY_VERSION_MINIMUM around that one FetchContent.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant