Conversation
|
@leandrolanzieri is this helpful? Mind to have a look? |
|
Set generic pin definition as in #10174 |
|
@MichelRottleuthner, @leandrolanzieri you took care of #10174, how about this PR? |
A-Paul
left a comment
There was a problem hiding this comment.
Code looks good to me. Just one location where we could save some space.
| #CFLAGS += -DDEBUG_TIMER_PORT=PORTF | ||
| #CFLAGS += -DDEBUG_TIMER_DDR=DDRF | ||
| #CFLAGS += -DDEBUG_TIMER_PIN=PORTF4 | ||
|
|
There was a problem hiding this comment.
Lines 8-14: This description is already in <cpu/atmega_common/periph/timer.c> since #9025.
Just place a reference, please.
There was a problem hiding this comment.
Then you will have to copy paste them from there everytime you want to use this debug pins.
As i understand the tests also as testing tools, having such info in place is imho more helpfull then the space saved.
There was a problem hiding this comment.
@A-Paul A-Paul i am willing to remove the comments if this is the showstopper here.
There was a problem hiding this comment.
This test should be independent of the atmega implementation. Ideally, we would have a generic debug pin for this purpose configured for every platform. Now that this is out of scope for your PR, I'd say we remove it.
|
@A-Paul can we continue here? |
|
@A-Paul @PeterKietzmann @kYc0o is it possible to get this merged as this is a part of the xtimer improvement i started a long time ago. I somehow get the feeling that there is no interrest from the maintainers to get xtimer working proprerly. Now old and known issues are coming up again #11149. |
|
So far the only thing missing is the testing part. Unfortunately I don't have the tools anymore to proceed with a good testing here, however I also think that this PR has waited too much and would be beneficial to merge it. @A-Paul would you have time for the testing? |
PeterKietzmann
left a comment
There was a problem hiding this comment.
@Josar I ran the application on a samr21-xpro with
CFLAGS += -DSLACKER_THREAD_PIN=GPIO_PIN\(0,22\)
CFLAGS += -DMAIN_THREAD_PIN=GPIO_PIN\(1,3\)
CFLAGS += -DPRINT_THREAD_PIN=GPIO_PIN\(1,22\)
Results look slightly different in comparison to yours, but they seem reasonable to me.
In a nutshell:
- print occurs every second
- main occurs every ~15.6ms and takes a little longer when print happens around the same time
- slacker occurs in (non constant) intervals between 1...10ms
| #CFLAGS += -DDEBUG_TIMER_PORT=PORTF | ||
| #CFLAGS += -DDEBUG_TIMER_DDR=DDRF | ||
| #CFLAGS += -DDEBUG_TIMER_PIN=PORTF4 | ||
|
|
There was a problem hiding this comment.
This test should be independent of the atmega implementation. Ideally, we would have a generic debug pin for this purpose configured for every platform. Now that this is out of scope for your PR, I'd say we remove it.
|
|
||
| # Define test probing pins GPIO API based. | ||
| # Port number should be found in port enum e.g in cpu/include/periph_cpu.h | ||
| #FEATURES_REQUIRED += periph_gpio |
There was a problem hiding this comment.
Is there a single platform that has no GPIO driver but xtimer support? In my opinion it should be fine to always include that feature (otherwise we would see what Murdoch says later)
| # Define test probing pins GPIO API based. | ||
| # Port number should be found in port enum e.g in cpu/include/periph_cpu.h | ||
| #FEATURES_REQUIRED += periph_gpio | ||
| # Jiminy probing Pins |
There was a problem hiding this comment.
If you really wanna have the jiminy config here, please define the CFLAGS in
ifneq (,$(filter jiminy,$(BOARD)))
endif
|
|
||
| #if defined(SLACKER_THREAD_PIN) | ||
| gpio_t slacker_pin = SLACKER_THREAD_PIN; | ||
| gpio_init(slacker_pin, GPIO_OUT); |
There was a problem hiding this comment.
Why not directly gpio_init(SLACKER_THREAD_PIN, GPIO_OUT); here and following?
|
|
||
| #if defined(SLACKER_THREAD_PIN) | ||
| gpio_set(slacker_pin); | ||
| gpio_clear(slacker_pin); |
There was a problem hiding this comment.
Probably a matter of taste, but wouldn't a single toggle be simpler and easier to read on the scope?
|
@PeterKietzmann i think its a 32 bit timer which is used for xtimer, waiting for that to overflow takes some time. Maybe you could configure it to use a 16bit timer. |
I wasn't waiting for an overflow :-). Are you saying this because I mentioned that my results look slightly different to yours? I'm fine with the concept of this PR and IMO it only needs some small polish in order to be merged |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions. |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions. |

This PR adds debug pins to probe this test with an oscilloscope.
This helps debugging #9595
Before the merge of #9211 (comment) we can observe the hanging behaviour of the system.
After #9211 (comment) is merged a pariodic a race condition appears which can be seen in the prints of the test #9596.
When #9595 is merged this will result in an stable System.