Hi,
what is the best way to override hal_st_lld implementation?
hal_st_lld override implementation
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: hal_st_lld override implementation
Hi,
Currently there is no clean mode if you are using HAL...
Proceed as follow:
1) Edit osal.h and make it define OSAL_ST_MODE_NONE, this disables the ST driver.
2) Define PORT_USE_ALT_TIMER=1 in your makefile and provide a chcore_timer_alt.h file with your own implementation.
I'll do something about point 1 next. Point 2 is already fine and working as intended.
Probably it would be a good idea to overhaul the ST driver, I may need more comparators for a new kernel safety feature soon (thread watchdogs).
Giovanni
Currently there is no clean mode if you are using HAL...
Proceed as follow:
1) Edit osal.h and make it define OSAL_ST_MODE_NONE, this disables the ST driver.
2) Define PORT_USE_ALT_TIMER=1 in your makefile and provide a chcore_timer_alt.h file with your own implementation.
I'll do something about point 1 next. Point 2 is already fine and working as intended.
Probably it would be a good idea to overhaul the ST driver, I may need more comparators for a new kernel safety feature soon (thread watchdogs).
Giovanni
Re: hal_st_lld override implementation
Thanks for reply!
I mean overriding only low level implementation: hal_st_lld.h/hal_st_lld.c.
I have RTC based ST implementation, but it is very annoying to edit hal_st_lld.h/hal_st_lld.c every time....
I mean overriding only low level implementation: hal_st_lld.h/hal_st_lld.c.
I have RTC based ST implementation, but it is very annoying to edit hal_st_lld.h/hal_st_lld.c every time....
Vitaly
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: hal_st_lld override implementation
Hi,
You could just make your own .mk file to import from your Makefile, place your LLDs into another directory.
Giovanni
You could just make your own .mk file to import from your Makefile, place your LLDs into another directory.
Giovanni
Re: hal_st_lld override implementation
Hi,
with modified make file it would be difficult to change project config: change ST timer....
Is it possible to use STM32_ST_USE_TIMER == 0 macro to switch between implementations?
Or maybe you can add ST based on RTC implementation to STM32 hal_st_lld?
with modified make file it would be difficult to change project config: change ST timer....
Is it possible to use STM32_ST_USE_TIMER == 0 macro to switch between implementations?
Or maybe you can add ST based on RTC implementation to STM32 hal_st_lld?
Vitaly
Who is online
Users browsing this forum: No registered users and 5 guests