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

Can not run two threads at the same time?

I have no issues running multiple thread instances but I can not run more then one thread at the same time, is that not possible? When the second thread starts, the code freezes.

 
//thd 1
extern osThreadId KA;

osThreadId KA;
void KA_CODE (void const *arg);
KA = osThreadCreate (osThread(KA_CODE_HS), NULL);
osThreadDef(KA_CODE_HS, osPriorityNormal, 1, NULL);
void KA_CODE_HS(void const *arg)
{
	while(1)
	{
		CANWrite_HS(ECU_ID_GM_1, ka, 1); 
		osDelay(1000U);
	}
}
 


//and thd 2
 
extern osThreadId act;

osThreadId act;
static void Activity (void const *arg);
act = osThreadCreate (osThread(activity_Thread), NULL);
osThreadDef(activity_Thread, osPriorityNormal, 1, NULL);
void activity_Thread(void const *arg)
{
	while(1)
	{
		_LEDOFF(GREEN);
		osDelay(500u);
		_LEDON(GREEN);
		osDelay(500u);
	}
}