We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello!!
I hace a problem with os_tmr_create and os_tmr_kill. I need use these functions in the USART interrupt, but when the procesor run this line it goes to Hard Fault.
Can you help me please?
Note that these are internal functions used by os_tmr_create() and os_tmr_kill(). They don't seem to be documented anywhere.
- what happens if two ISR calls os_tmr_create() and/or os_tmr_kill() concurrently? - may an ISR call rt_tmr_kill concurrently with a os_tmr_create()/os_tmr_kill()? What happens?
Note also that the os_evt_set() makes use of rt_evt_set(), but it isn't obvious if isr_evt_set() uses rt_evt_set().
The big questions to ask: Does it work, or does it just looks like it's working? And what happens with your code if Keil modifies the internals?
I know that this isn't the best solution, but in may application is very difficult any other solution with the RTOS, in this question the other solution is to use directly a timer of the microcontroller and the hardware interrupts.
In the RTL.h you can see that the call to these function seem the same that de os functions, and there is others isr thar are directly the rt function:
#define isr_mbx_check(mbx) rt_mbx_check(mbx)
I've checked that the program works correctly, but I will try to solve this in other way.
How about:
- create a high-priority task that starts the timer - from the UART isr, activate the task using the available isr_* functions
This way, the timer will be started right after the UART isr finishes.