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
  • Define the variable as global and add ‘volatile’ so that it does not get optimized (also decrease optimization level if needed).

    If you are still not able to see the return value then go to disassembly (look for something like “BL.W USBD_Initialize”) and step over that call. After that the return value is in register R0.

Reply
  • Define the variable as global and add ‘volatile’ so that it does not get optimized (also decrease optimization level if needed).

    If you are still not able to see the return value then go to disassembly (look for something like “BL.W USBD_Initialize”) and step over that call. After that the return value is in register R0.

Children