PV198 - Ethernet One-chip Controllers Daniel Dlhopolček, Marek Vrbka, Jan Koniarik, Oldřich Pecák, Tomáš Rohlínek, Ján Labuda, Jan Horáček, Matúš Škvarla Faculty of Informatics, Masaryk University 12/2023 Introduction Intro Switch the branch to Week_12! Discussion of HW11 ·PV198 - Ethernet ·12/2023 2 / 13 Ethernet principles ISO/OSI model ISO/OSI layers with some protocol examples: Layer Protocols 7. Application HTTP, SMTP, DNS 6. Presentation FTP, SSH 5. Session 4. Transport TCP, UDP 3. Network IP, ICMP 2. Data MAC 1. Physical Physical structure ·PV198 - Ethernet ·12/2023 3 / 13 Ethernet principles IPv4 header Source: K66 Sub-Family Reference Manual ·PV198 - Ethernet ·12/2023 4 / 13 Ethernet principles UDP header Source: K66 Sub-Family Reference Manual ·PV198 - Ethernet ·12/2023 5 / 13 FRDM-K66F Ethernet FRDM-K66F Ethernet 10/100 Mbps Ethernet MAC (ENET) Compliant with the IEEE802.3-2002 standard Hardware acceleration block to optimize the performance of network controllers providing TCP/IP, UDP, and ICMP protocol services CRC-32 checking / CRC-32 generation Programmable MAC address ·PV198 - Ethernet ·12/2023 6 / 13 FRDM-K66F Ethernet FRDM-K66F Ethernet We will use lightweight IP stack lwIP in our embedded application. Application Lightweight IP stack Presentation Lightweight IP stack Session Lightweight IP stack Transport Lightweight IP stack Network Lightweight IP stack Data 10/100 Mbps Ethernet MAC, ENET driver Physical Micrel 32-pin Ethernet PHY ·PV198 - Ethernet ·12/2023 7 / 13 FRDM-K66F Ethernet lwIP Lightweight IP stack Specification Small independent implementation of the TCP/IP protocol suite – used in embedded Features: IP, ICMP, UDP, TCP, DNS, DHCP, and more ·PV198 - Ethernet ·12/2023 8 / 13 Seminar task Seminar task – Overwiew The application sends a message to a database Download it from study materials It uses UDP packets to send data to InfluxDB Data are shown with Grafana http://lavinia.fi.muni.cz:3000/ Login: onechip:onechip Goto: Student Dashboard InfluxDB: udp://lavinia.fi.muni.cz:8089/ When you successfully send a message, it will be visible on the dashboard. ·PV198 - Ethernet ·12/2023 9 / 13 Seminar task Seminar task – Template Initialization of pins, clocks, peripherals and lwIP already implemented. Based on UDP echo When the board receives an UDP packet, it sends the packet back to the sender. Uses predefined static IP address. ·PV198 - Ethernet ·12/2023 10 / 13 Seminar task Seminar task – Source Code main: Initialize pins, clocks, peripherals, lwIP Send udp packet – your task to implement Loop: Receive packets ·PV198 - Ethernet ·12/2023 11 / 13 Seminar task Seminar task – Task 1. Define your unique IP address (192.168.50.x). 2. Implement function udp_send_data in udpecho_raw.c. Extra task Handle received packet – send the packet back to the sender. ·PV198 - Ethernet ·12/2023 12 / 13 Homework Voluntary homework Send meaningful data to the database. E.g.: Data from sensor (temperature, pressure, accelerometer, ... ) Logging information (button pressed, ...) You have to use address.h This homework is voluntary, you won’t get points for it. You can ask your teacher for feedback for it. ·PV198 - Ethernet ·12/2023 13 / 13