Custom STM32F4 arcade board using ILI9341 LCD (4-wire SPI)

I was testing the Adafruit Feather F405 for arcade and trying to setup with a 2.8” ILI 9341 LCD using 4-wire SPI connection. I noticed that nothing is displayed on the screen other than the backlight turned on. Does the 4-wire SPI work with ILI9341 on STM32F4 devices?

The reason I asked is that 8-bit parallel seems to be the more preferred method of wiring the ILI9341 LCD to STM32 chips, and my LCD on hand has pinouts only for 4-wire SPI.

The 4-wire SPI worked flawlessly with my SAMD51-based arcade tests previously.

I have done.


please show your “board.h” or result of https://microsoft.github.io/uf2/patcher/.

BTW, my changes for ILI9341(4wire SPI).

37, 320,    // DISPLAY_WIDTH = 320
38, 240,    // DISPLAY_HEIGHT = 240
39, 0x08,   // DISPLAY_CFG0 = 0x08
40, 0x0010ff,   // DISPLAY_CFG1 = 0x10ff
41, 50,         // DISPLAY_CFG2 = 0x50
78, 9341,   // DISPLAY_TYPE = ILI9341
1 Like

Here’s from my CURRENT.UF2 file.

DISPLAY_CFG0 = 0xc8
DISPLAY_CFG1 = 0x18ff
DISPLAY_CFG2 = 0x32
DISPLAY_HEIGHT = 240
DISPLAY_TYPE = ILI9341
DISPLAY_WIDTH = 320

It’s odd that my config file is actually working on another ILI9341 LCD module.
image

you should try to modify “board.h” as follwing,
320x240 based on ILI9341 via SPI
in https://arcade.makecode.com/hardware/adding

and, You will need to check if DISPLAY_SCK is defined.
Normally, SPI1(PA5:SCK,PA7:MOSI) on STM32F4 is used for the display.

It is my define.

32, 0x5, // PIN_DISPLAY_SCK = PA05
33, 0x6, // PIN_DISPLAY_MISO = PA06(but no pin at LCD)
34, 0x7, // PIN_DISPLAY_MOSI = PA07
35, 0x4, // PIN_DISPLAY_CS = PA04
36, 0x3, // PIN_DISPLAY_DC = PA03
43, 0x1, // PIN_DISPLAY_RST = PA01
44, 0x2, // PIN_DISPLAY_BL = PA02

Adafruit modules have automatic reset circuit. Most others don’t. Make sure you have the RST line defined and connected correctly.

@mmoskal which RESET pin - STM32 reset or LCD_RESET pin?

I assigned the LCD_RESET to PIN_D12 but it does nothing as soon as I finished uploading the uf2 file of a game I downloaded for F4.

But now, it’s all empty white screen and no Arcade drive.

What’s wrong with this config?

# detected UF2 file
# Found CFG DATA at 0x8007c00

PINS_PORT_SIZE = PA_16
PIN_A0 = PA04
PIN_A1 = PA05
PIN_A2 = PA06
PIN_A3 = PA07
PIN_A4 = PC04
PIN_A5 = PC05
PIN_D0 = PB11
PIN_D1 = PB10
PIN_D5 = PC07
PIN_D6 = PC06
PIN_D9 = PB08
PIN_D10 = PB09
PIN_D11 = PC03
PIN_D12 = PC02
PIN_D13 = PC01
PIN_BTN_A = PIN_D5
PIN_BTN_B = PIN_D6
PIN_BTN_DOWN = PIN_A5
PIN_BTN_LEFT = PIN_A2
PIN_BTN_MENU = PIN_A1
PIN_BTN_RIGHT = PIN_A3
PIN_BTN_UP = PIN_A4
PIN_DISPLAY_BL = PIN_D11
PIN_DISPLAY_CS = PIN_D10
PIN_DISPLAY_DC = PIN_D9
PIN_DISPLAY_MOSI = PB15
PIN_DISPLAY_RST = PIN_D12
PIN_DISPLAY_SCK = PB13
PIN_JACK_COMMLED = PIN_D13
PIN_JACK_SND = PIN_D0
PIN_JACK_TX = PIN_D1
BOOTLOADER_BOARD_ID = 0xa73105d1
BOOTLOADER_PROTECTION = 0
CPU_MHZ = 168
DISPLAY_CFG0 = 0xc8
DISPLAY_CFG1 = 0x18ff
DISPLAY_CFG2 = 0x32
DISPLAY_HEIGHT = 240
DISPLAY_TYPE = ILI9341
DISPLAY_WIDTH = 320
FLASH_BYTES = 0x100000
POWER_DEEPSLEEP_TIMEOUT = 120
RAM_BYTES = 0x30000
SPEAKER_VOLUME = 128
UF2_FAMILY = STM32F401

To me, it doesn’t seem wrong…
but I can’t check because I don’t have Feather STM32F405. :cry:

@phillowcompiler, what STM32F4 chip worked for you?

using STM32F411CEU6 board.

1 Like

I got the F401c version. My F411c board got zapped causing the chip to crack so it is unusable at this point.

The F405 stalled on the Arcade display and won’t run any games for F4. (sigh)