Send raw ethernet packets with imxrt1064

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

Send raw ethernet packets with imxrt1064

Jump to solution
1,191 Views
Davidino
Contributor IV

Goodmorning,

I'm using imxrt1064-evk demo board and SDK version 2.9.1. I'm using optimize most (-O3) and linktime optimization flag enabled since we need the maximum performance.

Our main objective consists of sending raw ethernet frames. In order to do that, at first I tested the LWIP tcp raw echo example from the SDK and it worked perfectly. Then, reading lwip code, I didn't find any ready to use functions to send raw packets, hence I wrote some code on my own for this purpose.

When I try my custom functions, I get the error:

 

Thread #1 1 (Suspended : Signal : SIGHUP:Hangup)
HardFault_Handler() at 0x7000af40
<signal handler called>() at 0xffffffe9 

 

But, if I untick the linktime optimization flag, the error doesn't happens and the code that I wrote, works.

I've got two questions:

  1. Why does the error happen only with optimization flag enabled?
  2. Is it correct to state that lwip doens't provide the possibility to send raw frames?

Thank you in advance.

Regards,

Davidino

0 Kudos
1 Solution
1,136 Views
Davidino
Contributor IV

Hello to all,

I resolved the problem increasing RAM Stack space as I noticed that variables were created at an illegal space address.

Thank you,

Davidino

View solution in original post

3 Replies
1,179 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi @Davidino 

Can you share your custom code here for me to reproduce your issue on my side?  or send it to me via a support ticket .

 

Regards

Daniel

0 Kudos
1,174 Views
Davidino
Contributor IV

Hello @danielchen ,

thank you for your answer. I'll open a ticket stating that I need you to analyze the problem, but please read the following points:

  1. I cannot pass you the whole project as it's very big and could be confusing to analyze, I'll give you the code for creating raw sockets and how I initialize, send data and receive. Besides the code is very similar to enet_ethernetif_kinetis.c and enet_ethernetif.c
  2. As per my test, the problem happens when I receive data. If I comment out the receiving part it doesn't happen.
  3. On my desk I'm using a device that mirrors the data that I send, that's how I receive raw packets.

Thank you.

Regards,

Davidino

0 Kudos
1,137 Views
Davidino
Contributor IV

Hello to all,

I resolved the problem increasing RAM Stack space as I noticed that variables were created at an illegal space address.

Thank you,

Davidino