Page 1 of 1

[SOLVED]Connecting Nextion LCD to STM32F103C8T6

Posted: Tue Aug 22, 2023 6:33 am
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

Re: Connecting Nextion LCD to STM32F103C8T6

Posted: Tue Aug 22, 2023 10:07 am
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

Re: Connecting Nextion LCD to STM32F103C8T6

Posted: Tue Aug 22, 2023 2:14 pm
by fpiSTM
Default Serial for bluepill is Serial1 onPA9 PA10.
You have to instantiate Serial2. See the wiki.

Re: Connecting Nextion LCD to STM32F103C8T6

Posted: Wed Aug 23, 2023 2:23 am
by fathan95
OMG I forget about instantiate Serial2, Thanks, it works!