AnsweredAssumed Answered

USB CDC on microC/OS II?

Question asked by newbill.jon on Jun 29, 2016
Latest reply on Jul 20, 2016 by newbill.jon
I've generated a test app using STM32Cube for a STM32F407 Discovery board and have been able to send and receive.  I am now trying to port the code to run under microC/OS II.  I have modified the ISR to include the uC/OS additions and have also replaced calls to HAL_Delay() with OSTimerDly() however the port is not being created for the ported project.  Any ideas on what I'm missing?  The MX_USB_DEVICE_Init doing all its calls with no error returns.

void STM32F4_InterruptController::OTG_FS_IRQHandler(void)
{
   extern PCD_HandleTypeDef hpcd_USB_OTG_FS;
   OS_CPU_SR  cpu_sr = 0;

   OS_ENTER_CRITICAL();                         /* Tell uC/OS-II that we are starting an ISR          */
   OSIntNesting++;
   OS_EXIT_CRITICAL();

   HAL_PCD_IRQHandler(&hpcd_USB_OTG_FS);

   OSIntExit();                                 /* Tell uC/OS-II that we are leaving the ISR          */
}

----------------------
Code fragment from startup task in uC/OS

 /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
  HAL_Init();

  /* Configure the system clock */
  SystemClock_Config();

  /* Initialize all configured peripherals */
  MX_GPIO_Init();
  MX_USB_DEVICE_Init();
   HAL_Delay(1000); 
    /* CDC port is visible at this point in stand alone but not in uC/OS II version */
   uint8_t test_msg[]="HELLO";
   uint16_t size = strlen((char *)test_msg);
      
  /* Infinite loop to send data */
  while (1)
  {
...

 

Outcomes