ATSAME54P20A Ethernet(LwIP) conflict with CAN-FD, by AtmelStudio
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.