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.
Hi,
I want to use STM32427 instead of STM32407, but uVision V4 doesn't supports that chip. So I upgrade uVision from V4 to V5, and plan to use CMSIS-RTOS RTX instead of RTX.
But now I have some questions after read the paper named "Migrate RTX to CMSIS-RTOS":
1.How can I delay a thread or pend a semphone less then 1ms? (I have a thread need to do periodic things and pend some thread messages, so the timeout should less then 1ms)
2.If CMSIS-RTOS RTX doesn't support, can I still use RTX on STM32M427 by uVision V5, is there any problem?
Thanks! Best regards
1
The default time resolution for CMSIS-OS is 1ms and it can be adjusted to smaller values. In RTX_Conf_CM.c there is a Timer Tick Value field and its default is 1000[us] for UV5 CMSIS-based projects. It is allowed to set lowest to 1[us] but I dont know if smaller values work fine or not because my projects all use 1000[us] only.
2
If you want to maintain existing UV4 project (using legacy RTX and middleware, instead of using new CMSIS-OS and new middleware), you can additionally install the Compatibility Support over the UV5 environment. After installing the Compatibility Support, you can open and build existing .uvproj (not .uvprojx) through UV5 as if using UV4.
Thanks for your reply! Yes, it work when I used the old RTX. I set OS_TICK value to 10[us] and used rt_dly_wait function to delay faster than 1000[us]:
void rt_dly_wait(U16 delay_time)
But now if I use the new API in CMSIS-RTOS:
osStatus osDelay(uint32_t millisec)
it can't delay faster then 1000[us].
Because in rt_CMSIS.c, it defined the generic wait function:
SVC_1_1(svcDelay, osStatus, unit32_t, RET_osStatus)
the svcDelayy called rt_dly_wait(rt_ms2tick(millisec)) to implemented the time delay. The rt_ms2tick function convent timeout in millisec to system ticks:
static uint32_t rt_ms2tick(uint32_t millisec){ uint32_t tick; ...//some if conditions tick = ((1000*millisec) + os_clockrate -1) / os_clockrate; ...// return tick; }
I dont't think use this osDelay function can delay faster then 1000[us].
So if I want to dealy faster then 1000[us], do I have to use old RTX API and include RTL.H instead of cmsis_os.h ?
You may use osKernelSysTickMicroSec() to create your custom microseconds delay loop.