Trouble declaring hardware serial... And Serial3 not declared in this scope

Post here all questions related to LibMaple core if you can't find a relevant section!
stevestrong
Posts: 502
Joined: Fri Dec 27, 2019 4:53 pm
Answers: 8
Location: Munich, Germany
Contact:

Re: Trouble declaring hardware serial... And Serial3 not declared in this scope

Post by stevestrong »

You just have to use defines like this:

Code: Select all

#define audioSerial Serial3
Serial1,2,3 are already defined with default pins in the core.
User avatar
Mangy_Dog
Posts: 92
Joined: Sat May 02, 2020 11:45 pm
Answers: 1

Re: Trouble declaring hardware serial... And Serial3 not declared in this scope

Post by Mangy_Dog »

Thats what i was doing, till serial3 stopped working... I just felt if i could redefind the hardware for serial 3 if it came back id be able to fix it
Just a dogs body developer, mostly making props and stuff...
stevestrong
Posts: 502
Joined: Fri Dec 27, 2019 4:53 pm
Answers: 8
Location: Munich, Germany
Contact:

Re: Trouble declaring hardware serial... And Serial3 not declared in this scope

Post by stevestrong »

But now Serial3 is working, isn't it?

Btw, the correct declaration would be:

Code: Select all

HardwareSerial my_serial_name(USART3, BOARD_USART3_TX_PIN, BOARD_USART3_RX_PIN);
see here and here.
So your declaration

Code: Select all

HardwareSerial audioSerial(USART3,PB11,PB10);
should work.
User avatar
Mangy_Dog
Posts: 92
Joined: Sat May 02, 2020 11:45 pm
Answers: 1

Re: Trouble declaring hardware serial... And Serial3 not declared in this scope

Post by Mangy_Dog »

Yeah thats whats been confusing....
HardwareSerial audioSerial(USART3,PB11,PB10);
Doesnt work.
Just a dogs body developer, mostly making props and stuff...
stevestrong
Posts: 502
Joined: Fri Dec 27, 2019 4:53 pm
Answers: 8
Location: Munich, Germany
Contact:

Re: Trouble declaring hardware serial... And Serial3 not declared in this scope

Post by stevestrong »

And what exactly means "doesn't work"?
User avatar
Mangy_Dog
Posts: 92
Joined: Sat May 02, 2020 11:45 pm
Answers: 1

Re: Trouble declaring hardware serial... And Serial3 not declared in this scope

Post by Mangy_Dog »

USART3 was not declared in this scope. is one error it gets
Just a dogs body developer, mostly making props and stuff...
stevestrong
Posts: 502
Joined: Fri Dec 27, 2019 4:53 pm
Answers: 8
Location: Munich, Germany
Contact:

Re: Trouble declaring hardware serial... And Serial3 not declared in this scope

Post by stevestrong »

It looks like some include was missing indeed, I just fixed in Roger's repo, see https://github.com/rogerclarkmelbourne/ ... f3c60f7674.
Last edited by stevestrong on Sun Oct 18, 2020 10:42 pm, edited 1 time in total.
User avatar
Mangy_Dog
Posts: 92
Joined: Sat May 02, 2020 11:45 pm
Answers: 1

Re: Trouble declaring hardware serial... And Serial3 not declared in this scope

Post by Mangy_Dog »

Haha that fixed the hardware serial defining :)
Thank you

ive still not figured out what actually broke the serial3 in the first place. I redid all the changes to the freshly downloaded rogerscore. And still worked...

Sooo strange.
Just a dogs body developer, mostly making props and stuff...
Post Reply

Return to “General discussion”