MIMXRT1020 ENET "PHY Auto-negotiation failed"

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

MIMXRT1020 ENET "PHY Auto-negotiation failed"

Jump to solution
1,665 Views
riccardo_carlot
Contributor III

Hi to everybody,

I'm approaching to the MIMXRT1020 for the first time. 

I'm testing the ENET functionalities but something is not working. 

I started from both "evkmimxrt1020_enet_txrx_transfer" and "evkmimxrt1020_cmsis_enet_txrx_transfer", I flashed both in the EVK and they works properly. Then I loaded the two examples in my  custom board, and they works too.

The problem borns when I try to recycle the example code inside my application, in my custom board.

I copied all the code from the evk-example inside my main() function (I literally copyed and pasted the enet_txrx_transfer.c file inside my project). The code is exactly the same, no errors, no warnings, but when I launch the application the "Auto-negotiation" fails continuously sending the message "PHY Auto-negotiation failed, please check the cable connection and link partner setting" over PRINTF.

I passed hours to compare all the .c and .h files one by one, and all the MCU settings, I dind't find any difference. I also tried to copy and paste all the files from the evk-example into my project without results.
It is not and hardware problem since the example runs correcly.

I tried to upload my project in the EVK and it give the same issue.

I think the difference should be somewhere else but I can't find the point.

Has anyone had my same problem?

Tank you for helping

0 Kudos
Reply
1 Solution
1,542 Views
RaRo
NXP TechSupport
NXP TechSupport

Hello @riccardo_carlot,

We found a couple of differences in MCUXpresso IDE v11.7.1 and MIMXRT1021 SDK v.2.13 between your project and the example in C/C++ Build - > Settings -> MCU C Compiler.

Some differences in C/C++ Build - > Settings -> MCU C Compiler that you could change are listed below:

  • Dialect. Language standard of the example is GNU C99 (-std=gnu99)
  • Preprocessor. There are missing Defined symbols (-D) like:
    • FSL_FEATURE_PHYKSZ8081_USE_RMII50M_MODE
    • MCUXPRESSO_SDK
  • Warnings. The example does not have All warnings (-Wall) check.

RaulRomero_1-1693517998430.png

[Properties -> C/C++ Build - > Settings -> MCU C Compiler]

There are other differences we noticed in the new project. Are you adding more content to the new project?

You could check more differences between the example and the new project in MCUXpresso IDE like follows:

  • First, select both projects; then, right click on them; and finally, select Compare with > Each other

RaulRomero_0-1693517905325.png

[Structure Compare between enet_txrx_transfer example and test_ENET project]

Best regards, Raul.

View solution in original post

0 Kudos
Reply
7 Replies
1,632 Views
RaRo
NXP TechSupport
NXP TechSupport

Hello @riccardo_carlot,

We noticed that there are a couple of differences between a new project and the example project that you could check and change to see if that fixes the issue:

  • Go to Properties -> C/C++ Build -> Settings -> MCU Linker -> Miscellaneous. Add the following     -no-warn-rwx-segment.

RaulRomero_0-1693259880026.png

[Properties for evkmimxrt1020_enet_txrx_transfer -> MCU Linker -> Miscellaneous]

  • Go to Properties -> C/C++ Build -> Settings -> MCU Linker -> Architecture. Change the Floating point to FPv5-D16 (Hard ABI).

RaulRomero_1-1693259880027.png

[Properties for evkmimxrt1020_enet_txrx_transfer -> MCU Linker -> Architecture]

Also, which modifications are you doing to the example? Could you please give us more details about your project?

Best regards, Raul.

0 Kudos
Reply
1,601 Views
riccardo_carlot
Contributor III

Hello @RaRo,

thank you for your interest about my problem.

I tried to change FPv5-SP-D16 (Hard ABI) to FPv5-D16 (Hard ABI), the problem continues.

Then I added the line "-no-warn-rwx-segment" in MCU Linker > Miscellaneous but when i build it returns errors:

