zephyrproject-rtos / gsoc-2022-arduino-core

Arduino Core Zephyr Module (GSoC 2022 Project)
Apache License 2.0
43 stars 11 forks source link

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

Closed soburi closed 1 year ago

soburi commented 1 year ago

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.

soburi commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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?

DhruvaG2000 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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.

soburi commented 1 year ago

@DhruvaG2000

https://github.com/zephyrproject-rtos/gsoc-2022-arduino-core/pull/63#issuecomment-1282454907

Done.

DhruvaG2000 commented 1 year ago

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