-
Notifications
You must be signed in to change notification settings - Fork 3k
Add STDIO UART as restricted for FPGA testing for all targets and support for restricting GPIO #12379
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
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.
Good to handle stdio_uart in a generic way ! thx for this
@mprse, thank you for your changes. |
@@ -20,6 +20,15 @@ | |||
|
|||
#include <list> | |||
|
|||
#define UARTMAPS_NAME "UART" |
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.
Make names consistent
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.
Fixed
92c86d6
to
a7e70ba
Compare
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.
good work, thanks for making changes this way, it makes things much easier. I'll tag @ARMmbed/team-nuvoton also have a look at the changes on their code
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.
So far, look good.
In the future, for flexibility, we could consider to use hash table to store "NAME" + ID for peripherals[] in pinmap_uart_restricted_peripherals().
a7e70ba
to
50bb413
Compare
Pull request has been modified.
Substantiation for this is that the STDIO UART peripheral is used by Mbed, so it should never be tested. Also solve the potential problem with accidenty skipped peripherals in FPGA testing. Currently, we have a one `pinmap_restricted_peripherals()` function for all interfaces (UART, I2C, SPI, etc.). The problem can be encountered if different interfaces have the same peripheral ids (e.g. `UART_0` = 0, `SPI_0` = 0). In this case, if `UART_0` is on the restricted list, then SPI tests will be also skipped for `SPI_0`. The good news is that usually, the peripheral ids are the base addresses of the peripheral's register set, but we can't rely on this. It is also good that `pinmap_restricted_peripherals()` at this moment is only required for STDIO UART (Nuvoton and STM). To solve this issue we will change name of `pinmap_restricted_peripherals()` to `pinmap_uart_restricted_peripherals()`, make STDIO UART restricted by default for all targets and update FPGA test utilily functions to use `pinmap_uart_restricted_peripherals()` to skip only uart peripherals. In the future if needed we can consider to add support to restrict peripherals of other interfaces(SPI, I2C, etc).
…art is restricted by default)
…pins This is a special case since targets do not provide by default GPIO pin-maps. This extension is required for FPGA GPIO tests - if some pins have limitations (e.g. fixed pull-up) we need to skip these pins while testing. To do that we were adding a dummy pin-map with commented out pins that can't be tested because of the limitations. This solution is redundant and the proposition is to provide a list of restricted gpio pins if required (by default weak implementation is provided with an empty list). This mechanism will be backward compatible, so the old method with dummy gpio pinmap will also work. The switch from dummy pin-maps to pinmap_gpio_restricted_pins() will be performed in separate commits/PRs.
50bb413
to
3c0982d
Compare
Extend this patch and add similar functionality to restrict GPIO pins. This is a special case since targets do not provide by default GPIO pin-maps. This extension is required for FPGA GPIO tests - if some pins have limitations (e.g. fixed pull-up) we need to skip these pins while testing. To do that we were adding a dummy pin-map with commented out pins that can't be tested because of the limitations. This mechanism will be backward compatible, so the old method with dummy GPIO pinmap will also work. The switch from dummy pin-maps to pinmap_gpio_restricted_pins() will be performed in separate commits/PRs. |
looks good |
CI started |
Test run: FAILEDSummary: 3 of 4 test jobs failed Failed test jobs:
|
seems something went wrong with
throws
|
In the build directory, I can see all passed. Is there no serial available on |
Pull request has been modified.
Provided a fix for: @0xc0170 can we try again? |
CI restarted |
Test run: SUCCESSSummary: 11 of 11 test jobs passed |
* | ||
* @return Pointer to a peripheral list of peripheral to avoid | ||
*/ | ||
const PinList *pinmap_gpio_restricted_pins(void); |
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.
It looks like we've come full circle and come back to the idea from #10459. 😄
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.
🥇
please tag this PR as |
@0xc0170 @adbridge @jamesbeyond |
While testing it has been found that all tests are skipped in the FPGA uart test on the NRF52840 target. This is caused by the following change: ARMmbed#12379 - Add STDIO UART as restricted for FPGA testing for all targets NRF targets have MUXed pins and mainly do not provide pin-maps. There are only dummy pin-maps for testing. These pin-maps hold only pins and do not specify the peripheral or function of the pin (always 0). Because of that if we restrict STDIO uart peripheral (0) all FPGA uart test cases will be skipped. To fix this we will remove this restriction for NRF52840. Restriction for testing the USBTX, USBRX pins is sufficient in this case.
While testing it has been found that all tests are skipped in the FPGA uart test on the NRF52840 target. This is caused by the following change: ARMmbed#12379 - Add STDIO UART as restricted for FPGA testing for all targets NRF targets have MUXed pins and mainly do not provide pin-maps. There are only dummy pin-maps for testing. These pin-maps hold only pins and do not specify the peripheral or function of the pin (always 0). Because of that if we restrict STDIO uart peripheral (0) all FPGA uart test cases will be skipped. To fix this we will remove this restriction for NRF52840. Restriction for testing the USBTX, USBRX pins is sufficient in this case.
Summary of changes
Substantiation for this is that the STDIO UART peripheral is used by Mbed, so it should never be tested.
Also, solve the potential problem with accidentally skipped peripherals in FPGA testing. Currently, we have a one
pinmap_restricted_peripherals()
function for all interfaces (UART, I2C, SPI, etc.).The problem can be encountered if different interfaces have the same peripheral ids (e.g.
UART_0
= 0,SPI_0
= 0). In this case, ifUART_0
is on the restricted list, then SPI tests will be also skipped forSPI_0
.The good news is that usually, the peripheral ids are the base addresses of the peripheral's register set, but we can't rely on this. It is also good that
pinmap_restricted_peripherals()
at this moment is only required for STDIO UART (Nuvoton and STM).To solve this issue we will change name of
pinmap_restricted_peripherals()
topinmap_uart_restricted_peripherals()
, make STDIO UART restricted by default for all targets and update FPGA test utilily functions to usepinmap_uart_restricted_peripherals()
to skip only uart peripherals.In the future, if needed we can consider adding support to restrict peripherals of other interfaces(SPI, I2C, etc).
As a side effect of this change, we need to remove Nuvoton implementations of
pinmap_restricted_peripherals()
. This function is no more available. Was replaced bypinmap_uart_restricted_peripherals()
and its weak implementation restricts FPGA testing on STDIO UART peripheral by default.Impact of changes
Migration actions required
Documentation
Pull request type
Test results
Reviewers
@ARMmbed/team-nuvoton
@maciejbocianski @fkjagodzinski
@jamesbeyond