Skip to content
This repository has been archived by the owner on Sep 27, 2021. It is now read-only.

Investigate communication via HAL ethernet, rather than UDP on lwIP Raw #112

Open
rfairley opened this issue Oct 28, 2018 · 1 comment
Open

Comments

@rfairley
Copy link
Member

rfairley commented Oct 28, 2018

Opening this to make note, but is not high priority and really is an extra and educational item.

Describe the feature
Right now we have been able to communicate over ethernet by sending UDP packets using the lwIP Raw API as seen in the Development/Ethernet/lwip-rtos-config project. Although UDP is acceptable, we should try to have closer control of ethernet communications and not rely on the lwIP framework, implementing only what is necessary for our application. This issue asks to answer the question "Can we use the hal_eth functions to implement MCU <-> PC communications? Provide an example program that does this." After confirming it works, this would be implemented in the Robot projects.

Reason for request
This is for a few reasons:

  • code size - avoid including lwIP library which accounts for ~1/3 of the code size
  • lwIP allocates packet buffers dynamically and allows multiple connections, which we probably don't need as the MCU is not receiving many packets at a time, and is only receiving from one source
  • less layers - we don't require the whole IP stack i.e. UDP > IP > HAL ethernet
  • educational - know how to mange network buffers and why things like memory protection (MPU) are necessary

Timeline
Should be investigated at some point, but not in the near future.

Additional information
Will require consideration of the PC side of communications as well. Right now, a python script using the socket module is all that is necessary for UDP communication. With low-level ethernet communications, lower-level access to the PC ethernet peripheral may be needed (e.g. networking system calls).

The idea is that ethernet communications will be done through callbacks like void HAL_ETH_RxCpltCallback(ETH_HandleTypeDef *heth), similar to UART currently.

The lwIP implementation of ethernet communication e.g. in ethernetif.h/c will be helpful as reference code.

@rfairley rfairley changed the title Investigate interface for HAL ethernet, rather than UDP on lwIP Raw Investigate communication via HAL ethernet, rather than UDP on lwIP Raw Oct 28, 2018
@rfairley
Copy link
Member Author

Also related, now that Ethernet has been used successfully through the lwIP stack (in isolation at least) and we have more familiarity with UDP/TCP in general, we can also revisit the FreeRTOS stack https://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/TCP_Networking_Tutorial.html.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant