OpenHW CVE2 on ALINX PI-AR035-F1-1 - Episode 03: board-control core ==================================================================== What it does ------------ CVE2 replaces the MicroBlaze control core and keeps the factory ACM serial protocol. Implemented on board: LED1-8, KEY1-2, QSPI Flash JEDEC ID, I2C EEPROM read, TF card CMD0, 500 ms watchdog. DDR3/ETH1/MIPI/ADC/HDMI_IN are NOT integrated; ACM:Auto returns wait for them. Verified result (2026-11-20) ---------------------------- ALINX AR035 CVE2 Board Control EP03 BOOT CAUSE=WDT CFG=000003c7 FLASH ID=00c84018 OK EEPROM DATA=000000b2 ACK SD R1=00000001 OK LED TEST=PASS KEY1=0 KEY2=0 READY ACM:Auto=FLASH -> ok ACM:Auto=EEPROM -> ok ACM:Auto=SD -> ok (TF card must be inserted) Resources / timing ------------------ LUT 3,413 (16.41%), FF 2,677 (6.44%), BRAM 8 (16.00%), DSP 11 (12.22%), IOB 25 (10.00%) WNS 1.617 ns / WHS 0.039 ns at set_clock_uncertainty -hold 0.100; 0 failing endpoints. Bitstream 2,192,137 B, SHA-256 aca201c01d74591e6226124473d45cce9473ef7d2872a8ea1f8539fe1edec5b7. Build ----- cd sw && make clean && make vivado -mode batch -source build_ep03.tcl vivado -mode batch -source program_ep03.tcl # hw_server on TCP:127.0.0.1:3122 Pitfalls -------- 1. flash_mosi had only a port declaration. Vivado synthesized P22 as TRISTATE, so the Flash never received 9F/FF/66/99 and always read 00ffffff. Adding assign flash_mosi = gpio_reg[2] fixed it immediately. 2. Address decode was missing a 4-bit shift: 0x4001_0000 >> 12 = 0x4_0010, not 0x4_0001. The first GPIO access hung the CPU because data_gnt never asserted. 3. cfg_ready was cleared by board reset. EOS is one-shot, so cfg_ready is now sticky. 4. UART RX FIFO rdata was registered; reading while popping returned the stale byte. Changed to assign rdata = fifo[rd_ptr]. 5. SD wait was an empty card socket, not a protocol bug. With a card inserted R1=0x01. License ------- Upstream CVE2 is Apache-2.0. See LICENSE.