cancel
Showing results for 
Search instead for 
Did you mean: 

Enabling freeRTOS should not require setting system time base when using LL

Mohammad A
Senior

By default, when using HAL, it is required to set another time base source instead of SysTick as it is used for freeRTOS, but when using LL for all the peripherals, it shouldn't be necessary as LL does not use SysTick interrupt as HAL does.

I think the request to set another timer for timebase source should not be prompted to the user and hence code generator must not comment out

#define xPortSysTickHandler SysTick_Handler

 when using LL for all peripherals enabled.

2 REPLIES 2
Jack Peacock_2
Senior III

The drawback of relying on someone else to design and write your code is that you must accept their design decisions. Are you certain that the LL routines preserve the same SysTick timer setup as expected by FreeRTOS? What happens to the LL routines when, for instance, FreeRTOS enters the tickless idle state and stops SysTick. How will this affect LL routines when the RTOS timebase is restored on wakeup but not the LL timebase? ST has good reason to force another timer.

I don't use LL or HAL due in part to this type of conflict, which is a major problem when optimizing power for battery powered designs. FYI the old SPL library which LL replaces did not have this limitation. It even works in tickless mode.

Jack Peacock

Mohammad A
Senior

LL does not use ticks to setup/handle peripherals. Actually LL is a wrapper around register defines and does nothing more. It is all up to the user to handle peripherals.

Also about delay, there is LL_mDelay which does not use tick interrupts but reads systick overflow flag and can be disabled by define pre-processor whenever systick was set as timebase source.