-
Notifications
You must be signed in to change notification settings - Fork 3k
Exclude target-specific pins from GPIO tests with the FPGA shield #10459
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
Conversation
Add a `pinmap_restricted_pins_gpio()` that is used to skip pins during the GPIO test.
@@ -83,3 +83,5 @@ MBED_WEAK const PinList *pinmap_restricted_pins() | |||
return &pin_list; | |||
} | |||
``` | |||
|
|||
In addition to `pinmap_restricted_pins()`, the `pinmap_restricted_pins_gpio()` is used to skip pins during GPIO testing. By default this function returns an empty list and any target can override it to provide a list of pins that should be skipped. For example, D14 and D15 pins present in the Arduino form factor of FRDM-K64F have fixed pull-up resistors. The `PullDown` `PinMode` is impossible to test. However, other peripherals like the I2C may be successfully tested on these pins. |
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.
Its likely that more exclusion lists will be needed for various hardware quirks. What about something like pinmap_pin_info(PinName pin, pin_info_t *info)
which returns a structure of info for the given pin? This could take the place of both pinmap_restricted_pins()
and pinmap_restricted_pins_gpio()
by having these as fields in the struct. As new types of hardware anomalies are found they could be added to the struct. The struct could look something like this (As an example):
typedef struct {
bool restricted; // Pin should be avoided for all tests
PullType pull; // Pin has a hardware pullup or pulldown or is not pulled
bool i2c_shared; // One or more I2C devices may be connected to this pin
bool spi_shared; // One or more SPI devices may be connected to this pin
bool needs_jumper; // This pin is unconnected with default board jumper setting
} pin_info_t;
@maclobdell what are your thoughts on something like 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.
Sounds like a good idea. A weak pinmap_pin_info()
would do the trick. This would require updating https://github.com/ARMmbed/fpga-ci-test-shield/blob/master/mbed-code/test_utils.h, @maciejbocianski what do you think?
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.
@c1728p9 what will be use case of i2c_shared?
Actually we have only problems with gpio/gpio_irq tests. Limitation of others (i2c/spi/qspi/...) are or should be covered in PinMap_XXX. I think that for now having pinmap_restricted_pins_gpio
list with pulled pins is enough
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 agree with @maciejbocianski -- I don't see any need for more exclusion lists for now.
@fkjagodzinski, thank you for your changes. |
Instead of having a black list of restricted pins, could we have a white list of pins that are suitable for gpio use? we could have partners provide this list for their boards based on criteria we set (pin doesn't have external components on it, etc). Also a white list could show customers which pins are available in a board for use. And it also would give a list of pins to test. That seems less complex than having to test all pins, see which fail, analyze why they fail, and then add them to the black list. Just some friendly feedback. |
@fkjagodzinski Can you review?
Maybe too big hammer but why this value "PinMapMode" is not part of PinMap ? Do we know additional function for just gpio? If we know this pin up has pull up on board, it is pin's attribute we can't change and should be part of the pin. If we test it, we would check this one and find out "pull up there, dont test any other pin mode". |
@maclobdell Thanks for your input! Actually all of the pins present in a given form factor (e.g. returned by |
@0xc0170 Just to make it clear -- you suggest adding a Lines 30 to 34 in 42a9a7a
This sounds like a good idea, but unfortunately we do not have any PinMap for GPIO currently anyway.
Initially, I wanted to add a GPIO |
@0xc0170 are you happy with the responses to your questions ? Can we move this forward? |
Yes it is, this can be as improvement then 👍 However, if this is not must be in 5.13, I would consider it. As it is here it is easier to patch but is this future proof ? Does this align what we have already? If answer is yes, then lets go ahead with this patch. |
CI started meanwhile |
Test run: FAILEDSummary: 2 of 7 test jobs failed Failed test jobs:
|
Ok, to speed things up a bit, I prepared an alternative patch that uses the whitelist/pinmap approach instead of providing a function to exclude pins. |
Closing this in favor of 10644 |
Description
Most of the HAL tests that use the FPGA shield only use pins present in a
PinMap
specific for given peripheral. There is noPinMap
for GPIOs, but some board-specific pins have to be excluded from testing due to hardware limitations. This patch adds apinmap_restricted_pins_gpio()
function that every target can override if needed.Pull request type
Reviewers
@c1728p9 @jamesbeyond @mprse @maciejbocianski
Release Notes
Add a weak
pinmap_restricted_pins_gpio()
that every target can override and provide a list of pins that should be skipped during the GPIO tests (in addition topinmap_restricted_pins()
).