Skip to content

Pinmap extensions #9449

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

Merged
merged 14 commits into from
Feb 11, 2019
Merged

Pinmap extensions #9449

merged 14 commits into from
Feb 11, 2019

Conversation

c1728p9
Copy link
Contributor

@c1728p9 c1728p9 commented Jan 22, 2019

Description

Add pinmap getters and utility functions, along with form factor information in preparation for enhanced testing.

Pull request type

[ ] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change
[x] New feature

Release Notes

Added pinmap support to the HAL API. For more information see the porting targets docs page - https://os.mbed.com/docs/mbed-os/latest/porting/porting-targets.html.

@c1728p9
Copy link
Contributor Author

c1728p9 commented Jan 22, 2019

This PR depends on #9438

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 22, 2019

CI started to test this

},
"default-form-factor": {
"help": "Default form factor of this board taken from supported_form_factors. This must be a lowercase string",
"value": "arduino"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hi
Default value should be "null"...?
And specified at target level?
Which is already done:
"supported_form_factors": ["ARDUINO"]

Note also, that this ARDUINO means Arduino Uno, some STM32 targets are Arduino Nano compatible.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Default value should be "null"...?
And specified at target level?

Yeah, I'll make those changes.

Which is already done:
"supported_form_factors": ["ARDUINO"]

The goal with default-form-factor is to allow a default to be specified when multiple form factors are present, such as ["ARDUINO", "MORPHO"] with the NUCLEO_F401RE.

Note also, that this ARDUINO means Arduino Uno, some STM32 targets are Arduino Nano compatible.

I didn't realize this. What are your thoughts @jeromecoutant on having a separate ARDUINO_NANO for those targets? That way supported_form_factors represents the form factors that can be physically connected to a board.

@mbed-ci
Copy link

mbed-ci commented Jan 22, 2019

Test run: FAILED

Summary: 6 of 7 test jobs failed
Build number : 1
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_mbed2-build-ARM
  • jenkins-ci/mbed-os-ci_mbed2-build-GCC_ARM
  • jenkins-ci/mbed-os-ci_mbed2-build-IAR
  • jenkins-ci/mbed-os-ci_build-IAR
  • jenkins-ci/mbed-os-ci_build-ARM
  • jenkins-ci/mbed-os-ci_build-GCC_ARM

@bulislaw
Copy link
Member

How we'll test the extensions to HAL APIs?

@c1728p9
Copy link
Contributor Author

c1728p9 commented Jan 22, 2019

@bulislaw these extensions will be used to test hardware peripherals. Any bugs in the pinmaps will show up as a peripheral test failure. Does that answer your question?

@@ -34,6 +34,10 @@
"mpu-rom-end": {
"help": "Last address of ROM protected by the MPU",
"value": "0x0fffffff"
},
"default-form-factor": {
Copy link
Member

Choose a reason for hiding this comment

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

Hm you are not setting default value here, but in the code sort of circumventing the config system and hiding the fact. Wouldn't it be cleaner to set it here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Setting the default here to arduino would also be misleading since some boards are not in the arduino form factor. Because of this @jeromecoutant suggested keeping this null and specifying it at the target level, which I think is a good idea.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Adding this new config is OK.
But who is going to replace the supported_form_factors line by this new config?
Why you are mixing both configurations ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hi
No answer for this question?
A new config is created, but never used...!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @jeromecoutant sorry for the late response, I just noticed your question. The default-form-factor is intended to be used with supported_form_factors, not to replace it. Some boards may have multiple form factors that are testable and this value is intended to let you pick the one to test with. This is currently not needed by any targets so it is not used. I added it here for completeness. If you are concerned with it I can remove it an submit it as a PR only when it is needed. Let me know if you have a preference on this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jeromecoutant even though this PR has been merged please provide any feedback you may have. I'll address any changes needed in a separate PR.

@c1728p9 c1728p9 force-pushed the pinmap-extension branch 2 times, most recently from 7c40fde to 21055be Compare January 23, 2019 22:42
@c1728p9
Copy link
Contributor Author

c1728p9 commented Jan 23, 2019

I created a docs PR to go along with this here:
ARMmbed/mbed-os-5-docs#930

@cmonr
Copy link
Contributor

cmonr commented Jan 23, 2019

Testing with CI

@mbed-ci
Copy link

mbed-ci commented Jan 24, 2019

Test run: FAILED

Summary: 6 of 8 test jobs failed
Build number : 2
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_mbed2-build-IAR
  • jenkins-ci/mbed-os-ci_mbed2-build-GCC_ARM
  • jenkins-ci/mbed-os-ci_mbed2-build-ARM
  • jenkins-ci/mbed-os-ci_build-ARM
  • jenkins-ci/mbed-os-ci_build-GCC_ARM
  • jenkins-ci/mbed-os-ci_build-IAR

#include "PeripheralPins.h"

//*** Common form factors ***
#ifdef TARGET_FF_ARDUINO
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should be somthing like MBED_CONF_TARGET_DEFAULT_FORM_FACTOR==ARDUINO ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was thinking that all the form factors a board supports can be present at the same time. So for example ST boards can have both TARGET_FF_MORPHO and TARGET_FF_ARDUINO. Setting the value of MBED_CONF_TARGET_DEFAULT_FORM_FACTOR would just pick one of these to be used during testing. What do you think @jeromecoutant

Copy link
Collaborator

Choose a reason for hiding this comment

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

To be honest, for me, TARGET_FF_MORPHO and TARGET_FF_ARDUINO are not used at all...

So be free to make the changes you need :-)

@c1728p9
Copy link
Contributor Author

c1728p9 commented Jan 24, 2019

Based on the test results, a lot of targets are failing because pinmaps are not publicly exposed. For example the LPC1768 has its serial pinamp static to serial_api.c. To address this I'm removed the weak definitions of the pinmap getter functoins from mbed_pinmap_default.c and have instead added them to each target. This simplifies things since the table name doesn't matter and there is no weak pinmap getter function to worry about.

@cmonr
Copy link
Contributor

cmonr commented Jan 24, 2019

Testing with CI

Add pinmap tables to the NRF5X families to allow testing.
Add testing pinmaps to the Ameba along with fixing build errors.
Add pinmap tables to the LPC15XX and LPC8XX families to allow testing.
Add a test which sanity checks all pinmaps.
@c1728p9
Copy link
Contributor Author

c1728p9 commented Feb 8, 2019

Rebased on top of master and fixed merge conflicts

@c1728p9
Copy link
Contributor Author

c1728p9 commented Feb 8, 2019

Re-triggered CI

@mbed-ci
Copy link

mbed-ci commented Feb 8, 2019

Test run: SUCCESS

Summary: 12 of 12 test jobs passed
Build number : 15
Build artifacts

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 11, 2019

Functionality change

One last addition, please add Release notes section , following https://os.mbed.com/docs/mbed-os/v5.11/contributing/workflow.html#functionality-change

cc @AnotherButler to review release notes section

@0xc0170 0xc0170 merged commit 8f932a4 into ARMmbed:master Feb 11, 2019
@c1728p9 c1728p9 deleted the pinmap-extension branch February 11, 2019 17:47
@c1728p9 c1728p9 mentioned this pull request Feb 12, 2019
LMESTM added a commit to LMESTM/mbed that referenced this pull request Mar 12, 2019
This is required since PR ARMmbed#9449
commit
"Add HAL API for analog in pinmap"
LMESTM added a commit to LMESTM/mbed that referenced this pull request Mar 15, 2019
This is required since PR ARMmbed#9449
commit
"Add HAL API for analog in pinmap"
LMESTM added a commit to LMESTM/mbed that referenced this pull request Mar 29, 2019
This is required since PR ARMmbed#9449
commit
"Add HAL API for analog in pinmap"
0xc0170 pushed a commit that referenced this pull request Apr 5, 2019
This is required since PR #9449
commit
"Add HAL API for analog in pinmap"
@amq amq mentioned this pull request Feb 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.