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

CMSIS RTOS does not starts on power on

Hi,

I am using CMSIS RTOS on my project.
This project also contains Keil HTTP server.

#define osFeature_MainThread 1 ///< main can be thread

then RTOS will starts main on startup/power on.
I can debug it fine but when I power off then power on again. It does not startup

My code is here

int main (void)
{

netInitialize (); netSYS_SetHostName (_net_name); netDHCP_Enable(0); netHTTPs_Start (); //osThreadCreate (osThread(RunLeds),&guileds);

osTimerId id; // timer id id = osTimerCreate (osTimer(RunLeds), osTimerPeriodic, &guileds); osTimerStart (id, 1); // start timer osThreadCreate (osThread(RunRelayThread), relay);

osThreadCreate (osThread(RunCommsThread), gwbuilder_);

// display_id = osThreadCreate (osThread(Display), NULL); /* Main terminates here - all other threads remain running */ while(1) { guileds.led(4)->set(); osDelay (1000); }
}

Do I need to do

int main (void) { if (osKernelInitialize () != osOK) { // check osStatus for other possible valid values // init }

if (!osKernelRunning ()) { // is the kernel running ? if (osKernelStart () != osOK) { // start the kernel // kernel could not be started } }
}

I can seen in debug that osKernelStart () get calls but return immediately. So I need infinite loop to make it running.

Kindly advise me my mistakes.

Parents
  • So basically to clarify.

    My questions

    1- Do I need to calls "osKernelInitialize" and "osKernelSatrts"?
    2- Is "osKernelStarts" is blocking calls?
    3- Do I need infinite loop at the end of main.
    4- Keil HTTP/Net init and starts needs to be called? "netInitialize" and "netHTTPs_Start"

    Thanks,
    Naeem

Reply
  • So basically to clarify.

    My questions

    1- Do I need to calls "osKernelInitialize" and "osKernelSatrts"?
    2- Is "osKernelStarts" is blocking calls?
    3- Do I need infinite loop at the end of main.
    4- Keil HTTP/Net init and starts needs to be called? "netInitialize" and "netHTTPs_Start"

    Thanks,
    Naeem

Children