zephyrproject-rtos / gsoc-2022-arduino-core

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

variants: add support for arduino_mkrzero #36

Closed DhruvaG2000 closed 1 year ago

DhruvaG2000 commented 2 years ago

Adds support for the arduino mkr zero board. Tested with LED_Blink sample. I am not sure about the inbuilt LED pin number though, hence this pinmap just uses D7 for demo purposes

Signed-off-by: Dhruva Gole goledhruva@gmail.com

DhruvaG2000 commented 2 years ago

@szczys can you help with inbuilt LED please? I tried d22_gpios = < &portb 8 GPIO_ACTIVE_LOW>; but did not work

DhruvaG2000 commented 2 years ago

However when I add <4 0 &portb 8 0>, in the connector then the D4 pin works as internal LED... I am a little confused regarding what is hapenning. Same when I add

               <22 0 &portb  8 0>;  /* BUILTIN LED */

It doesn't work when I do

led0 = <&arduino_mkr_header 22 0>;

in my overlay

Am I missing something here?

szczys commented 2 years ago

@DhruvaG2000

I tried d22_gpios = < &portb 8 GPIO_ACTIVE_LOW>; but did not work

I am also confused. I looked at the schematic, the port and pin look correct but the flag should be GPIO_ACTIVE_HIGH.

image

However, when you look at the DTS file in Zephyr it's a very different story. They're using pin 17 for the LED:

https://github.com/zephyrproject-rtos/zephyr/blob/e7591615724894a2319ea2c09d7eb21b4263fbf0/boards/arm/arduino_zero/arduino_zero.dts#L32-L35

Maybe give that a try and see if it works? I suspect Arduino and Zephyr handle the pin mux differently which results in different naming scheme for the pins, but I'm only guessing.

DhruvaG2000 commented 2 years ago

I should point out here, that the link you sent is for the arduino_zero and not the arduino_mkr_zero. There are changes in those 2 boards although I guess the chip remains the same. I am in talks with @galak on the discord channel, let's see if we can figure something out on this later perhaps, for now we should probably not include either the inbuilt LED and advise user to use an external one?

On Tue, Aug 23, 2022 at 11:56 PM Mike Szczys @.***> wrote:

@DhruvaG2000 https://github.com/DhruvaG2000

I tried d22_gpios = < &portb 8 GPIO_ACTIVE_LOW>; but did not work

I am also confused. I looked at the schematic, the port and pin look correct but the flag should be GPIO_ACTIVE_HIGH.

[image: image] https://user-images.githubusercontent.com/367685/186235272-250b92b8-8397-4d6f-8fb5-3b4cb51d23a7.png

However, when you look at the DTS file in Zephyr it's a very different story. They're using pin 17 for the LED:

https://github.com/zephyrproject-rtos/zephyr/blob/e7591615724894a2319ea2c09d7eb21b4263fbf0/boards/arm/arduino_zero/arduino_zero.dts#L32-L35

Maybe give that a try and see if it works? I suspect Arduino and Zephyr handle the pin mux differently which results in different naming scheme for the pins, but I'm only guessing.

— Reply to this email directly, view it on GitHub https://github.com/zephyrproject-rtos/gsoc-2022-arduino-core/pull/36#issuecomment-1224553314, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJ2S3QGOZTCNYZN72NUMWVTV2UJVLANCNFSM57CTEQ4A . You are receiving this because you were mentioned.Message ID: @.***>