riccardo_carlot_0-1693298887097.png

To avoid any conflinct with my application I just crated a new project based on SDK_2.13.0_MIMXRT1021, I copied the main content from the example so if you compare the files basically are the same. I attach the zip project.

I'm working on MCUXpresso IDE v11.7.1

Anything else I can think about?

Regards, Riccardo

0 Kudos
Reply
1,578 Views
RaRo
NXP TechSupport
NXP TechSupport

Hello @riccardo_carlot,

Let us look at the project. At the meantime, could you please test this behavior with the newest MCUXpresso IDE v11.8 and MIMXRT1021's SDK v2.14.0? Is the same problem happening?

Then I added the line "-no-warn-rwx-segment" in MCU Linker > Miscellaneous but when i build it returns errors:

We apologize for the misunderstanding; the differences were found in the newest MCUXpresso IDE v11.8 not in v11.7. In the version you are using, there is no difference between the projects in Miscellaneous, so it is not needed to add the line --no-warn-rwx-segment.

Best regards, Raul.

0 Kudos
Reply
1,560 Views
riccardo_carlot
Contributor III

Thank you @RaRo  for the suggestion.

Unfortunately the problem persists with the newer version of SDK and MCUXpresso too.

 

0 Kudos
Reply
1,543 Views
RaRo
NXP TechSupport
NXP TechSupport

Hello @riccardo_carlot,

We found a couple of differences in MCUXpresso IDE v11.7.1 and MIMXRT1021 SDK v.2.13 between your project and the example in C/C++ Build - > Settings -> MCU C Compiler.

Some differences in C/C++ Build - > Settings -> MCU C Compiler that you could change are listed below:

  • Dialect. Language standard of the example is GNU C99 (-std=gnu99)
  • Preprocessor. There are missing Defined symbols (-D) like:
    • FSL_FEATURE_PHYKSZ8081_USE_RMII50M_MODE
    • MCUXPRESSO_SDK
  • Warnings. The example does not have All warnings (-Wall) check.

RaulRomero_1-1693517998430.png

[Properties -> C/C++ Build - > Settings -> MCU C Compiler]

There are other differences we noticed in the new project. Are you adding more content to the new project?

You could check more differences between the example and the new project in MCUXpresso IDE like follows:

  • First, select both projects; then, right click on them; and finally, select Compare with > Each other

RaulRomero_0-1693517905325.png

[Structure Compare between enet_txrx_transfer example and test_ENET project]

Best regards, Raul.

0 Kudos
Reply
1,527 Views
riccardo_carlot
Contributor III

Good news @RaRo , finally it seems to work, I added the two definitions in MCU C Compiler > Preprocessor and the code started to run as expected. (It is not about the Dialect). Thank you a lot!!

Later I wanted to make it easier, so I put the two definitions inside my code directly:

riccardo_carlot_1-1693558961232.png

The strange behaviour is that if I let only the definitions in my code the problem continues to be, as if the two definitions weren't read by the preprocessing, but on the contary if I let both the definitions in code and in the path MCU C Compiler > Preprocessor the compiler says that the two definitions are "redefined" (in some ways the compiler sees the definitions inside the code)

riccardo_carlot_0-1693558942910.png

So, is there a difference between the definitions in the code and the those defined in the MCU C Compiler > Preprocessor path?

0 Kudos
Reply
1,461 Views
RaRo
NXP TechSupport
NXP TechSupport

Hello @riccardo_carlot,

First of all, we are glad that you have made it work.

The two Defined symbols (-D) missing are predefined macros which GCC. The C Preprocessor. Section 3.7. Predefined Macros mentions as "Object-like macros" that you could use without supplying their definitions.

In GCC The C Preprocessor. Section 1.4. The preprocessing language it mentions: "Except for expansion of predefined macros, all these operations are triggered with preprocessing directives."

This could indicate why is necessary to put the definitions in MCU C Compiler -> Preprocessor path rather than in the code.

Best regards, Raul.

0 Kudos
Reply