• AVR Freaks

Hot!ATSAME54P20A Ethernet(LwIP) conflict with CAN-FD, by AtmelStudio

Author
KevinHuang
Starting Member
  • Total Posts : 39
  • Reward points : 0
  • Joined: 2019/08/29 08:13:33
  • Location: 0
  • Status: offline
2020/05/28 16:03:25 (permalink)
5 (1)

ATSAME54P20A Ethernet(LwIP) conflict with CAN-FD, by AtmelStudio

Hi exports,
 
I'm new to the ATMEL chips. Currently my project is reading CAN data, and send the data through the Ethernet, by the ATSAME54P20A chip.
I'm using the [SAM E54 Xplained Pro] EVM. The example code of the Ethernet and the CANFDDemo are working separately.
I tried to add the CANFD part to the LwIPsocketapiexample project with the [Re-configure Atmel Start Project]. After some modification, the project compiled without error.
However, I found that the CANFDDemo code can NOT work with the Ethernet task.
What I found:
LwIPsocketapiexample project, in the xTaskCreate() function, it called as:  xTaskCreate(socket_basic_ethernet, "Ethernet_basic", TASK_ETHERNETBASIC_STACK_SIZE, NULL, (TASK_ETHERNETBASIC_STACK_PRIORITY - 1), &xCreatedEthernetBasicTask).
If I remove the xTaskCreate() part, my CAN can read data correctly [CAN_0_rx_callback(***)].
With the Ethernet task xTaskCreate(*******), the CAN can't work properly:
The CAN_0_rx_callback(***) still be called, but the msg(data received by CANFD) becomes to 0(should be 64).
 
Based on my debugging, It caused by the line tcpip_init(tcpip_init_done, &sem); even if I do nothing in the functin tcpip_init();
Also, in the lwip_init(void), the memp_init() and sys_timeouts_init() will cause the same issue.
 
I need a new way to initialize the Ethernet.
I posted at atmel forum, but feels no one care about it.
Can any expert help me out? Thanks a lot ahead.
 
Regards,
Kevin
#1
KevinHuang
Starting Member
  • Total Posts : 39
  • Reward points : 0
  • Joined: 2019/08/29 08:13:33
  • Location: 0
  • Status: offline
Re: ATSAME54P20A Ethernet(LwIP) conflict with CAN-FD, by AtmelStudio 2020/06/01 10:14:43 (permalink)
5 (1)
Atmel Studio is abandoned in my case. Now with MPLAB X + Hamony v3, problem solved.
#2
nigelwright7557
Super Member
  • Total Posts : 471
  • Reward points : 0
  • Joined: 2006/11/06 08:15:51
  • Location: 0
  • Status: offline
Re: ATSAME54P20A Ethernet(LwIP) conflict with CAN-FD, by AtmelStudio 2020/06/01 12:42:55 (permalink)
0
KevinHuang
Atmel Studio is abandoned in my case. Now with MPLAB X + Hamony v3, problem solved.


Pleased to hear you got it sorted.
Thanks for letting us know how you managed the problem.
Quite a lot of people just disappear without reporting the fix.
 
#3
Jump to:
© 2020 APG vNext Commercial Version 4.5