Skip to content
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

DISCO_L475VG_IOT01A: Add a list of restricted GPIO pins for testing #12380

Merged
merged 1 commit into from Feb 11, 2020

Conversation

mprse
Copy link
Contributor

@mprse mprse commented Feb 6, 2020

Summary of changes

Add a GPIO pinmap for DISCO_L475VG_IOT01A required for FPGA testing.

Impact of changes

Migration actions required

Documentation


Pull request type

[X] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[X] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

Reviewers

@ARMmbed/team-st-mcd

@jamesbeyond

@fkjagodzinski @maciejbocianski


@@ -52,6 +52,94 @@
#include "PinNamesTypes.h"
#include <mstd_cstddef>

//*** GPIO ***
// Pinmap used for FPGA GPIO testing only
MSTD_CONSTEXPR_OBJ_11 PinMap PinMap_GPIO[] = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still not a big fan of this proposal.
espacially this is really are to read - this is supposed to be an exclusion table and it actually contains all the defined pins with dummy values ... can't we at least create an enum the list of pins that need to be excluded from the test ?
That would be easier to read and create .

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is done in the same way as other peripherals. Please check PWM pin-map table where also some pins are commented out because of some reason:

// {PB_6, PWM_4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 1, 0)}, // TIM4_CH1 // Connected to STDIO_UART_TX
// {PB_6, PWM_16, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF14_TIM16, 1, 1)}, // TIM16_CH1N // Connected to STDIO_UART_TX
// {PB_7, PWM_4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 2, 0)}, // TIM4_CH2 // Connected to STDIO_UART_RX
// {PB_7, PWM_17, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF14_TIM17, 1, 1)}, // TIM17_CH1N // Connected to STDIO_UART_RX

We have a ready testing utility functions which can deal with the pin-maps. So from our point of view making exceptions here is very problematic.

Copy link
Contributor

@LMESTM LMESTM Feb 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Except thePWM and other tables are maps between pins to HW block instances.
The GPIO one is a table mapping pins to nothing ... :-(

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What you actually need is a simple list of pins on which you don't want to run a GPIO test. Do you need a table because other MCUs from other vendors a GPIO instance value ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After a quick chat with @maciejbocianski @mprse , we think the better way of the achieve the same result as @LMESTM suggested is add const PinList *pinmap_restricted_gpio_pins() which exclude the GPIO pins can't be tested, this PR will be updated along with some other targets also need to be updated as well

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here I added a mechanism to handle list of restricted GPIO in FPGA testing:
#12379 (comment)

Also here I dropped base commit and added commit with the list of restricted GPIO pins instead.

@ciarmcom
Copy link
Member

ciarmcom commented Feb 6, 2020

@mprse, thank you for your changes.
@maciejbocianski @jamesbeyond @fkjagodzinski @ARMmbed/mbed-os-maintainers please review.

@mprse mprse force-pushed the DISCO_L475VG_IOT01A_add_gpio_pinmap branch from 98af2d0 to c2cd2bb Compare February 7, 2020 10:04
@mprse mprse changed the title DISCO_L475VG_IOT01A: Add a GPIO pinmap for testing DISCO_L475VG_IOT01A: Add a list of restricted GPIO pins for testing Feb 7, 2020
jamesbeyond
jamesbeyond previously approved these changes Feb 7, 2020
Copy link
Contributor

@jamesbeyond jamesbeyond left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, @LMESTM what do you think about this approach?

Copy link
Collaborator

@jeromecoutant jeromecoutant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi

I didn't test, but I confirm this list of potential restrictions.
Note that maybe we could use some define value from PinNames.h:

RCC_OSC32_IN = PC_14,
RCC_OSC32_OUT = PC_15,
RCC_OSC_IN = PH_0,
RCC_OSC_OUT = PH_1,

and:
D14 = PB_9, // I2C_SCL
D15 = PB_8, // I2C_SDA

Copy link
Contributor

@LMESTM LMESTM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I definitely better like this approach (and Jerome proposal could make it even more generic for all STM32 targets !) - thank you for this update

@mergify mergify bot added needs: CI and removed needs: review labels Feb 7, 2020
@mprse mprse force-pushed the DISCO_L475VG_IOT01A_add_gpio_pinmap branch from c2cd2bb to 3a71f86 Compare February 7, 2020 10:48
@mergify mergify bot dismissed jamesbeyond’s stale review February 7, 2020 10:48

Pull request has been modified.

@mprse
Copy link
Contributor Author

mprse commented Feb 7, 2020

Thanks, everyone for the discussion and finding optimal solutions for this case.

I addressed @jeromecoutant last comment and used define value from PinNames.h in the restricted gpio pin list. Test results below (this PR + PR #12379):

| target                      | platform_name       | test suite                              | result | elapsed_time (sec) | copy_method |
|-----------------------------|---------------------|-----------------------------------------|--------|--------------------|-------------|
| DISCO_L475VG_IOT01A-GCC_ARM | DISCO_L475VG_IOT01A | tests-mbed_hal_fpga_ci_test_shield-gpio | OK     | 19.18              | default     |
mbedgt: test suite results: 1 OK
mbedgt: test case report:
| target                      | platform_name       | test suite                              | test case                    | passed | failed | result | elapsed_time (sec) |
|-----------------------------|---------------------|-----------------------------------------|------------------------------|--------|--------|--------|--------------------|
| DISCO_L475VG_IOT01A-GCC_ARM | DISCO_L475VG_IOT01A | tests-mbed_hal_fpga_ci_test_shield-gpio | explicit init, input         | 1      | 0      | OK     | 1.57               |
| DISCO_L475VG_IOT01A-GCC_ARM | DISCO_L475VG_IOT01A | tests-mbed_hal_fpga_ci_test_shield-gpio | explicit init, output        | 1      | 0      | OK     | 1.58               |
| DISCO_L475VG_IOT01A-GCC_ARM | DISCO_L475VG_IOT01A | tests-mbed_hal_fpga_ci_test_shield-gpio | generic init, input & output | 1      | 0      | OK     | 1.63               |

@0xc0170 It would be better to first merge PR #12379 before this one.

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 7, 2020

CI started

@mbed-ci
Copy link

mbed-ci commented Feb 7, 2020

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 1
Build artifacts

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 11, 2020

Just in case, restarted CI once referenced PR is on master now.

@mbed-ci
Copy link

mbed-ci commented Feb 11, 2020

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 2
Build artifacts

@0xc0170 0xc0170 added the release-version: 6.0.0-alpha-2 Second pre-release version of 6.0.0 label Feb 11, 2020
@0xc0170 0xc0170 merged commit c1eaf2c into ARMmbed:master Feb 11, 2020
@mergify mergify bot removed the ready for merge label Feb 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-version: 6.0.0-alpha-2 Second pre-release version of 6.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants