energia / msp432r-core

MSP432 EMT core for the production silicon (RED LaunchPad only)
2 stars 5 forks source link

Serial printing issues. #18

Open fcooper opened 5 years ago

fcooper commented 5 years ago

I am having issues getting basic serial print usage working.

OS: Windows 10 64bit IDE Version: Energia 1.8.7E21 Board: MSP_EXP432E401Y Core: MSP432 EMT Red v5.23.1

When uploading the below code serial monitor outputs garbage text. However, doing a soft reset (hitting reset button) fixes this issue. This code results in garbage text output:

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly: 
  Serial.println("hey");
}

image

Root cause is likely the same but this code doesn't generate any output when you upload it. Doing a soft reset output text but its garbage text.

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  Serial.print("hey");
}

void loop() {
  // put your main code here, to run repeatedly: 

}

image

Sometimes a delay fixes some of these issues. But with the below example it outputs text but its still has some garbage included.

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  delay(10000);
  Serial.print("hey");
}

void loop() {
  // put your main code here, to run repeatedly: 

}

image

robertinant commented 5 years ago

I have just verified that this is a XDS110 emulator issue. The issue has been reported to the Engineering team that maintains the XDS110.

fcooper commented 5 years ago

It looks this problem is due to a silicon UART issue documented in the MSP432P401 errata. http://www.ti.com/lit/er/slaz610r/slaz610r.pdf Errata: USCI46

robertinant commented 5 years ago

I think the errata is about receiving and not transmitting. "UART may receive the first byte incorrectly".

fcooper commented 5 years ago

Your right. So do we know what the problem is?

robertinant commented 4 years ago

This is a XDS110 issue that is being worked on by TI. Will keep this open to update when a fix is available in the XDS110 firmware.

fcooper commented 4 years ago

So it seems like the root cause has been identified.

The corrupted characters are due to the debugger not fully configuring its uart before taking the MSP432 out of reset. Therefore, MSP432 can output characters to the debugger's uart before its ready.

The issue with no UART output is due to the debugger UART buffer becoming full before its able to clear it out by sending it to the PC. The current firmware just didn't try outputting anything once this happen.

Still waiting to incorporate the new debugger firmware into Energia.