Hi,
I'm recently having an issue with my Teensy hanging in what appears to be the EthernetUDP constructor. I have simplified the code to the following which loads and runs fine as long as the declaration is left commented out. If I declare the Udp variable it hangs and doesn't connect COM3 or get to the point of starting Serial Monitor. I had been using a program successfully receiving UDP packets for several weeks and only ran into this issue this week when I wanted to make a couple changes.
#include <NativeEthernet.h>
#include <NativeEthernetUdp.h>
// MAC address and IP address for the Teensy board.
byte mac[] = { 0x04, 0xE9, 0xE5, 0x0D, 0x31, 0x2B };
bool useDHCP = false;
IPAddress ip(192, 168, 0, 5);
unsigned int localPort = 8888; // local port to listen on
// An EthernetUDP instance to let us send and receive packets over UDP
EthernetUDP Udp;
int led = 8;
// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(led, OUTPUT);
pinMode(13, OUTPUT);
// Open serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial)
{
; // wait for serial port to connect. Needed for native USB port only
delay(10);
}
Serial.println("Serial Connection complete");
}
void loop() {
digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level)
digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
delay(100); // wait for a second
digitalWrite(13, LOW); // turn the LED on (HIGH is the voltage level)
digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
delay(100); // wait for a second
Serial.println("Serial looping");
}
The compiler produces the following output:
Warning: Board teensy:avr:teensy32 doesn't define a 'build.board' preference. Auto-set to: AVR_TEENSY32
Memory Usage on Teensy 4.1:
FLASH: code:195788, data:72960, headers:8748 free for files:7848968
RAM1: variables:23840, code:61384, padding:4152 free for local variables:434912
RAM2: variables:12416 free for malloc/new:511872
No Teensy boards were found on any USB ports of your computer.
Please press the PROGRAM MODE BUTTON on your Teensy to upload your sketch.
RUN: "C:\Program Files (x86)\Arduino\hardware\teensy\..\tools\arm\bin\\arm-none-eabi-gdb" -ex "target extended-remote \\.\COM3" "C:\Users\vandertr\AppData\Local\Temp\arduino_build_473643\MyBlink.ino.elf"
Board at COM3 is not available
I have seen a reference to the QNEthernet library but haven't tried it. I'm looking to use a very simple library since all I'm doing is receiving packets being sent.
Thanks in Advance.
I'm recently having an issue with my Teensy hanging in what appears to be the EthernetUDP constructor. I have simplified the code to the following which loads and runs fine as long as the declaration is left commented out. If I declare the Udp variable it hangs and doesn't connect COM3 or get to the point of starting Serial Monitor. I had been using a program successfully receiving UDP packets for several weeks and only ran into this issue this week when I wanted to make a couple changes.
#include <NativeEthernet.h>
#include <NativeEthernetUdp.h>
// MAC address and IP address for the Teensy board.
byte mac[] = { 0x04, 0xE9, 0xE5, 0x0D, 0x31, 0x2B };
bool useDHCP = false;
IPAddress ip(192, 168, 0, 5);
unsigned int localPort = 8888; // local port to listen on
// An EthernetUDP instance to let us send and receive packets over UDP
EthernetUDP Udp;
int led = 8;
// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(led, OUTPUT);
pinMode(13, OUTPUT);
// Open serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial)
{
; // wait for serial port to connect. Needed for native USB port only
delay(10);
}
Serial.println("Serial Connection complete");
}
void loop() {
digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level)
digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
delay(100); // wait for a second
digitalWrite(13, LOW); // turn the LED on (HIGH is the voltage level)
digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
delay(100); // wait for a second
Serial.println("Serial looping");
}
The compiler produces the following output:
Warning: Board teensy:avr:teensy32 doesn't define a 'build.board' preference. Auto-set to: AVR_TEENSY32
Memory Usage on Teensy 4.1:
FLASH: code:195788, data:72960, headers:8748 free for files:7848968
RAM1: variables:23840, code:61384, padding:4152 free for local variables:434912
RAM2: variables:12416 free for malloc/new:511872
No Teensy boards were found on any USB ports of your computer.
Please press the PROGRAM MODE BUTTON on your Teensy to upload your sketch.
RUN: "C:\Program Files (x86)\Arduino\hardware\teensy\..\tools\arm\bin\\arm-none-eabi-gdb" -ex "target extended-remote \\.\COM3" "C:\Users\vandertr\AppData\Local\Temp\arduino_build_473643\MyBlink.ino.elf"
Board at COM3 is not available
I have seen a reference to the QNEthernet library but haven't tried it. I'm looking to use a very simple library since all I'm doing is receiving packets being sent.
Thanks in Advance.