Skip to content

variants: Introduce a digital-pins array to define digital pin #60

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 3 commits into from
Nov 13, 2022

Conversation

soburi
Copy link
Member

@soburi soburi commented Oct 10, 2022

The d0-gpios node format makes it difficult to handle
digital pin configuration from DTS macros.

Introduce the simple array digital-pins instead of g0-gpios to define digital pin
to GPIO port and pin mapping.

Copy link
Collaborator

@DhruvaG2000 DhruvaG2000 left a comment

Choose a reason for hiding this comment

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

Hi,
Thanks alot for this PR!
The idea here does help in making the code a lot more manageable by using arrays rather than hard coded vairables for each gpio, however build seems to fail :

-- Found devicetree overlay: /home/dhruva/zephyrproject/zephyr/../modules/lib/Arduino-Zephyr-API/variants/arduino_nano_33_iot/arduino_nano_33_iot.overlay
unit address and first address in 'reg' (0x6a) don't match for /soc/sercom@42001800/atecc608a@15
unit address and first address in 'reg' (0xa) don't match for /soc/adc@42004000/channel@10
unit address and first address in 'reg' (0xb) don't match for /soc/adc@42004000/channel@11
unit address and first address in 'reg' (0x12) don't match for /soc/adc@42004000/channel@18
unit address and first address in 'reg' (0x13) don't match for /soc/adc@42004000/channel@19

and also a lot of DT expansion errors that are likely due to some syntax issues.
Kindly fix this

@soburi
Copy link
Member Author

soburi commented Oct 13, 2022

Hi, Thanks alot for this PR! The idea here does help in making the code a lot more manageable by using arrays rather than hard coded vairables for each gpio, however build seems to fail :

-- Found devicetree overlay: /home/dhruva/zephyrproject/zephyr/../modules/lib/Arduino-Zephyr-API/variants/arduino_nano_33_iot/arduino_nano_33_iot.overlay
unit address and first address in 'reg' (0x6a) don't match for /soc/sercom@42001800/atecc608a@15
unit address and first address in 'reg' (0xa) don't match for /soc/adc@42004000/channel@10
unit address and first address in 'reg' (0xb) don't match for /soc/adc@42004000/channel@11
unit address and first address in 'reg' (0x12) don't match for /soc/adc@42004000/channel@18
unit address and first address in 'reg' (0x13) don't match for /soc/adc@42004000/channel@19

and also a lot of DT expansion errors that are likely due to some syntax issues. Kindly fix this

I created PR #63.

@DhruvaG2000
Copy link
Collaborator

Hi, Thanks alot for this PR! The idea here does help in making the code a lot more manageable by using arrays rather than hard coded vairables for each gpio, however build seems to fail :

-- Found devicetree overlay: /home/dhruva/zephyrproject/zephyr/../modules/lib/Arduino-Zephyr-API/variants/arduino_nano_33_iot/arduino_nano_33_iot.overlay
unit address and first address in 'reg' (0x6a) don't match for /soc/sercom@42001800/atecc608a@15
unit address and first address in 'reg' (0xa) don't match for /soc/adc@42004000/channel@10
unit address and first address in 'reg' (0xb) don't match for /soc/adc@42004000/channel@11
unit address and first address in 'reg' (0x12) don't match for /soc/adc@42004000/channel@18
unit address and first address in 'reg' (0x13) don't match for /soc/adc@42004000/channel@19

and also a lot of DT expansion errors that are likely due to some syntax issues. Kindly fix this

I created PR #63.

The issue is not only in nano 33 iot but others as well like ble and ble sense:

zephyr/devicetree.h:82:17: error: 'DT_N_S_zephyr_user' was not declared in this scope; did you mean 'DT_N_S_zephyr_user_ORD'?
   82 | #define DT_ROOT DT_N
      |                 ^~~~

Can you try building for each variant locally and check once?

@soburi
Copy link
Member Author

soburi commented Oct 14, 2022

The issue is not only in nano 33 iot but others as well like ble and ble sense:

I couldn't reproduce this issue with ble and ble sense.
Could you tell me using version and command line?

@soburi soburi requested a review from DhruvaG2000 October 14, 2022 04:15
@DhruvaG2000
Copy link
Collaborator

My bad, I had an unclean zephyr repo.
I cleaned up my local and it seems to work ok for nano ble and sense

@DhruvaG2000
Copy link
Collaborator

My bad, I had an unclean zephyr repo. I cleaned up my local and it seems to work ok for nano ble and sense

Just to be sure, I checked out to the latest zephyr release tag:

└─❯ git status
HEAD detached at v3.2.0

and I see the errors all over again, can you check?

@soburi
Copy link
Member Author

soburi commented Oct 15, 2022

and I see the errors all over again, can you check?

This PR is require fdea3c9a change.

I think it should better to track latest develpmenent branch if this repository plans to be a part of zephyrrtos.

The `d0-gpios` node format makes it difficult to handle
digital pin configuration from DTS macros.

Introduce the simple array `digital-pin-gpios` to define digital pin
to GPIO port and pin mapping.

Signed-off-by: TOKITA Hiroshi <[email protected]>
Checking a non-unique pin in digital-pin-gpios to keep consistency
of configuration.

Signed-off-by: TOKITA Hiroshi <[email protected]>
Update the document to follow the change in how to define digital pins.

Signed-off-by: TOKITA Hiroshi <[email protected]>
@soburi soburi force-pushed the digital-pin-gpios branch from d90e986 to 42a9e30 Compare October 18, 2022 22:10
@soburi
Copy link
Member Author

soburi commented Oct 18, 2022

@DhruvaG2000

#63 (comment)

Done.

Copy link
Collaborator

@DhruvaG2000 DhruvaG2000 left a comment

Choose a reason for hiding this comment

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

LGTM Code wise, need to test once on hardware.

@DhruvaG2000
Copy link
Collaborator

Sorry for the delay, Works on hardware too. merging, Thanks!

@DhruvaG2000 DhruvaG2000 merged commit 20a342c into zephyrproject-rtos:main Nov 13, 2022
@soburi soburi deleted the digital-pin-gpios branch November 13, 2022 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants