-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Pinmap extensions #9449
Conversation
This PR depends on #9438 |
a8b907e
to
e124309
Compare
CI started to test this |
targets/targets.json
Outdated
}, | ||
"default-form-factor": { | ||
"help": "Default form factor of this board taken from supported_form_factors. This must be a lowercase string", | ||
"value": "arduino" |
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.
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.
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.
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.
Test run: FAILEDSummary: 6 of 7 test jobs failed Failed test jobs:
|
How we'll test the extensions to HAL APIs? |
@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? |
e124309
to
165eee3
Compare
@@ -34,6 +34,10 @@ | |||
"mpu-rom-end": { | |||
"help": "Last address of ROM protected by the MPU", | |||
"value": "0x0fffffff" | |||
}, | |||
"default-form-factor": { |
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.
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?
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.
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.
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.
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 ?
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.
Hi
No answer for this question?
A new config is created, but never used...!
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.
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.
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.
@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.
7c40fde
to
21055be
Compare
I created a docs PR to go along with this here: |
Testing with CI |
Test run: FAILEDSummary: 6 of 8 test jobs failed Failed test jobs:
|
#include "PeripheralPins.h" | ||
|
||
//*** Common form factors *** | ||
#ifdef TARGET_FF_ARDUINO |
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.
Should be somthing like MBED_CONF_TARGET_DEFAULT_FORM_FACTOR==ARDUINO ?
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 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
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.
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 :-)
21055be
to
0ff0bde
Compare
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. |
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.
60fe934
to
d5892ce
Compare
Rebased on top of master and fixed merge conflicts |
Re-triggered CI |
Test run: SUCCESSSummary: 12 of 12 test jobs passed |
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 |
This is required since PR ARMmbed#9449 commit "Add HAL API for analog in pinmap"
This is required since PR ARMmbed#9449 commit "Add HAL API for analog in pinmap"
This is required since PR ARMmbed#9449 commit "Add HAL API for analog in pinmap"
This is required since PR #9449 commit "Add HAL API for analog in pinmap"
Description
Add pinmap getters and utility functions, along with form factor information in preparation for enhanced testing.
Pull request type
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.