Topics

GPS compile error with MKS Gen L1


Markus Kempf
 

I have connected my GPS module to RX1 on Z+, this should be Serial1 (same result for Serial2).

#define TIME_LOCATION_SOURCE GPS
#define SerialGPS Serial1

HardwareSerial1.cpp.o (symbol from plugin): In function `Serial1':
(.text+0x0): multiple definition of `__vector_36'
sketch\OnStep.ino.cpp.o (symbol from plugin):(.text+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
exit status 1
Error compiling for board Arduino Mega or Mega 2560.

Markus


Howard Dutton
 

You can't do that on a Mega2560.


Howard Dutton
 

On Mon, Jul 13, 2020 at 01:10 PM, Howard Dutton wrote:
You can't do that on a Mega2560.
Well really I lie.  You can do that it's just that you shouldn't since there is a serious performance impact.

#define MEGA2560_ARDUINO_SERIAL_ON


Howard Dutton
 

On Mon, Jul 13, 2020 at 01:09 PM, Markus Kempf wrote:
I have connected my GPS module to RX1 on Z+, this should be Serial1
... not only that but RX1/TX1 doesn't work on a MKS Gen-L since they have a capacitor/resistor tied to the line (for an end stop noise fliter.)  The S6 leaves those out thankfully.

Some users have removed the offending components to get it working though.


Markus Kempf
 

Howard,

so the compile error is intentional to avoid having configurations that do not work due to the hardware design?

Markus

PS: will try to remove the RC filter. Can I then compile for Serial1? How does that work...


Am 13/07/2020 um 22:24 schrieb Howard Dutton:

On Mon, Jul 13, 2020 at 01:09 PM, Markus Kempf wrote:
I have connected my GPS module to RX1 on Z+, this should be Serial1
... not only that but RX1/TX1 doesn't work on a MKS Gen-L since they have a capacitor/resistor tied to the line (for an end stop noise fliter.)  The S6 leaves those out thankfully.

Some users have removed the offending components to get it working though.


Howard Dutton
 

On Mon, Jul 13, 2020 at 01:15 PM, Howard Dutton wrote:
On Mon, Jul 13, 2020 at 01:10 PM, Howard Dutton wrote:
You can't do that on a Mega2560.
Well really I lie.  You can do that it's just that you shouldn't since there is a serious performance impact.

#define MEGA2560_ARDUINO_SERIAL_ON


Howard Dutton
 

I'm sure I could code around this issue, but I'm not going to since to do it properly would take serious time and effort and this is dated h/w.


Howard Dutton
 

On Mon, Jul 13, 2020 at 01:43 PM, Howard Dutton wrote:
I'm sure I could code around this issue, but I'm not going to since to do it properly would take serious time and effort and this is dated h/w.
Ok... went and thought about this for a moment and I changed my mind, there really is no problem and it should work.

Until recently it could perhaps cause timing jitter/performance issues (Mega2560) but that should no longer be the case with code improvements to GPS I recently added.  We turn on the Serial interface for just long enough to grab the data and turn it off again.  Provided Arduino handles that properly, and it's a good bet it does, this should work.

The compile error you see is a collision of the interrupt vector for my custom serial class vs. the Arduino built in class.  Turn off my built in class and no collision.

So if using Serial1 for GPS turn off SerialB, this is required anyway since you can't have a command channel tied to the GPS serial interface:

#define SERIAL_B_BAUD_DEFAULT         OFF //   9600, n. See (src/HAL/) for your MCU Serial port # etc.                        Option


Markus Kempf
 

Howard,

thank you very much again for your restless efforts.

I have added

#define SERIAL_B_BAUD_DEFAULT         OFF

#define TIME_LOCATION_SOURCE          GPS

#define MEGA2560_ARDUINO_SERIAL_ON

#define SerialGPS Serial1

and it compiles flawlessly. I get a Last General (Background) Error: Time and Location not set but I expected this because the RC filter is still there and the reception indoors is minimal with this old module. The good news is that PPS is working with the GPS module. Without digging out my oscilloscope it's hard to say why the PPS signal of the DS3231  was good enough for the S6 but not the MKS GenL.

Markus


Am 13/07/2020 um 23:05 schrieb Howard Dutton:

On Mon, Jul 13, 2020 at 01:43 PM, Howard Dutton wrote:
I'm sure I could code around this issue, but I'm not going to since to do it properly would take serious time and effort and this is dated h/w.
Ok... went and thought about this for a moment and I changed my mind, there really is no problem and it should work.

Until recently it could perhaps cause timing jitter/performance issues (Mega2560) but that should no longer be the case with code improvements to GPS I recently added.  We turn on the Serial interface for just long enough to grab the data and turn it off again.  Provided Arduino handles that properly, and it's a good bet it does, this should work.

The compile error you see is a collision of the interrupt vector for my custom serial class vs. the Arduino built in class.  Turn off my built in class and no collision.

So if using Serial1 for GPS turn off SerialB, this is required anyway since you can't have a command channel tied to the GPS serial interface:

#define SERIAL_B_BAUD_DEFAULT         OFF //   9600, n. See (src/HAL/) for your MCU Serial port # etc.                        Option


Howard Dutton
 

Is this a 9600 baud device?  Remember there is a setting for that too.


Markus Kempf
 

should be a 9600 baud device, but will try 4800 baud to be NMEA compliant.

Markus

Am 14/07/2020 um 13:06 schrieb Howard Dutton:

Is this a 9600 baud device?  Remember there is a setting for that too.


Markus Kempf
 

added

#define SerialGPSBaud 4800

still no function. Will wait for my new module.

Markus
Am 14/07/2020 um 13:06 schrieb Howard Dutton:

Is this a 9600 baud device?  Remember there is a setting for that too.