afry-south / dragonfly-fcb

ÅF Dragonfly Quadrotor UAV Project
Other
7 stars 3 forks source link

use FreeRTOS for handling USB #31

Closed adam-at-epsilon closed 9 years ago

adam-at-epsilon commented 9 years ago

It would be desirable if USB was handled in a task running at the lowest priority.

adam-at-epsilon commented 9 years ago

The below is an approximate call stack for USB handling.

./fcb/src/stm32f3xx_it.c:232:  HAL_PCD_IRQHandler(&hpcd);
|
V
stm32f3xx_hal_pcd.c:553:    PCD_EP_ISR_Handler(hpcd);
|
V
static HAL_StatusTypeDef PCD_EP_ISR_Handler(PCD_HandleTypeDef *hpcd)
|
V
void HAL_PCD_DataOutStageCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum)
|
V
USBD_StatusTypeDef USBD_LL_DataOutStage(USBD_HandleTypeDef *pdev , uint8_t epnum, uint8_t *pdata)
|
V
./Core/Src/usbd_core.c:331:    pdev->pClass->DataOut(pdev, epnum);
|
V
USBD_CDC_DataOut # this is a callback in the USBD_ClassTypeDef structure
|
V
*hcdc pdev->pClassData
((USBD_CDC_ItfTypeDef *)pdev->pUserData)->Receive(hcdc->RxBuffer, &hcdc->RxLength);
stenbergd commented 9 years ago

Here is some information about handling USB with FreeRTOS on STM32: http://www.pezzino.ch/stm32-and-freertos-usb-communication/

adam-at-epsilon commented 9 years ago

a crude measurement was done by sending 32byte messages over the USB port and then piping the output to a file via Putty which resulted in a current speed of about 64Kb/s.

Windows OS says the difference between the "created" and "last modified" date was 38 seconds and the file contained 2456116 bytes.

stenbergd commented 9 years ago

This is more or less done. Looking at using the FreeRTOS+CLI (Command line interface) to organize command and data transmission.

stenbergd commented 9 years ago

DOne.