Not applicable
Jul 30, 2013
01:05 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 30, 2013
01:05 AM
Hey there,
I've tried to use the (Software?) Timer from the RTOS, following the description in the documentation: http://www.keil.com/pack/doc/arm/cmsis/cmsis/documentation/rtos/html/group___c_m_s_i_s___r_t_o_s___t...
Including the necessary configurations in the UI for RTOS App.
But sadly the callback functions are never reached (neither in debug mode nor toggling LED). Does anybody have a minimal example wich works as it should?
Regards, Julian
I've tried to use the (Software?) Timer from the RTOS, following the description in the documentation: http://www.keil.com/pack/doc/arm/cmsis/cmsis/documentation/rtos/html/group___c_m_s_i_s___r_t_o_s___t...
Including the necessary configurations in the UI for RTOS App.
But sadly the callback functions are never reached (neither in debug mode nor toggling LED). Does anybody have a minimal example wich works as it should?
Regards, Julian
3 Replies
Not applicable
Aug 01, 2013
01:10 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Aug 01, 2013
01:10 AM
Could anybody at least confirm the problem?
Not applicable
Aug 01, 2013
04:17 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Aug 01, 2013
04:17 AM
Hi Julian,
Did you enable the User Timer in the RTOS001 App?
Anyway, we will look into this issue.
Will update you once we have solution.
Did you enable the User Timer in the RTOS001 App?
Anyway, we will look into this issue.
Will update you once we have solution.
Not applicable
Aug 01, 2013
11:31 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Aug 01, 2013
11:31 PM
Hi Julian,
I can get the timer to run and get the callback function.
I'm not sure how you does it but basically how I did as follow:
1) Using the RTOS_Example1 from the DAVE3 and enable the "User Timers" in the RTOS001 UI Editor
2) Added IO004 for IO control in Callback function
3) Regenerated the code
4) Add new thread for create timer task and timer callback function
Definition:
Timer Thread:
Timer Callback function:
Main function:
I can get the timer to run and get the callback function.
I'm not sure how you does it but basically how I did as follow:
1) Using the RTOS_Example1 from the DAVE3 and enable the "User Timers" in the RTOS001 UI Editor
2) Added IO004 for IO control in Callback function
3) Regenerated the code
4) Add new thread for create timer task and timer callback function
Definition:
osThreadId tid_thread3; /* assigned ID for thread 3 */
void osTimer_thread (void const *argument);
void Timer1_Callback (void const *arg);
osThreadDef(osTimer_thread, osPriorityNormal, 1, 0);
osTimerDef (Timer1, Timer1_Callback);
uint32_t exec1;
Timer Thread:
void osTimer_thread (void const *argument)
{
osTimerId id1;
osStatus status;
uint32_t timerDelay;
exec1 = 1;
id1 = osTimerCreate (osTimer(Timer1), osTimerPeriodic, &exec1);
if (id1)
{
timerDelay = 1000;
status = osTimerStart (id1, timerDelay); // start timer
if (status != osOK)
{
// Timer could not be started
}
}
}
Timer Callback function:
void Timer1_Callback (void const *arg)
{
IO004_TogglePin(IO004_Handle0);
}
Main function:
int main (void) { /* program execution starts here */
DAVE_Init();
mpool = osPoolCreate(osPool(mpool)); /* create memory pool */
MsgBox = osMessageCreate(osMessageQ(MsgBox), NULL); /* create msg queue */
tid_thread1 = osThreadCreate(osThread(send_thread), NULL);
tid_thread2 = osThreadCreate(osThread(recv_thread), NULL);
tid_thread3 = osThreadCreate(osThread(osTimer_thread), NULL);
semaphore = osSemaphoreCreate(osSemaphore(semaphore), 1);
osKernelStart();
osDelay(osWaitForever);
for (;;);
}