NeoSWSerial - multiple definition of `__vector_3'

HI
when I try this small sketch its working fine

#include "UART.h" //моя библиотека HardwareSerial которая наследует nStream.h которая наследует nPrint.h
//внутри происходит UART serial;
#define USE_LOG
 
#ifdef USE_LOG
#include "NeoSWSerial.h" //штатная HardwareSerial, которая наследует Stream.h которая наследует Print.h 
#endif
 
#ifdef USE_LOG
NeoSWSerial terminal(6, 7); //receivePin, transmitPin
#endif
 
void setup() {
  serial.begin(9600);             //57600 is max for SIM800
#ifdef USE_LOG
  terminal.begin(9600);
#endif
  serial << F("serial");
  terminal.print(F("terminal"));
}
 
void loop() {
  while ( serial.available() ) {
    terminal.write( serial.read() );
  }
  while ( terminal.available() ) {
    serial.write( terminal.read() );
  }
}
 
void flag_blinking() {
}

when I add many other code - but w/o changing library, pins for rx/tx, etc - then I get error

"C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-gcc" -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega328p -o "C:\\Users\\A\\AppData\\Local\\Temp\\arduino_build_188816/NeoSW.ino.elf" "C:\\Users\\A\\AppData\\Local\\Temp\\arduino_build_188816\\sketch\\NeoSW.ino.cpp.o" "C:\\Users\\A\\AppData\\Local\\Temp\\arduino_build_188816\\libraries\\NeoSWSerial\\NeoSWSerial.cpp.o" "C:\\Users\\A\\AppData\\Local\\Temp\\arduino_build_188816/..\\arduino_cache_692159\\core\\core_arduino_avr_uno_0c812875ac70eb4a9b385d8fb077f54c.a" "-LC:\\Users\\A\\AppData\\Local\\Temp\\arduino_build_188816" -lm
C:\Users\A\AppData\Local\Temp\arduino_build_188816\libraries\NeoSWSerial\NeoSWSerial.cpp.o (symbol from plugin): In function `NeoSWSerial::read()':
(.text+0x0): multiple definition of `__vector_3'
C:\Users\A\AppData\Local\Temp\arduino_build_188816\sketch\NeoSW.ino.cpp.o (symbol from plugin):(.text+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
Using library NeoSWSerial at version 3.0.5 in folder: C:\Users\A\Documents\Arduino\libraries\NeoSWSerial 
exit status 1

I cannot understand why and whats wrong with NeoSWSerial::read() ?

I have in my sketch INT on pins 2,3
I have also PCINT on pins 12,13,14,15
could this error be because Im using these INT?

I have tried another pins 18/19, 23/24, 27/28 the same error

Errors to do with vectors are usually associated with 2 libraries, attempting to use the same interrupt vector which would seem to be the case here

multiple definition of `__vector_3'

UART uses standard 0/1 pins
NeoSWSerial 6/7
INT 2/3
PCINT 8-11

so PD6 PD7 should be empty and I dont know what the vector is used for that... please advise how to determine where is the conflict

Was that the full error message that you posted or only part of it ?

its full

It looks like you are using a Mega. If so, why use NeoSWSerial when the Mega has 4 hardware UARTs ?

no its uno/nano

So how come you used pins 23/24, 27/28 ?

my mistake this pin number of microcontroller

Most likely, NeoSWSerial and PCINT are trying to use the same interrupt vector. You can't do that, so check the library code and make sure not to use the same port for both.

it impossible , as I said before I triedn different pins, error the same
pcint0 PCINT7..0 pin Im using this one
but
pcint1 PCINT14..8 pin 14-19 pins are empty
pcint2 PCINT23..16 pin , Im using these pins but not as pcint so shouldnt be conflict either

Explain that to the compiler.

The error message is perfectly clear: two different segments of your code are trying to claim interrupt vector 3: PCINT0.

Arguing with forum members is not going to get you anywhere.

it says - multiple definition of `__vector_3' :slight_smile: is not mentioned pcint0

I tried pcint1 , im not using 14-19 pins at all, but the same error :frowning:

In other words, you could not even be bothered to look up the definition of __vector_3.

By the way, post the code that is actually causing the problem.

For further posting instructions, please read and follow the instructions in the "How to get the best out of this forum" post.

according to datasheet
3 0x0004 INT1 External interrupt request 1
and not pcint 0 as you said
but Im not using int1 in NeoSW
so this is not the source of the problem
as I said before , Im not using 14-19 pins at all, and tried they for NeoSW but the same error

You still haven't posted the code that actually causes the problem.

more then 2000 rows...

I've put you on my ignore list. Have fun!