Arduino GIGA R1 WiFi with the Display Shield
What the OmniPython board config for the GIGA R1 WiFi and its Display Shield
gives you, and how to set the board up. The role names (audio_out, pcm_in,
usb_device and the rest) are explained in
Board peripherals; the other boards are in
Board configs.
Config:
fbdisplay/arduino-giga-display-shield, inboard_configs/.Resolution: 480×800, portrait. LVGL programs see an 800×480 landscape screen:
LVGL_ROTATIONinboard_config.pysets which way up (0 keeps it portrait), and LVGL rotates touch to match. Programs that draw without LVGL see the panel as 480×800.Display:
mipidsi.Bus+mipidsi.Display, ST7701S init sequence (giga_display_shield_init), 2-lane DSI at 500 Mbit/s per lane, pixel clock 40 MHz, framebuffer in the GIGA’s SDRAM. Panel power on PC6, backlight on PB12.Touch: GT911 on I2C4 (SCL PB6, SDA PH12), reset PI2, interrupt PI1. If
I2C(4).scan()finds nothing (it should list the GT911, at0x14or0x5D, beside0x50and0x68), the shield isn’t fully seated on the GIGA’s headers: press it home or reseat it.Audio: the headphone jack, which the STM32H747’s DAC drives directly (left PA5, right PA4), through the firmware’s
audioio.AudioOut.audio_outandpcm_outboth play there, at any rate, mono or stereo, at 12 bits. There’s no codec, so volume is scaled in software. The DAC’s ring holds about 93 ms;latency="buffered"asks for 250 ms andqueue_msfor any length, which a player wants and an instrument doesn’t. A write to/flashpauses the interpreter for 140-280 ms, so don’t write files while audio plays. Needs the firmware’saudiodspandaudioifmodules.Microphones:
pcm_inrecords the Display Shield’s MP34DT06J, a PDM microphone that the STM32H747’s DFSDM decimates in hardware (clock PD3, data PC1), at 8, 16, 24, 32 or 48 kHz.pcm_in(mic="jack")records a headset’s microphone in the jack instead, from the ring on A7 (PA0), sampled by the ADC at any rate; that path has been checked on the ADC’s side, not yet with a headset in the jack. Both are mono 16-bit and record whileaudio_outplays; one records at a time. The firmware keeps about a quarter of a second at 16 kHz, so a reader can fall that far behind without losing anything.USB MIDI:
usb_midimakes the USB-C port a MIDI device the computer plays, beside the REPL’s serial port. Needs firmware withmachine.USBDeviceand micropython-lib’susb-device-midi.USB host: the USB-A port hosts keyboards, mice, flash drives and MIDI controllers through
usb.core,usb.host.hid,usb.host.mscandmidiports.usb_host, while the USB-C port stays the REPL. The port has no power untilusb.core.start(). Bus-powered devices that draw more than about 500 mA may not run; use a powered hub. Needs firmware with theusbhostmodule (what it supports).USB flash drive as
/sd: the board has no card slot, sosdcardis the flash drive in the USB-A hub, as a block device:os.mount(board.sdcard, "/sd")and apps that read/sd(midiEngine’s/sd/midiand/sd/soundfonts, the MP3 player) find the drive’s files. It starts the USB host, so keep a keyboard or MIDI device in the same hub, and give it a few seconds to show up. It needsusb-host-mscin the ROMFS (below). Interrupting a transfer to the drive can leave it timing out until the board resets.Bluetooth LE:
bleis a bledev adapter over the GIGA’s Murata 1DX, which also answers everybluetooth.BLEmethod. Needs firmware with Bluetooth, and micropython-lib’saioble.IMU: the shield’s BMI270 on I2C4 at
0x68, beside the touch controller, soaccelerometerandgyroscope(one object) takeboard_config.i2c. Needs micropython-lib’sbmi270.LED and button:
ledis the GIGA’s green LED (PJ13, active low, as amachine.Signal);boot_buttonis the BOOT0 button on PC13, reading 1 while pressed.Not yet roles: the camera connector waits for firmware support; the shield’s RGB LED (IS31FL3197 at
0x50) waits for a driver. CAN needs a transceiver the board doesn’t have, and the only RTC is the STM32’s own (machine.RTC).Firmware: omnipython-builds’
ARDUINO_GIGAboard with itsDISPLAY_SHIELDvariant and--modules displayif,lvgl(flashing it).Libraries: the OmniPython libraries don’t fit in the firmware beside LVGL, so they go in the board’s 4 MB ROMFS with the drivers this board needs: the two in this repository, micropython-lib’s
bmi270for the IMU andaioblefor Bluetooth, the USB host packages, and the audio packagesaudioeffectsandaudioinstrumentsthat apps like midiEngine import. The firmware keeps its own Python modules (asyncio, webrepl, mip and the rest) in the ROMFS too, and a deploy replaces the whole partition, so start the folder with those, from the firmware release’sromfs-fileszip or the build’sromfs/folder. Then add the rest and deploy it once, from a clone of this repository:git clone --depth 1 https://github.com/PyDevices/omnipython.git mkdir romfs unzip omnipython-mp-arduino_giga-display_shield-*.romfs-files.zip -d romfs cp -r omnipython/lib/* omnipython/drivers/touch/gt911.py \ omnipython/drivers/display/giga_display_shield_init.py romfs/ cp -r omnipython/packages/midiports/midiports romfs/ mkdir -p romfs/usb/host cp omnipython/packages/usb/usb-core/usb/*.py romfs/usb/ cp omnipython/packages/usb/usb-core/usb_host.py romfs/ cp omnipython/packages/usb/usb-host-hid/usb/host/*.py \ omnipython/packages/usb/usb-host-msc/usb/host/*.py romfs/usb/host/ curl -o romfs/bmi270.py https://raw.githubusercontent.com/micropython/micropython-lib/master/micropython/drivers/imu/bmi270/bmi270.py mkdir romfs/aioble for f in __init__ central client core device l2cap peripheral security server; do curl -o romfs/aioble/$f.py https://raw.githubusercontent.com/micropython/micropython-lib/master/micropython/bluetooth/aioble/aioble/$f.py done for r in audioeffects audioinstruments; do git clone --depth 1 --branch v0.5.1 https://github.com/PyDevices/$r.git cp -r $r/lib/$r romfs/ rm -f romfs/$r/README.md done mpremote romfs deploy romfs cd omnipython/board_configs/fbdisplay/arduino-giga-display-shield mpremote cp board_config.py board_peripherals.py :/flash/
With the
mpy-crossPython package installed, mpremote compiles the folder to.mpyon the way; without it the board compiles the.pyfiles as they’re imported./romcomes before/flashonsys.path.Installing apps: the firmware has no
omip, andmip’s default folder can be the read-only ROMFS, so name/flash/libyourself. Join Wi-Fi fromsecrets.py, then putomipon the board’s flash:import mip mip.install("github:PyDevices/omnipython/lib/omip.py", target="/flash/lib")
omip.installthen installs into/flash/liband/flash/appson its own, so the app lines in install an app work as written. Where that guide saystarget="/", for Home’smain.pyand for a neweromip, saytarget="/flash"andtarget="/flash/lib"here: the board’s writable drive is/flash.