madison-embedded / gcc-builds

For projects built with the GNU toolchain.
GNU General Public License v3.0
11 stars 8 forks source link

Middleware: LwIP Application-layer implementation and verification #31

Closed vkottler closed 7 years ago

vkottler commented 7 years ago

Most immediate action item: figure out how to enable all forms of print debugging.

The way we are using it, all of our implementation code is in middleware/conf.

ethernetif.c:

Code that does all of the heavy-lifting is here. low_level_output and low_level_input are the functions that interact with the Ethernet controller and it's DMA instance. low_level_output gets linked to the struct netif * but low_level_input is only called by ethernetif_input and it seems that ethernetif_input is exclusively a user-called function. This function calls netif->input(p, netif) which performs the "LwIP higher-layer protocol processing" on the packet. From there if it determines what kind of packet it is and calls additional input processing functions, I think that would make sense but at this point in time I'm not sure.

I'm mainly confused how any higher-level protocol implementation operates without direct access to the low_level_input and ethernetif_input functions.

This entire file is largely copied from the example in STM32F7 Cube example.

ethernetif.h:

Exported functions and variables live here.

lwipopts.h:

Controls what gets compiled across the LwIP codebase. Heavy modifications have been made to this file but certain settings likely need to be modified.

lwipopts_conf.h:

Copied, I'm not entirely sure what should go here.

arch/cc.h:

Copied, appears to be compiler boiler-plating.

The ideal network debugging setup involves a local network (i.e. no up-link to greater internet) with a single computer and a single Nucleo 144 as the nodes on the network. A router with a DHCP server is the ideal network-managing entity in this scenario.

vkottler commented 7 years ago

common/cmd_eth.c:

Code that interacts with LwIP interface functions

vkottler commented 7 years ago

Wireshark is relatively easy to use. Simply install and begin monitoring network traffic on your ethernet interface. If the network setup is the same as described above it should be reasonably easy to see all traffic.

vkottler commented 7 years ago

it's working