-
Notifications
You must be signed in to change notification settings - Fork 3k
Renesas: Add LPTICKER #7552
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
Renesas: Add LPTICKER #7552
Conversation
Looking at the implementation, what are results from sleep test (mainly lp ticker test case there) ? |
SLEEP test is here: |
@ARMmbed/mbed-os-hal Hi anyone of members, could you review this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like implementation of ticker HAL API is consistent with the requirements.
Could you check if your implementation passes tests-mbed_hal-lp_ticker
and tests-mbed_hal-common_tickers
from PR #7508 - this adds requirements and test cases for ticker free function. It is still under development, but I think it would be good to check.
GIC_ClearPendingIRQ(LP_TICKER_TIMER_IRQn); | ||
|
||
MTU2TIER &= ~MTU2_TIER_n_TGIEA; | ||
mtu2_free(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess that lp_ticker_inited
should be set to 0, so re-initialisation will work.
@mprse Log is here:
Since PR #7508 is under development, I would like to suggest that go ahead this PR and I will submit new PR against the above problem If necessary after PR #7508 was merged. Could you agree this? I will appreciate if you can tell me your opinion. |
@TomoYamanaka PR #7508 adds additional test cases for ticker free function, so I think that This test case performs the following actions:
This is a long shot, but maybe interrupt is already pending and fires after the ticker interrupt is enabled while setting the interrupt ( Answering to your question I agree that you should go ahead with this PR. But it looks like morph does not cover Renesas boards, so it would be good to provide here test run results with all tests passed for each compiler before this one is merged. |
/morph build |
Tests are provide in the first post, should be also (at least informed no changes in tests after adding another changes here). |
The Ticker test result for commit db266a0 is here: |
Build : FAILUREBuild number : 2698 |
Although other venders implement this feature by using RTC, in my H/W(RZ_A1), I cannot use RTC because it does not satisfy the spec of LP Ticker (ms order and low frequency between 8 KHz and 64 KHz). Therefore I implemented this feature by creating 1024 division by MTU2(Multi function Timer pulse Unit 2) in order to satisfy this spec. As a result of investigating, the most unaffected channel among MTU2 placed on GR-PEACH and GR-LYCHEE was channel 3, so I use channel 3 for this feature. - mbed_drv_cfg.h I added a macro of MTU2 channel to this file for commonalizing code for GR-PEACH and GR-LYCHEE, and referenced it's macro at us_ticker.c. - targets.json I added a macro for enabling LP Ticker. - mtu2.c mtu2.h I defined fuction of MTU2's clock supply and stop. Because MTU2 is utilized by pwm driver too, those function were referenced at lp_ticker driver and pwm driver. - lp_ticker.c lp_ticker_init() In order to satisfy the LP Ticker spec, I implemented by creating 1024 division by MTU2. When an interrupt is required, it will be set with ticker_set_interrupt(). - lp_ticker.c lp_ticker_free() This function stops the counting and powerdown the lp_ticker. - lp_ticker.c lp_read() This function returns the timer counter of MTU2. - lp_ticker.c lp_ticker_set_interrupt() In order to satisfy specifications, I implemented lp_ticker_set_interrupt() function. - lp_ticker.c lp_ticker_fire_interrupt() In order to satisfy spec, I implemented lp_ticker_fire_interrupt() function. Also I added GIC_EnableIRQ for allowing the interrupt at end of function. - lp_ticker.c lp_ticker_get_info() To satisfy the spec, I implemented lp_ticker_get_info() function. The value of freq includes rounding off.
I added "lp_ticker_inited = 0" in lp_ticker_free() of lp_ticker.c, so re-initialization will work.
db266a0
to
87496df
Compare
Sorry, I rebased my commit to modify the build failure. Could you trigger again? |
/morph build |
Build : SUCCESSBuild number : 2701 Triggering tests/morph test |
Exporter Build : SUCCESSBuild number : 2330 |
Test : SUCCESSBuild number : 2432 |
Renesas: Add LPTICKER
Description
I implemented LPTICKER feature for Renesas mbed boards.
Test result is here:
Test_PEACH_GCC.txt
Test_LYCHEE_GCC.txt
Pull request type