cancel
Showing results for 
Search instead for 
Did you mean: 

NUCLEO-F401RE and LCD/TFT screen (ST7789+XPT2046 drivers)

ByteCrafter
Associate

Hello ST Community,

 

I am connecting you because I am trying to use a Waveshare LCD/TFT screen (https://www.waveshare.com/2.8inch-tft-touch-shield.htm) which uses the ST7789 (lcd) and XPT2046 (TFT) chips. I can make it work with an Arduino Leonardo board. However, I cannot implement it with the NUCLEO-F401RE board. More precisely, I can implement the backlight (by driving a GPIO), but the SPI communication does not seem to be working. Would you be able to confirm that pins PA5 should be used for SCLK, PA6 for MISO, PA7 for MOSI and PB4 to PB6 for: SD_CS, TP_CS and LCD_CS ?

  There are several git repo with different code drivers version, but not sure about SPI1 pinout.

 

Do you have a link to a driver that can be used with the NUCLEO-F401RE board or any advices for debugging ?

 

Thank you very much for any help you can give me.

 

Best regards,

1 ACCEPTED SOLUTION

Accepted Solutions
Peter BENSCH
ST Employee

The ZIP with the source codes from Waveshare also contains the ioc files of the projects for STM32, which are based on STM32F103 but can be converted to STM32F401.

PA5 is already assigned to LD2 on the NUCLEO, but you can easily change this by opening SB21, for example, and thus disconnecting LD2. If you then set pin PA5 to Reset_State again with STM32CubeMX or STM32CubeIDE, you can easily set SPI1 to full-fuplex master and thus assign MOSI, MISO and SCK.

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

3 REPLIES 3

The pin assignments should be derived from the NUCLEO-F401RE User Manual, or Schematic under the CAD Resources tab on the product page.

https://www.st.com/en/evaluation-tools/nucleo-f401re.html

D13 PA5 SCLK

D12 PA6 MISO

D11 PA7 MOSI

D10 PB6 LCD_CS

D9 PC7 LCD_BL

D5 PB4 SD_CS

D4 PB5 TP_CS

Should be several drivers you could port to the platform

Use the SPI TransmitReceive function to get good timing with respect of GPIO for CS going LOW/HIGH

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Peter BENSCH
ST Employee

The ZIP with the source codes from Waveshare also contains the ioc files of the projects for STM32, which are based on STM32F103 but can be converted to STM32F401.

PA5 is already assigned to LD2 on the NUCLEO, but you can easily change this by opening SB21, for example, and thus disconnecting LD2. If you then set pin PA5 to Reset_State again with STM32CubeMX or STM32CubeIDE, you can easily set SPI1 to full-fuplex master and thus assign MOSI, MISO and SCK.

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Thank you Peter and Tesla De Lorean for your support. Your proposals help me to fix the issue.