Replies: 5 comments
-
Very strange... The classical errors would be to use the same k_timer struct, or the same callback (in which case, a de-multiplexing logic in the callback is needed to know which timer has fired). But that's not your case here AFAICS. How do you assert that only one of the timer works? The most probable explanation at this stage is that the both callbacks get executed, and that the problem lies elsewhere. Can you check if the callback of the first timer is executed (breakpoint, toggling a LED, printk...) when you enable both timers? |
Beta Was this translation helpful? Give feedback.
-
Hello ldomaigne, |
Beta Was this translation helpful? Give feedback.
-
On supported boards, no particular settings. Do you have your own board support? The H730 is not listed in the Zephyr supported board, closest match is the STM32H735G. Normally, the software timer that you are using is normally based on the Cortex-M systick timer, you should see these 3 settings:
Two ideas that come to mind:
|
Beta Was this translation helpful? Give feedback.
-
It is a custom board. -Second timer is initialized in a constructor of a class. Thank you for your time. I will update the outcome. |
Beta Was this translation helpful? Give feedback.
-
If you can reproduce the problem with a simple example, it can help tremendously to reproduce it on our side as well, if it's a Zephyr problem. One aspect I didn't check is the C++ / constructor bit. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
The application based on STM32H730.
There is timer implemented to control a peripheral which works as programmed.
When another timer was implemented, it was noticed that the first timer does not work but second timer is working as programmed.
First timer (Implemented in a class) : 200mSec
Definition:
static void buzzer_timer_handler( struct k_timer* timer );
struct k_timer m_timer;
Initialization:
k_timer_init( &m_timer, buzzer_timer_handler, NULL );
Start:
k_timer_start( &m_timer, K_MSEC( BEEP_PERIOD_MS ), K_MSEC( BEEP_PERIOD_MS ) );
Second timer: 125mSec
Definition:
void query_time_handler( struct k_timer* timer );
struct k_timer sdo_query_timer;
Initialization:
k_timer_init( &sdo_query_timer, query_time_handler, NULL );
Start:
k_timer_start( &sdo_query_timer, K_MSEC( SDO_QUERY_TIMER ), K_MSEC( SDO_QUERY_TIMER ) );
When “k_timer_start” for the second timer is commented, the first timer starts working.
Otherwise only second timer works.
The application does not seem to be limited by memory.
Any help will be appreciated.
Thank you
Beta Was this translation helpful? Give feedback.
All reactions