This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

migrating from RTX1 to 5, code entry issue.

I need to move to RTX5 And I think I have it set up right based on the migration notes. My code in app_main never runs?

void app_main (void const *argument)
{
//this code never runs
                uint8_t buf[2];
                USBD_Initialize(0);                 /* USB Device 0 Initialization        */
                USBD_Connect   (0);                 /* USB Device 0 Connect               */

                //init OBDGenie
                device = getDevice();
                device->init();
                device->probeForGW();

                while (1) //usb loop
                {

                        device->setData();

                }
}

osThreadDef(app_main, osPriorityNormal, 1, 0);

int main (void)
{
  HAL_Init();                           /* Initialize the HAL Library         */
  SystemClock_Config();                 /* Configure the System Clock         */
  SystemCoreClockUpdate();              // Update system clock4

  osKernelInitialize();
  osThreadCreate(osThread(app_main), NULL);
  osKernelStart();
  for (;;);
}


[/pre]

Parents
  • It seems that you have an STM32 device.

    Try to debug your application and check which “os” function fails (inspecting return value) and where your program ends up.

    Most likely the ST template code or CubeMX generated code conflicts with RTX.

    Make sure that you don’t override any of the 3 exception handlers used by RTX (SysTick, PendSV and SVC).

    Also ensure that the NVIC Priority Grouping and Interrupt Priority of SysTick, PendSV and SVC is not changed (check HAL_Init function).

Reply
  • It seems that you have an STM32 device.

    Try to debug your application and check which “os” function fails (inspecting return value) and where your program ends up.

    Most likely the ST template code or CubeMX generated code conflicts with RTX.

    Make sure that you don’t override any of the 3 exception handlers used by RTX (SysTick, PendSV and SVC).

    Also ensure that the NVIC Priority Grouping and Interrupt Priority of SysTick, PendSV and SVC is not changed (check HAL_Init function).

Children