I used os_tmr_create(). But, always return value is NULL!! Why!!?
I saw os_tmr_create() defined in rt_Timer.c file. There is the following codes in the first conditional expression.
if (tcnt == 0 || m_tmr == NULL) { return (NULL); }
I think that the return value becomes NULL because "m_tmr" is NULL. How can I set the value to "m_tmr"?
Someone helps.
Thank you response.
I had started the RTX kernel before calling os_tmr_create() by using os_sys_init(). The mailbox etc... operate in my project. I think that no problem the RTX kernel. But!! os_tmr_create() doesn't work!!
my code is follows.
tmr1 = os_tmr_create (10, 1);
always return value is NULL!! tmr1 is 0x00000000.
It is strange...
No it is not. Have a look in RTX_Config.c:
// <o>Number of user timers <0-250> // Define max. number of user timers that will run at the same time. // Default: 0 (User timers disabled) #ifndef OS_TIMERCNT #define OS_TIMERCNT 3 #endif
...?
Have you correctly specified the number of timers that should be supported in RTX_Config.c?
I think the default value is zero, which would result in an allocation error.
http://www.keil.com/support/man/docs/rlarm/rlarm_ar_cfgusertmr.htm
Tamir, you beat me to it :)
Thank you Tamir!!
I was not setting "OS_TIMERCNT" as shown in your advice!! I set "OS_TIMERCNT" to "1".
os_tmr_create() is working!!
This question closes. Thank you!!
@Reluctant Consultant,
The next one is your :-) My memory is starting to betray me, have not been using RTX is new products for a while now...
Tamir
is there a reason why you have stopped using rtx for new products ?
Dan
We are now using FreeRTOS which is in my opinion a far superior product, and is free (except OpenRTOS and SafeRTOS). It has a much better queuing system and a much better singling system (forget about the 16 or was it 32 signals per RTX task) and it scalable - which saves you ROM/RAM footprint. It also has a built-in support for a Cortex MPU (RTX does not). Stable, fast, free and reliable. Why not? No compaints about RTX - it gets the job done, but it binds us to Keil products which is something we are not going to be using for a long time.