cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 HAL or LL functions without the timebase

ENort.1
Associate III

Hi All,

 I am using the STM32H723 device and have used the HAL functions and they work but I find the SysTick or any timebase interrupts my code. Timing is critical; if the data from the serial port is interrupted by the SysTick interrupt, I lose data. I want to completely disable the use of SysTick and anything that relies on its use but like the use of the HAL functions. Is there a way to use the HAL without the timebase? I've tried IRQ Priority changes and just about everything I can think of to get the SysTick timer to stop interrupting my code but it persists. I have these two functions I use for the I2C:

HAL_I2C_Mem_Read

HAL_I2C_Mem_Write

I also need to figure out SPI comms too but that's a different animal for a different day. Are there LL functions that are similar to those above? Can I use the HAL_I2C_Mem_Read_IT and HAL_I2C_Mem_Write_IT as a possible solution? I changed everything over to LL drivers but do not see much in the way of solutions like the HAL drivers and I need some help. I assume LL is register-level stuff and I have to spin my own is that correct? Is there a driver guide for these interfaces so I can take a look at proven examples of bare metal register hacking to create non-timebase functions? Is there an online tool that can create functions for STM32 devices that are bare metal? Does anybody have functions they have created and are willing to share? 

Thanks,

Eric Norton

 

 

 

 

2 REPLIES 2
gbm
Lead III

You won't loose anything if your firmware is written properly. Normally the interrupt handling should not interfere with other actions. Normally, the SysTick interrupt priority is low, so other interrupts will preempt it. Normally, you don't wait for anything in an interrupt service routine, so that it completes quickly and does not influence other interrupts (you may wait as long as you want but only in the ISR of the lowest priority, provided there is no thread code or "main loop" in your program).

If you follow the common sense guidelines there is nothing wrong with some interrupts firing periodically in your application - they won't spoil anything.

TDK
Guru

> Can I use the HAL_I2C_Mem_Read_IT and HAL_I2C_Mem_Write_IT as a possible solution?

Yes, HAL functions work. If you don't know how to write your own code, I would suggest using them.

> I want to completely disable the use of SysTick and anything that relies on its use but like the use of the HAL functions.

Why/ I2C is not particularly high speed. SysTick interrupting it every 1 ms will not cause issues.

If you feel a post has answered your question, please click "Accept as Solution".