Compiling SM_Teensy with Arduino 1.8.7 and Teensyduino 1.44


Bob NW8L
 

Hello,

I built a TNC-Pi9K6 kit and tried to compile SM_Teensy in the TeensyProjects download from www.tnc-x.com but ran into a linker error:

C:\Users\bobc\Documents\Arduino\TeensyProjects\libraries\TeensyConfig/TeensySound.c:118: undefined reference to `ProcessNewSamples'

This makes sense to me because ProcessNewSamples() is called by code in the TeensySound.c file. The fix seemed obvious, to declare the ProcessNewSamples() function in the SM_Teensy sketch file as having C linkage (extern "C"), like several others there.

Using the latest source downloaded from http://www.cantab.net/users/john.wiseman/Downloads/Beta/ I must also do the same for AddTrailer(), displayDCD(), StopCapture() and StartCapture() which appear in the sketch file in that version.

Presumably the released code should work without modification, but I'm unfamiliar with the Arduino build system and wonder if there's something I'm missing. Yes, I am using the boards.txt and platform.txt files included with the Teensy projects.

Has anyone else run into this? 

Bob NW8L


John G8BPQ
 

Bob,

I've just downloaded both the copies from the tnc-x site and my beta downloads and both complied ok. If you downloaded my version before this morning try downloading again - there were some problems with the previous version.

73, John G8BPQ
 


On 13/10/2018 22:02, Bob NW8L wrote:
Hello,

I built a TNC-Pi9K6 kit and tried to compile SM_Teensy in the TeensyProjects download from www.tnc-x.com but ran into a linker error:

C:\Users\bobc\Documents\Arduino\TeensyProjects\libraries\TeensyConfig/TeensySound.c:118: undefined reference to `ProcessNewSamples'

This makes sense to me because ProcessNewSamples() is called by code in the TeensySound.c file. The fix seemed obvious, to declare the ProcessNewSamples() function in the SM_Teensy sketch file as having C linkage (extern "C"), like several others there.

Using the latest source downloaded from http://www.cantab.net/users/john.wiseman/Downloads/Beta/ I must also do the same for AddTrailer(), displayDCD(), StopCapture() and StartCapture() which appear in the sketch file in that version.

Presumably the released code should work without modification, but I'm unfamiliar with the Arduino build system and wonder if there's something I'm missing. Yes, I am using the boards.txt and platform.txt files included with the Teensy projects.

Has anyone else run into this? 

Bob NW8L


Bob NW8L
 

Yes, just today I downloaded your beta TeensyProjects file dated 2018-10-13 09:53.
What version of Arduino and Teensyduino are you using? Maybe that matters...

Bob NW8L



August Johnson KG7BZ
 

Bob, I had the exact same error when I tried to compile the source from tnc-x.com. A friend ended up compiling it for me and had no problem. He had an older version of Arduino, I'm using 1.8.7 and Teensyduino 1.44. Now that I see this, I may try an older version and see if it works for me.

