-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
hwinfo: cleanup API doc and test #22947
hwinfo: cleanup API doc and test #22947
Conversation
2fa5a8b
to
43a159e
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.
We should probably fix the tests/drivers/hwinfo/api/src/main.c to reflect what's documented here.
ie, -ENOTSUP is a valid return and shouldn't assert. An other negative value should assert since that would be a violation of the API.
We only test on boards that have a hardware ID. It it returns -ENOSUP, we have a problem with the implementation. |
If you want to handle that in the test I think its fine, you can add to Kconfig option to tell if a driver is enabled or not and thus distinguish if -ENOSUP is a valid response or not.
|
Than we can also get ride of 'hwinfo' from the board yaml and tests/drivers/hwinfo/api/testcase.yaml and change testcase.yaml filter on |
I'm fine approving and merging the doc update PR, just be aware I'd like to see the other changes in testing for us to have this considered a stable API. |
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.
looks good, one minor tweak on the test yaml
we should also remove hwinfo
from all board.yaml that have it.
@@ -1,4 +1,3 @@ | |||
tests: | |||
drivers.device_id: | |||
tags: driver | |||
depends_on: hwinfo |
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 this filter: CONFIG_HWINFO
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.
On the 'Error returned:' in the test for negative retval, should we make that message a bit more verbose?
'Unexpected negative return value' or something?
169a316
to
670af6b
Compare
Why should we remove it? It states which boards have drivers for hwinfo. |
@galak I think I understand now. The yamls are for tests only and with the new tests, we also test for not supported. That way we can test on every board. |
d51fd8e
to
2a3afae
Compare
Hi @alexanderwachter, I already tested on both boards. I separated values for better reading on the post. I added values that I get using Atmel Studio.
Below I executed a demo inside Atmel Studio to get Device ID.
|
Thanks a lot @nandojve ! |
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.
One minor related change requested, otherwise I'm fine with the change
drivers/hwinfo/Kconfig
Outdated
@@ -21,55 +24,63 @@ config HWINFO_STM32 | |||
default y | |||
depends on SOC_FAMILY_STM32 | |||
select USE_STM32_LL_UTILS |
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.
This could actually be removed since driver only require headers, not utils functions
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.
Thanks. Removed.
82c1b69
to
f76adec
Compare
Before approving: I've tried to run sanitycheck, and there's a strange ERROR message reported (with no impact on final result):
Can you check the ERROR line ? |
@erwango pushed a new version that does not have the error above. |
f76adec
to
4e0ec73
Compare
The test checks for a correct implementation if HWINFO_HAS_DRIVER is set, otherwise it checks for -ENOTSUP return value. Signed-off-by: Alexander Wachter <[email protected]>
Make the NRF hwinfo driver depending on !TRUSTED_EXECUTION_NONSECURE because the FICR registers are not accessible from the non-secure world. Signed-off-by: Alexander Wachter <[email protected]>
Remove all "supported: -hwinfo" definitions from the boards yaml files and documentation. hwinfo can generally be tested on every board because it returns -ENOTSUP if not supported. Signed-off-by: Alexander Wachter <[email protected]>
Include stm32XXxx_ll_utils.h in soc.h for every stm32 SoC, if CONFIG_HWINFO_STM32 is selected. Signed-off-by: Alexander Wachter <[email protected]>
CLOE (Code Loop Optimization) does not exist on SAM3x. Make the EEFC_FMR_CLOE disable depending on CONFIG_SOC_SERIES_SAM3X. Signed-off-by: Alexander Wachter <[email protected]>
This commit adds Device-Tree instances of the Flash controller to the SAM3X, SAM4E and SAM4S series. The Flash-Controller is used to get the unique device identifier. Signed-off-by: Alexander Wachter <[email protected]>
@jhedberg this should be ready |
@carlescufi ok, I'll merge once CI completes. |
@jhedberg the test are timing out. tests/drivers/hwinfo/api/drivers.device_id tests are all green. |
Yes, I've had to restart Shippable a few times because of this. Fingers crossed that it wont time out again. |
Change the doxygen doc from "negative on error" to -ENOSUP only.
Enhance testing.
Fix build-errors on NRF53, STM32H7, SAM3x, SAM4e, SAM4s
Fixes #22979