1.8 TCP/IP SNMP SDCARD FATFS
The Microchip SNMP Server is a multi-lingual implementation, which supports SNMPv1, V2c, and V3 server features simultaneously. The SNMP Server is implemented to address the requirements of embedded applications and works with both IPv4 and IPv6 addresses.
TCP/IP SNMP SDCARD FATFS MCC Configuration
The following Project Graph diagram shows the Harmony components included in the SNMP SDCARD FATFS application demonstration.
MCC is launched by selecting Tools > Embedded > MPLAB® Code Configurator from the MPLAB X IDE and after opening the project, TCP/IP demo project is ready to be configured and regenerated.
TCP/IP Root Layer Project Graph
The root layer project shows that UART2 peripheral is selected to do read and write operation for TCP/IP commands.
This is the basic configuration with SYS_CONSOLE, SYS_DEBUG and SYS_COMMAND modules. These modules are required for TCP/IP command execution.
PIC32MZ DA Starter Kit
PIC32MZ DA device performs read/write to an SD card using SDMMC driver. This demo application use SDMMC driver to read/write from SDHC peripheral module.
SDHC (SD/MMC Host Controller) PLIB provides low level APIs to configure and transfer data using the SD host controller. SD multimedia memory card ( SDMMC ) driver provides abstraction to communicate with SD/eMMC card through the SDHC peripheral library interface. The TCP/IP application use FAT file system with SDMMC driver to read/write to an SD card.
PIC32MZ EF Starter Kit
PIC32MZ EF Device performs read/write to an SD card using SDSPI Module. This module is selected with SPI peripheral.
SDSPI driver uses an instance of the SPI driver to communicate to the SD card over the SPI bus.
The TCP/IP application demonstrates FAT file system to read/write to an SD card using SDSPI driver. This demo application use SPI peripheral to read/write from SDMMC module.
Wolfssl crypto module enabled with MD5,SHA authentication and AES encryption/decryption privacy protocol are enabled. Wolfssl library configured with open secured socket.
TCP sockets calculate the ISN using the wolfSSL crypto library.
NOTE - The above screenshot contains FreeRTOS component and that is required for RTOS application. For bare-metal(non-RTOS) FreeRTOS component shouldn't be selected.
The FAT file system is selected for this application to read/write to an SD card. This is the below snapshot for the FAT FS configuration.
TCP/IP Configuration
PIC32MZ DA Starter Kit / PIC32MZ EF Starter Kit
TCP/IP Required Application
TCP/IP demo use these application module components for this demo.
Announce module to discover the Microchip devices within a local network.
DHCP Client module to discover the IPv4 address from the nearest DHCP Server.
DNS Client provides DNS resolution capabilities to the stack.
HTTPNET Server module is selected to run the web_server for the port number 443.
NBNS NetBIOS Name Service protocol associates host names with IP addresses. This assign of human-name host names to access boards on the same subnet.
SMTP CLIENT let applications send e-mails to any recipient worldwide.
SNTP Simple Network Time Protocol updates its internal time periodically using a pool of public global time servers.
SNMP and SNMPv3 are an application layer protocols that facilitates the exchange of management information among network devices.
Maximum SNMP Message Size can be increased and the value should be multiple of 32 bytes for larger GET-Bulk response.
TCP/IP Data Link Layer
Internal ethernet driver(ethmac) is enabled with the external LAN8740 PHY driver library for both the starter kits. The MIIM Driver supports asynchronous read/write and scan operations for accessing the external PHY registers and notification when MIIM operations have completed.
TCP/IP SNMP SDCARD FATFS Hardware Configuration
This section describes the hardware configuration for PIC32MZ DA/EF Starter Kit and one can be used for the respective application demonstration.
This section describes the PIC32MZ DA Starter Kit default hardware configuration which uses the on-board debugger and programmer for this application demonstration.
Refer to the PIC32MZ DA Starter Kit User Guide for the programming/debugging options supported & setting up the hardware.
Connect micro USB cable from the computer to the DEBUG USB connector(J19) on the PIC32MZ DA Starter Kit
Connect micro USB cable from the computer to the USB-UART connector(J5) on the PIC32MZ DA Starter Kit
Insert the SD Card in the SD Card slot (J10) on the PIC32MZ DA Starter Kit (as shown above).
Establish a connection between the router/switch with the PIC32MZ DA Starter Kit through the RJ45 connector on PHY daughter board
This section describes the PIC32MZ EF Starter Kit default hardware configuration which uses the on-board debugger and programmer for this application demonstration with SDMMC(Secure Digital/ MultiMediaCard interface) interface.
Refer to the PIC32MZ EF Starter Kit User Guide for the programming/debugging options supported & setting up the hardware.
Refer to the Starter Kit I/O Expansion Board - DM320002 User Guide
Refer to the SDMMC PICtail daughter board - AC164122 User Guide
Insert the SDMMC PICtail daughter board (AC164122) into the SPI1 slot of the I/O Expansion Board (DM320002)
Connect the 168 pin to 132 pin Starter Kit Adapter board to the Starter Kit I/O Expansion Board (DM320002), optionally use a nylon nut and bolt to secure the two boards together
Connect the PIC32MZ EF Starter kit to the 168 pin to 132 pin Starter Kit Adapter board, optionally use a nylon nut and bolt to secure the two boards together
Connect the mini USB cable from the computer to the USB DEBUG connector on the PIC32MZ EF Starter Kit
Connect the mini USB cable from the computer to the USB-UART connector on the PIC32MZ EF Starter Kit
Insert the SD Card in the SD Card slot on the SDMMC PICtail daughter board (AC164122)
Establish a connection between the router/switch with the PIC32MZ Starter Kit through the RJ45 connector on PHY daughter board.
The demo application is configured for the SPI1 slot, using the following I/O pins:
SPI 1 Pin Selection SCK1 - SPI clock RD1 SDI1 - SPI Data Input RD14 SDO1 - SPI Data Output RD10 SPI Chip Select RB1
TCP/IP SNMP SDCARD FATFS Running Application
This SNMP application opens a file named snmp.bib in the root directory of the SD card and reads its content into memory. Also web pages stored in an external SD card and is accessed through a FAT FS API.
This table list the name and location of the MPLAB X IDE project folder for the demonstration.
Project Name | Target Device | Target Development Board | Description |
---|---|---|---|
pic32mz_das_sk.X | PIC32MZ2064DAS169 | PIC32MZ DA Starter Kit | Demonstrates the SNMP SDCARD FATFS on development board with PIC32MZ2064DAS169 device and LAN8740 PHY daughter board. This implementation is based on bare-metal(non-RTOS). |
pic32mz_das_sk_freertos.X | PIC32MZ2064DAS169 | PIC32MZ DA Starter Kit | Demonstrates the SNMP SDCARD FATFS on development board with PIC32MZ2064DAS169 device and LAN8740 PHY daughter board. This implementation is based on FreeRTOS. |
pic32mz_ef_sk_freertos.X | PIC32MZ2048EFH144 | PIC32MZ EF Starter Kit | Demonstrates the SNMP SDCARD FATFS on development board with PIC32MZ2048EFH144 device and LAN8740 PHY daughter board. This implementation is based on FreeRTOS. |
Ensure the SD card is formatted and loaded with the snmp.bib file along with the web pages provided within the< install-dir >/net_apps_pic32mz/apps/snmpv3_sdcard_fatfs/firmware/src/web_pages directory.
Running Demonstration Steps
Build and download the demonstration project on the target board.
If the board has a UART connection:
A virtual COM port will be detected on the computer, when the USB cable is connected to USB-UART connector.
Open a standard terminal application on the computer (like Hyper-terminal or Tera Term) and configure the virtual COM port.
Set the serial baud rate to 115200 baud in the terminal application.
See that the initialization prints on the serial port terminal.
When the DHCP client is enabled in the demonstration, wait for the DHCP server to assign an IP address for the development board. This will be printed on the serial port terminal.
Alternatively: Use the Announce service or ping to get the IP address of the board.
Run tcpip_discoverer.jar to discover the IPv4 and IPv6 address for the board.
Execution :
After the successful board bring up, the console output becomes
The SNMP and SNMPv3 server is hosted by the application.
Open a SNMP manager (iREASONING SNMP manager is recommended) and Follow the steps given in iREASONING Networks MIB Browser section in the Third-Party help for complete details on using and configuring the application demonstration using the iREASONING SNMP Manager.
SNMP MIB Browser -
Several SNMP MIB browsers are available. Users can also install a customized MIB browser specific to their application.
Verify SNMP Get, GetNext, GetBulk, Set requests and Get response operations .
For SNMP v2c , the Agent can be configured with three Read communities (E.g - "public", "read", " ") and three Write communities (e.g - "private","write","public").
Community Index Read Write 1 public private 2 read write 3 ----- public Also the SNMP v2c Community string can be Configured from the web browser.
For SNMP v3, the Agent is configured as per the following table:
Type USER 1 USER 2 USER 3 USM User microchip SnmpAdmin root Security Level auth, priv auth, no priv no auth, no priv Auth Algorithm MD5 SHA1 N/A Auth Password < As Per The Configuration > < As Per The Configuration > N/A Privacy Algorithm AES N/A N/A Privacy Password < As Per The Configuration > N/A N/A The Microchip SNMP Stack supports both TRAP version 1 and TRAP version 2. The default trap output is a multi-varbind SNMPv3 TRAP version 2. Trap receiver setting of iReasoning to be selected and configured to visualize the trap output in the iReasoning MIB browser.