Trying to do some deeper troubleshooting. How do I get the core debug prints to work? I tried defining DEBUG_BUILD and the output function but no luck… Anyone? And by the codes here I am getting HardFault
/********************* Red Flash Codes *********************
1(Faults,RGB_COLOR_RED,HardFault)
12 (Faults,RGB_COLOR_RED,NMIFault)
3 (Faults,RGB_COLOR_RED,MemManage)
4 (Faults,RGB_COLOR_RED,BusFault)
5 (Faults,RGB_COLOR_RED,UsageFault)
6 (Cloud,RGB_COLOR_RED,InvalidLenth)
7 (System,RGB_COLOR_RED,Exit)
8 (System,RGB_COLOR_RED,OutOfHeap)
9 (System,RGB_COLOR_RED,SPIOverRun)
10 (Softare,RGB_COLOR_RED,AssertionFailure)
11 (Softare,RGB_COLOR_RED,InvalidCase)
************************************************************/
#define DEBUG_BUILD
UDP Udp;
unsigned char TxMsg[12] = { 1, 254, 1, 254, 1, 254, 43, 212, 71, 184, 3, 252 };
unsigned char recbuf[12];
bool isDebugReady = false;
void debug_output_(const char *p) {
if (isDebugReady)
Serial.print(p);
}
void setup() {
Serial.begin(9600);
pinMode(D7, OUTPUT);
digitalWrite(D7, LOW);
Udp.begin(9000);
while (!Serial.available()) {
RGB.color(0, 255, 0);
delay(100);
RGB.color(0, 0, 255);
delay(100);
RGB.color(255, 0, 0);
delay(100);
Serial.println("Send some data to continue to loop.");
};
isDebugReady = true;
}
void loop() {
int32_t packetLen = Udp.parsePacket();
//Dump any packets RX
while (packetLen > 0) {
Udp.read(recbuf, packetLen >= 12 ? 12 : packetLen);
packetLen = Udp.parsePacket();
}
//TX send our test
Udp.beginPacket(IPAddress(10,0,0,3), 9000);
Udp.write(TxMsg, 12);
Udp.endPacket();
//I am still alive
digitalWrite(D7, LOW);
delay(200);
digitalWrite(D7, HIGH);
}