User manual

11
The demonstration application contains six tasks. A description of these tasks is as follows:
The FrameworkTasks task is created in the SYS_Tasks function. This task calls the USB Device
Layer Tasks function (USB_DEVICE_Tasks). The priority of this task is designed to be the lowest
when compared to the priorities of other tasks. Hence this tasks runs when all other tasks are either
in blocked state or not ready to run.
The APP_USB_DEVICE_Open task is created in the APP_Tasks function. This task creates all the
semaphores and message queues needed for the application. It creates 4 tasks which implement the
application logic. It attempts to open the Device Layer and then blocks on the
xSemaphoreBlockUsbConfigure semaphore. The xSemaphoreBlockUsbConfigure is given in the
USB Device Layer Event Handler when the device is configured by the Host. The tasks then resumes
the 4 application logic tasks and suspends itself.
• The APP_CDC1Read Task is created in the APP_USB_DEVICE_Open task. It schedules a read on
the CDC1 instance and then blocks on the CDC1 instance xSemaphoreCDCReadComplete
semaphore. This semaphore is given in the Read Complete event in the CDC Application Event
Handler. The tasks will then post the data that it has received from the Host to the CDC 1 instance
Message Queue.
• The APP_CDC2Read Task is created in the APP_USB_DEVICE_Open task. It schedules a read on
the CDC2 instance and then blocks on the CDC2 instance xSemaphoreCDCReadComplete
semaphore. This semaphore is given in the Read Complete event in the CDC Application Event
Handler. The tasks will then post the data that it has received from the Host to the CDC 1 instance
Message Queue.
• The APP_CDC1Write Task is created in the APP_USB_DEVICE_Open task. It blocks on the CDC 2
message queue. When APP_CDC2Read Task posts a message to this queue, the APP_CDC1Write
gets ready to run and the writes the data (received on the queue) to the CDC 1. This data is then
transferred to the Host.
• The APP_CDC2Write Task is created in the APP_USB_DEVICE_Open task. It blocks on the CDC 1
message queue. When APP_CDC1Read Task posts a message to this queue, the APP_CDC2Write
gets ready to run and the writes the data (received on the queue) to the CDC 2. This data is then
transferred to the Host.
For more information about USB CDC stack, please refer to Framework Help/USB Libraries
Help/USB Device Help/USB Device CDC Library in MPLAB Harmony documentation.
2 PPR_tcpip_client_server [2]:
The TCP/IP Client Server application, PPR_tcpip_client_server, demonstrates how to run multiple
TCP and UDP servers and clients using the TCP/IP Stack in an RTOS environment. The
demonstration also has the HTTP Web server running using the Non-Volatile Memory (NVM)
Microchip Proprietary File System (MPFS) to store the web pages in the internal PIC32 Flash.
Description