Welcome, Guest. Please Login or Register
Arduino IDE for Visual Studio
 
 
When Logging a Support Issue in the Forum, please ensure you have also:-
  • Enabled vMicro > Compiler > Show Build Properties and Verbose
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
  HomeSearch Tutorials & Wiki visualmicro.com LoginHelpRegister  
 
Page Index Toggle Pages: 1
Send Topic Print
Confused by ‘Serial1’ (Read 291 times)
sstm..
Newbies
*
Offline



Posts: 7
Confused by ‘Serial1’
Jul 5th, 2021 at 5:09pm
 
It doesn't work when I use ‘Serial1’.

Compiling 'test' for 'Generic STM32F1 series'

Error linking for board Generic STM32F1 series
Build failed for project 'test'

ld.exe: test.cpp.o: in function vTest(void*)
test.ino: (.text._ZL5vTestPv+0x4c): undefined reference to Serial1

ld.exe: test.cpp.o: in function setup
test.ino: (.text.setup+0x54): undefined reference to Serial1

ld.exe: test.cpp.o: in function vTest2(void*)
test.ino: (.text._ZL6vTest2Pv+0x3c): undefined reference to Serial1

collect2.exe*: error: ld returned 1 exit status


And when I use ‘Serial’,it doesn't display any data.
Back to top
 

Please Register or Login to the Forum to see File Attachments
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline



Posts: 1014
Re: Confused by ‘Serial1’
Reply #1 - Jul 5th, 2021 at 5:52pm
 
Thanks for the report.

Can you attach the full build output with the vMicro > Compiler > Verbose, and Show Build Properties options Enabled?
Back to top
 
 
IP Logged
 
sstm..
Newbies
*
Offline



Posts: 7
Re: Confused by ‘Serial1’
Reply #2 - Jul 6th, 2021 at 3:34pm
 
Here is the output.
Back to top
 

Please Register or Login to the Forum to see File Attachments
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline



Posts: 1014
Re: Confused by ‘Serial1’
Reply #3 - Jul 6th, 2021 at 4:21pm
 
Thanks for the log detail.

Note - This also happens when trying a simple sketch in the Arduino IDE, so believe this board/configuration does not have the Serial1 object available.

Both Serial and Serial2 work for this setup, and believe this is linked to the different Serial port mappings happening in the background in the STM Cores and setup.
https://github.com/stm32duino/wiki/wiki/API#hardwareserial

The example in the above link implies this has to be declared in the sketch, or the build options changed to force it to be automatically mapped.
Back to top
 
 
IP Logged
 
sstm..
Newbies
*
Offline



Posts: 7
Re: Confused by ‘Serial1’
Reply #4 - Jul 6th, 2021 at 6:38pm
 
It's running! I'm very grateful for your timely help. Smiley
Back to top
 
 
IP Logged
 
sstm..
Newbies
*
Offline



Posts: 7
Re: Confused by ‘Serial1’
Reply #5 - Jul 6th, 2021 at 7:16pm
 
Another question need help.When I use the 'Serial1',it can not print Chinese Characters.
But when I use 'Serial' in the Arduino IDE ,it works.(another project https://github.com/rogerclarkmelbourne/Arduino_STM32)
Back to top
 
 
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print