lpuart_edma_transfer does not echo back

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

lpuart_edma_transfer does not echo back

1,355 Views
VolcanicCheese
Contributor III

Using evkmimxrt1020_lpuart_edma_transfer example project from the NXP IDE. I am trying to echo back and forth between an arduino and the rt 1020 dev boar, a string of "some1234". The only thing that I changed about the example project is the g_tipString[] = "some1234" and UART baudrate to 9600. I am using an arduino uno as my slave. It has no problem receiving some1234, but when the arduino uno code sends back the same message. It does not trigger the callback function and echo back the 8 character of data. I made sure that I debug using qspiflash by setting the SW8: 1 off 2 off 3 on 4 off and connect USB cable to j23. 

Below is my Arduino Uno code:

 

#include <SoftwareSerial.h>
SoftwareSerial mySerial = SoftwareSerial(7,8);
char val[100];
int i;
void setup() {
  // put your setup code here, to run once:
  i = 0;
  Serial.begin(115200);
  mySerial.begin(9600);
}

void loop() {
  if(mySerial.available() > 0) {
    val[i++] = mySerial.read();
  } else if(i > 7) {
    i = 0;
    for (int j = 0; j < 8; j++) {
      Serial.print(val[j]);
    }
    Serial.println();
    for (int j = 0; j < 8; j++) {
      mySerial.write(val[j]);
    }
  }
}

 

 I was wondering why the code does not seem to echo back the messaged received by the arduino. Thank you

Labels (1)
0 Kudos
Reply
4 Replies

1,337 Views
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thanks for your reply.
I'd like to suggest you use the logic analyzer to capture the UART transmit data and share it with me, as it can help me to figure it out.
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
Reply

1,317 Views
VolcanicCheese
Contributor III

I got my hands on a logic analyzer and did some testing. The Arduino Uno's TX signal with or without the logic level shifter worked as expected when seen through a logic analyzer, but when I connect it to the development board, there is no signal on the logic analyzer for the Arduino Uno's TX signal. I was wondering if it had to do with the RX pin of the Dev Board set to a high voltage (3.3V) at default when the code is running. I thought that as an input pin the voltage of the pin should be set as a low voltage. Thank you for all the help!

1,348 Views
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
Before answering your question, I'd like to confirm the below inquiries with you.
1) Did you ever modify the evkmimxrt1020_lpuart_edma_transfer example?
2) According to your statement, the evkmimxrt1020_lpuart_edma_transfer example can receive the string 'some1234', however, it doesn't send back the string to the Arduino, is my understanding right?
Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
Reply

1,344 Views
VolcanicCheese
Contributor III

The arduino successfully receives and send back the message "some1234". Also, the changes I made to the projects are the message sent during the initialization to "some1234" and the baudrate to 9600

0 Kudos
Reply