[SOLVED]Connecting Nextion LCD to STM32F103C8T6

Post here first, or if you can't find a relevant section!
Post Reply
fathan95
Posts: 6
Joined: Mon Aug 21, 2023 9:16 am
Answers: 1

[SOLVED]Connecting Nextion LCD to STM32F103C8T6

Post by fathan95 »

Hi! I try to connecting STM32F103C8T6 with Nextion LCD (NX3224T028_011) using Arduino IDE. while I compiling the code, there is an error says like this

Code: Select all

c:/users/asus/appdata/local/arduino15/packages/stmicroelectronics/tools/xpack-arm-none-eabi-gcc/12.2.1-1.2/bin/../lib/gcc/arm-none-eabi/12.2.1/../../../../arm-none-eabi/bin/ld.exe: libraries\ITEADLIB_Arduino_Nextion-master\NexHardware.cpp.o: in function `nexLoop(NexTouch**)':

NexHardware.cpp:(.text._Z7nexLoopPP8NexTouch+0x70): undefined reference to `Serial2'

collect2.exe: error: ld returned 1 exit status

exit status 1

Error compiling for board Generic STM32F1 series.
Anyone can help? Thank you
Last edited by fathan95 on Wed Aug 23, 2023 2:23 am, edited 1 time in total.
ag123
Posts: 1653
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: Connecting Nextion LCD to STM32F103C8T6

Post by ag123 »

I'm not too sure about Nexton LCD, but that if it has a
#include " include.h "
file, try to declare extern HardwareSerial Serial2;
And maybe to have #include <Arduino.h> in there as well
so that it'd find the symbol references
User avatar
fpiSTM
Posts: 1723
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: Connecting Nextion LCD to STM32F103C8T6

Post by fpiSTM »

Default Serial for bluepill is Serial1 onPA9 PA10.
You have to instantiate Serial2. See the wiki.
fathan95
Posts: 6
Joined: Mon Aug 21, 2023 9:16 am
Answers: 1

Re: Connecting Nextion LCD to STM32F103C8T6

Post by fathan95 »

OMG I forget about instantiate Serial2, Thanks, it works!
Post Reply

Return to “General discussion”