I ran into an issue with Arduino GIGA R1 WiFi using Arduino Zephyr Boards 0.90.0 where sketches uploaded successfully, but after reset the Zephyr runtime USB device never appeared.
Arduino Mbed OS GIGA Boards 4.6.0 worked correctly on the same hardware, USB cable and board.
After instrumenting the Zephyr loader over USART1 (PA9/PB7), the exact failure was identified.
flash_area_open(user_sketch) succeeds, but the first flash_area_read() of the sketch header returns -EIO.
The failure is in:
zephyr/drivers/flash/flash_stm32h7x.c
flash_stm32h7_read() performs the memory read and afterwards calls flash_stm32_check_status().
Before the read, STM32H747 Bank 2 FLASH_SR2 already contains:
0x00040000 = PGSERR
This is a stale program-sequence error flag left from an earlier programming/boot stage. The read itself does not cause the error, but the driver sees the old flag after the memcpy and returns -EIO.
Because of this, the Arduino Zephyr loader exits before reading the sketch header, before usb_enable(), and before loading the LLEXT sketch.
A minimal diagnostic fix was to clear the pre-existing flash status before starting the read:
(void)flash_stm32_check_status(dev);
With this change:
flash_area_read() = 0
the sketch header is read correctly,
usb_enable() = 0,
and the board enumerates normally as:
VID:PID 2341:0666
Arduino GIGA R1
/dev/cu.usbmodem211101
arduino-cli also recognizes it correctly as:
arduino:zephyr_main:giga
The result was reproduced after a physical power cycle.
So this was not a WLAN, USB hardware, LLEXT or sketch issue. The loader was being stopped by a stale STM32H7 flash status flag.
I have full UART before/after logs, instrumented ELF/BIN files and a minimal patch available if useful to the maintainers.