-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rv_timer_approximate_tick_params bug #420
Comments
I guess it is due to the time requested and frequency at which you are running - I am not familiar with the HAL of the timer, it is from OpenTitan - maybe you want to have a look there? |
Ok, I checked, it comes from Euclidean GCD used in the function. Actually, it happens when CLK_FREQ and desired TIMER_FREQ have small gcd (for example 1 !), it put large value for prescale (CLK_FREQ/ gcd) which is larger than what timer support so it returns 0 as not supported. So should be either we change this function to be more approximate or be careful while putting clk and desired timer frequency. |
changing the function should be better in my opion |
@Ho3eintaji is this fixed then? |
No. atm, in my app, I check whether this happens or not: Later, I will change the function inside to prevent it |
@davideschiavone, I ran into a bug while using the timer in Heepocrates which probably the same story for xheep. The function "rv_timer_approximate_tick_params" which is used for setting prescale and step params based on CPU freq and desired timer freq is not working well and most of the times it returns 0 for these params
The text was updated successfully, but these errors were encountered: