Arduino UNO Q MCU에서 Zephyr
Source: Dev.to
Overview
Arduino UNO Q는 STM32U585 MCU를 사용하여 모든 Arduino 기능을 처리합니다. 이 MCU는 메인 프로세서와 보드의 GPIO 핀과 통신합니다. 핀아웃에 대한 가장 신뢰할 수 있는 정보는 공식 회로도에 있습니다:
회로도에는 RGB LED(LED 3 및 LED 4)에 연결된 GPIO 핀이 표시되어 있으며, 이는 여러분의 프로젝트에 참고용으로 사용할 수 있습니다.
Prerequisites
- Zephyr SDK (최소 버전 4.3.0 – UNO Q 지원이 포함된 최초 릴리스)
- ADB tools – 호스트 PC에서 장치로 파일을 전송하기 위해 필요
- 클론한 Zephyr 워크스페이스(예:
~/zephyrproject/zephyr)
Build and flash a Zephyr sample
다음 단계는 UNO Q 보드에서 클래식 blinky 예제를 컴파일하고 실행합니다.
# Navigate to your Zephyr workspace
cd ~/zephyrproject/zephyr
# Build the blinky sample for the Arduino UNO Q board
west build -p always -b arduino_uno_q samples/basic/blinky
Transfer the binary to the device
adb push build/zephyr/zephyr.elf /tmp/
Flash the STM32U585 MCU
ADB를 통해 UNO Q에 셸을 열고 remoteocd 업로드 명령을 실행합니다(경로는 설치 환경에 맞게 조정해야 할 수 있습니다).
adb shell
# Inside the UNO Q shell
/home/arduino/.arduino15/packages/arduino/tools/remoteocd/0.0.4-rc.4/remoteocd \
upload \
--adb-path "/home/arduino/.arduino15/packages/arduino/tools/adb/32.0.0/adb" \
-s "{upload.port.properties.serialNumber}" \
-f "/home/arduino/.arduino15/packages/arduino/hardware/zephyr/0.52.0/variants/arduino_uno_q_stm32u585xx/flash_bootloader.cfg" \
"--verbose" \
/tmp/zephyr.elf
과정이 정상적으로 완료되면 LED 3이 녹색으로 깜박입니다.
Restoring the Sketch Bootloader
Zephyr 바이너리를 플래시한 뒤 Arduino App Lab에서 새로운 스케치를 업로드하면 Sketch Bootloader가 아직 남아 있기 때문에 실패합니다. 정상적인 Arduino 스케치 업로드를 다시 사용할 수 있도록 부트로더를 재설치합니다:
arduino-cli burn-bootloader -b arduino:zephyr:unoq -P jlink
위 명령을 실행한 후에는 보드가 App Lab을 통해 스케치를 정상적으로 받아들입니다.
References
- Zephyr documentation for Arduino UNO Q:
- Arduino RemoteOCD repository:
- Arduino UNO Q schematic (PDF):