This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MCU-PLUS-SDK-AM243X: UART Rx channel receiving strange data when ethernet is enabled in SDK version 08.03.

Part Number: MCU-PLUS-SDK-AM243X

Hello community members,

I have a small application which is based on SDK version 08.03 (upgraded from v08.02.), which has enabled UART0 in callback mode (based on the callback mode example) and I am using ethernet based on the LwIP example. The implementation is based on FreeRTOS mode and I only initially create the task for UART, and after receiving a particular command over the serial, then ethernet task is initialized which further initializes the LwIP stack.

In the previous version 08.02 this worked fine, but after upgrading the SDK version to 08.03, I started receiving strange data on the Rx channel, while the Tx seems to work fine because I am receiving the welcome string correctly. So to make things clear, I have only updated the syscfg to align with the newest LwIP example, as well as updated the linker.cmd settings which now have a bit of ethernet related configuration.

After removing all of the ethernet related code and syscfg, the strange data disappears.

After sending string: 'dabc' the RX buffer is filled up with: 'd?a?b?c?'. (? is a placeholder for the strange data)

What might cause this 'collision'?

I am attaching the pictures of the current syscfg for both UART and ENET.

Thank you in advance,

Mladen.

  • Hi Mladen,

    Please let us know whether you are using AM243x LP or EVM.

    I believe issue can mostly because of pin mux conflict between UART and Ethernet (same pin mapped to both UART and CPSW). 

    Have you checked that?

    Also, you mentioned about this working earlier on 8.2. Can you please elaborate? Was UART + Ethernet example working with 8.2 which got broken after moving to 8.3?

    Regards,

    Prasad

  • Hello Prasad,

    I am using the AM243x LP board.

    I haven't checked the pinmux and I will do so now.

    Yes, in 8.2 it was working fine and I did the update to version 8.3. I had to do some changes in the ethernet code itself because some things changed in the newest version.

    Aside from changing the ethernet code a bit and adding a few new files to be able to compile with the newest version, I haven't changed anything additionally, especially the UART part.

    The strange thing is, I used the fresh uart callback example and combined it with the ENET LwIP example and it is working fine.

  • The strange thing is, I used the fresh uart callback example and combined it with the ENET LwIP example and it is working fine.

    Can you please do comparison of pin mux between working and non-working set up. Mostly likely some pin was wrongly configured by mistake.

    Anyway, glad that you have working set up. 

  • Hi Prasad,

    So I have compared the pinmux and there is practically no difference between the working model and my setup. So for upgrading the actual SDK version I have included the test_enet_icssg.c file, and also I have adapted a bit the test_enet.c file because it differs slightly from the one from the previous SDK version. It might be useful to note that my project is actually C++, so I have adapted the ethernet files to be .cpp with slight code readjustments. Currently I have disabled external phy management since it is not something that I need, for now, at least. 

    Now the interesting thing is, that I have noticed, in my non working model, that when I comment out the line where the main_loop(NULL) is called in test_enet.cpp, then everything works as expected, but when this line is not present, then I have no issues. The interesting thing is that this line actually doesn't get called at all on the moment that I am trying out the UART commands. I am attaching the photos here so you can see.

    The print which is seen in the pictures is just printing out the 'trans.buf' receive buffer for the uart.

  • Hi Mladen,

    This issue is very strange. Can we have debug session with CCS connected to debug this issue using debug build. Cant figure out why commenting out main_loop() would alter behavior. Commenting out will change memory map but the issue is not just memory corruption. Valid character are received interleaved with some random characters. Need to check how you are printing the characters received from UART (printf %c ?) and if you are using DMA for UART.

    Regards,

    Prasad

  • Hi Prasad, we can organize a debug session, that sounds great. To answer your question, I am not using DMA for UART, my code is based on the UART callback example. I am printing the output with:

    DebugP_log("%s", trans.buf);

  • Also to note, I have an EVM as well, and after porting from LP to EVM, I tried to retrace my steps and the outcome is the same. Either I am making some crucial mistake or it's something so minor or not directly relevant that I am not seeing it.

  • Hi Mladen,

    I have sent you direct message for aligning on debug call. Let's do debug call to root cause. 

    Regards,

    Prasad 

  • We had a debug session and the issue was internal with handling the input buffer of the uart handler. Thank you very much Prasad for helping me.