D:\Users\KG7BZ\Documents\Arduino\TeensyProjects\libraries\TeensyConfig/TeensySound.c:118: undefined reference to `ProcessNewSamples'

August KG7BZ


On Sat, Oct 13, 2018 at 4:19 PM Bob NW8L <nw8l@...> wrote:
Yes, just today I downloaded your beta TeensyProjects file dated 2018-10-13 09:53.
What version of Arduino and Teensyduino are you using? Maybe that matters...

Bob NW8L



John G8BPQ
 

I'm running Arduino 1.8.1 and TeensyDuino 1.35. I'll install the latest and see what happens.

73, John

On 14/10/2018 00:16, Bob NW8L wrote:
Yes, just today I downloaded your beta TeensyProjects file dated 2018-10-13 09:53.
What version of Arduino and Teensyduino are you using? Maybe that matters...

Bob NW8L




John G8BPQ
 

I've Installed Arduino 1.8.7 and TeensyDuino 1.44 and am seeing the same problem.

To compile the code from tnc-x site  remove line 749 (containing }) and add a line containing just } at the end of the sketch.

I've uploaded a new version of TeensyProjects to my beta site. I've updated platform.txt and boards.txt  to match the new Arduino version. The platform.txt and boards.txt in the tnc-x  download work with the new versions but don't support some of the new features of the new complier versions.

The soundcard emulation sketches won't work with the new compiler. I'll fix that as soon as I have time.

73, John

On 14/10/2018 08:31, John Wiseman wrote:
I'm running Arduino 1.8.1 and TeensyDuino 1.35. I'll install the latest and see what happens.

73, John

On 14/10/2018 00:16, Bob NW8L wrote:
Yes, just today I downloaded your beta TeensyProjects file dated 2018-10-13 09:53.
What version of Arduino and Teensyduino are you using? Maybe that matters...

Bob NW8L





August Johnson KG7BZ
 

The version I downloaded from tnc-x contains only 555 lines. Did you mean line 549? It compiles when I remove that line and insert the } at the end of the sketch.

August KG7BZ

Arduino.jpg

On Sun, Oct 14, 2018 at 2:31 AM John Wiseman <john.wiseman@...> wrote:
I've Installed Arduino 1.8.7 and TeensyDuino 1.44 and am seeing the same problem.

To compile the code from tnc-x site  remove line 749 (containing }) and add a line containing just } at the end of the sketch.

I've uploaded a new version of TeensyProjects to my beta site. I've updated platform.txt and boards.txt  to match the new Arduino version. The platform.txt and boards.txt in the tnc-x  download work with the new versions but don't support some of the new features of the new complier versions.

The soundcard emulation sketches won't work with the new compiler. I'll fix that as soon as I have time.

73, John



Bob NW8L
 

I downloaded the new TeensyProjects archive and verified that SM_Teensy compiles out of the box now.

However, I noticed that the same fix wasn't applied to ARDOP_Teensy and ARDOP2_Teensy. So, when you say "The soundcard emulation sketches won't work with the new compiler." are ARDOP_Teensy and ARDOP2 included in that group? They compile here if I modify the sketch file to declare functions extern "C" as needed but haven't tested them yet.

Which brings me to my next question. Try as I might, I don't see an example of the PORT definition in bpq32.cfg for the ARDOP Teensy TNCs anywhere in the BPQ docs or by searching the web (or searching this email group). DRIVER=ARDOP and TYPE=SCS? If someone can point me in the right direction I'd appreciate it.

Bob NW8L


John G8BPQ
 

Yes, sorry. A typo! Should have been 549.

73, John

On 14/10/2018 19:58, August Johnson wrote:
The version I downloaded from tnc-x contains only 555 lines. Did you mean line 549? It compiles when I remove that line and insert the } at the end of the sketch.

August KG7BZ

Arduino.jpg

On Sun, Oct 14, 2018 at 2:31 AM John Wiseman <john.wiseman@...> wrote:
I've Installed Arduino 1.8.7 and TeensyDuino 1.44 and am seeing the same problem.

To compile the code from tnc-x site  remove line 749 (containing }) and add a line containing just } at the end of the sketch.

I've uploaded a new version of TeensyProjects to my beta site. I've updated platform.txt and boards.txt  to match the new Arduino version. The platform.txt and boards.txt in the tnc-x  download work with the new versions but don't support some of the new features of the new complier versions.

The soundcard emulation sketches won't work with the new compiler. I'll fix that as soon as I have time.

73, John




John G8BPQ
 

ARDOP and ARDOP2 are Ok. It is the SoundCard.ino and SoundCardpkt.ino sketches that won't compile. They let the TNC emulate a sound card interface a bit like a Signalink.

My Linbpq ARDOP port definition is

PORT
 ID=ARDOP Serial
 DRIVER=ARDOP
 CONFIG
  SERIAL /dev/serial0 115200
  LOGDIR /dev/shm
  CONSOLELOG 7
  DATETIME
  DEBUGLOG TRUE
  CMDTRACE True
  CWID FALSE
;  BUSYLOCK False
  DRIVELEVEL 100
  BUSYWAIT 20
  GRIDSQUARE IO68VL
  MAXCONREQ 5
  FECREPEATS 0
  ARQBW 2500
  RXLEVEL 0
  TXLEVEL 100
ENDPORT

73,
John

On 14/10/2018 20:46, Bob NW8L wrote:
I downloaded the new TeensyProjects archive and verified that SM_Teensy compiles out of the box now.

However, I noticed that the same fix wasn't applied to ARDOP_Teensy and ARDOP2_Teensy. So, when you say "The soundcard emulation sketches won't work with the new compiler." are ARDOP_Teensy and ARDOP2 included in that group? They compile here if I modify the sketch file to declare functions extern "C" as needed but haven't tested them yet.

Which brings me to my next question. Try as I might, I don't see an example of the PORT definition in bpq32.cfg for the ARDOP Teensy TNCs anywhere in the BPQ docs or by searching the web (or searching this email group). DRIVER=ARDOP and TYPE=SCS? If someone can point me in the right direction I'd appreciate it.

Bob NW8L


Bob NW8L
 

Ok, thanks for the info. I compiled ARDOP2_Teensy and programmed the tnc-pi9k6. I created a port for it using your example and pilinbpq seemed to initialize it successfully. However, attempts to attach to the ARDOP port are failing with the "TNC Not Ready" error. Nothing shows up in the ARDOP debug log in /dev/shm and there's no sign of trouble in the console output of pilinbpq, so I've got some troubleshooting to do.

I think the tnc-pi9k6 is ok, SM_Teensy seemed to work with pilinbpq in a brief check earlier today.

Bob NW8L


John G8BPQ
 

Bob,

Did you change the port settings in TeensyConfigARDOP.h to use the Pi serial port? The file I uploaded is for the config I normally  use for testing which is using i2c for host connection and the USB port for monitor/logging. To use the Pi serial port and logging via the serial port to /dev/shm ucomment HOSTPORT, set HOSTSPEED to the speed you want you use, and comment out the MONPORT definition.

73,
John

//#define HOSTPORT Serial1
#define HOSTSPEED 115200
#define SERIAL1SIZE 512

#define MONPORT Serial
//#define CPULOAD

#define CATPORT Serial5
#define CATSPEED 19200

// Shouldn't need to change anything below here

#ifndef MONPORT
#define LOGTOHOST
#endif




On 14/10/2018 22:48, Bob NW8L wrote:
Ok, thanks for the info. I compiled ARDOP2_Teensy and programmed the tnc-pi9k6. I created a port for it using your example and pilinbpq seemed to initialize it successfully. However, attempts to attach to the ARDOP port are failing with the "TNC Not Ready" error. Nothing shows up in the ARDOP debug log in /dev/shm and there's no sign of trouble in the console output of pilinbpq, so I've got some troubleshooting to do.

I think the tnc-pi9k6 is ok, SM_Teensy seemed to work with pilinbpq in a brief check earlier today.

Bob NW8L


Bob NW8L
 

No, I didn't know about that. I made the changes:

#define HOSTPORT Serial1
#define HOSTSPEED 115200
#define SERIAL1SIZE 512
 
//#define MONPORT Serial
//#define CPULOAD

but still no joy. Where is PROJECT_ARDOP2_Teensy #defined, so that ARDOP is #defined in TeensyConfig.h? I grepped the whole tree and couldn't find it, so I #defined it at the top of ARDOP2_Teensy.ino but that didn't change anything either. Perhaps that symbol is an intrinsic defined by the Arduino build system?

If I could get a known good pre-compiled binary built on Arduino 1.8.7/Teensyduino 1.44 I could use it to eliminate the possibility that the hardware is somehow to blame.

Anyway, I'm off to the office now,

Bob NW8L


John G8BPQ
 

PROJECT_ARDOP2_Teensy is defined by the build environment. The changes I made to platform.txt pass the project name to the compiler as a predefined symbol.

Did you change the speed in the LinBPQ port config to 115200?

I've uploaded a new TeensyProjects that fixes the issues with ARDOP and ARDOP2, but you've got passed that stage yourself.

I'm going to be out this evening then away for a few days, but when I get the chance I'll build a binary version.

73,
John


On 15/10/2018 16:49, Bob NW8L wrote:
No, I didn't know about that. I made the changes:

#define HOSTPORT Serial1
#define HOSTSPEED 115200
#define SERIAL1SIZE 512
 
//#define MONPORT Serial
//#define CPULOAD

but still no joy. Where is PROJECT_ARDOP2_Teensy #defined, so that ARDOP is #defined in TeensyConfig.h? I grepped the whole tree and couldn't find it, so I #defined it at the top of ARDOP2_Teensy.ino but that didn't change anything either. Perhaps that symbol is an intrinsic defined by the Arduino build system?

If I could get a known good pre-compiled binary built on Arduino 1.8.7/Teensyduino 1.44 I could use it to eliminate the possibility that the hardware is somehow to blame.

Anyway, I'm off to the office now,

Bob NW8L


Bob NW8L
 

Ok, I'll have to study platform.txt and learn more about the Arduino build system in general. I'm an old school makefile/GNU autotools guy so this is new to me.

Yes, the serial speed for the ARDOP port is set to 115200 in bpq32.cfg.

There's no rush, I'll keep plugging away at it as time permits.

Bob NW8L


John G8BPQ
 

I've uploaded a compiled binary for ARDOP2 built on Arduino 1.8.7/Teensyduino 1.44 to

http://www.cantab.net/users/john.wiseman/Downloads/Beta/ARDOP2_Teensy.ino.TEENSY36.hex

This is configured with

#define HOSTPORT Serial1
#define HOSTSPEED 115200
#define SERIAL1SIZE 512

//#define MONPORT Serial

I tested it with LinBPQ on my PiZeroW with port config

PORT
 ID=ARDOP Serial
 DRIVER=ARDOP
 CONFIG
  SERIAL /dev/serial0 115200
  LOGDIR /dev/shm
  CONSOLELOG 7
  DATETIME
  DEBUGLOG TRUE
  CMDTRACE True
  CWID FALSE
;  BUSYLOCK False
  DRIVELEVEL 100
  BUSYWAIT 20
  GRIDSQUARE IO68VL
  MAXCONREQ 5
  FECREPEATS 0
  ARQBW 2500
  RXLEVEL 2000
  TXLEVEL 100
ENDPORT

73, John


On 15/10/2018 16:49, Bob NW8L wrote:
No, I didn't know about that. I made the changes:

#define HOSTPORT Serial1
#define HOSTSPEED 115200
#define SERIAL1SIZE 512
 
//#define MONPORT Serial
//#define CPULOAD

but still no joy. Where is PROJECT_ARDOP2_Teensy #defined, so that ARDOP is #defined in TeensyConfig.h? I grepped the whole tree and couldn't find it, so I #defined it at the top of ARDOP2_Teensy.ino but that didn't change anything either. Perhaps that symbol is an intrinsic defined by the Arduino build system?

If I could get a known good pre-compiled binary built on Arduino 1.8.7/Teensyduino 1.44 I could use it to eliminate the possibility that the hardware is somehow to blame.

Anyway, I'm off to the office now,

Bob NW8L


Bob NW8L
 

John,

I downloaded and installed the binary and it works. For some reason the binary I'm compiling here doesn't work, but I'll keep trying. However, I've got what I really need, a working ARDOP2 TNC, so all is well.

Thanks,
Bob NW8L


Bob NW8L
 

John,

In the new TeensyProjects.zip archive you uploaded, ARDOP_Teensy has the expected fixes and builds ok, but that's not true for ARDOP2_Teensy. That seems unchanged; I had to add the extern "C" wrappers around _gettimeofday() and pktProcessNewSamples() in the sketch file so it compiles, just as before.

Is the project file tree in TeensyProjects.zip an exact copy of the one you are building from locally? I'm puzzled by the fact that your binary runs ok, but not one built here with the same Arduino toolchain.

In the Tools menu, my CPU speed setting is 180 MHz, and the optimization setting is "Faster". Are these different from yours?

73,
Bob NW8L


John G8BPQ
 

Bob,

I was sure I'd made the extern "C" changes to all the ARDOP versions, but for some reason the changes for ARDOP2 were missing from both my local copy and the uploaded copy. It is possible the edits I made weren't saved. Anyway, I had to reapply the changes before building it last night. Yes, I'm set for 180 MHz and Faster.  I've just downloaded my latest upload and compared with my local copy and they are the same apart from the extern "C" changes I made.

Are you building on Window or Linux? I use Windows and I guess it is possible there is some difference in the two versions of the build tools.

73,
John



On 16/10/2018 07:30, Bob NW8L wrote:
John,

In the new TeensyProjects.zip archive you uploaded, ARDOP_Teensy has the expected fixes and builds ok, but that's not true for ARDOP2_Teensy. That seems unchanged; I had to add the extern "C" wrappers around _gettimeofday() and pktProcessNewSamples() in the sketch file so it compiles, just as before.

Is the project file tree in TeensyProjects.zip an exact copy of the one you are building from locally? I'm puzzled by the fact that your binary runs ok, but not one built here with the same Arduino toolchain.

In the Tools menu, my CPU speed setting is 180 MHz, and the optimization setting is "Faster". Are these different from yours?

73,
Bob NW8L


Bob NW8L
 

John,

I'm building on Windows 10. 

There's one more thing I'll try: swapping out the SD card in the Pi to revert to my old Jessie Raspbian image.
Are you running Raspbian Jessie or Stretch? Or something else?

Thanks,

Bob NW8L