-
Notifications
You must be signed in to change notification settings - Fork 2.1k
boards/arduino-mkrzero: add initial support #6881
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
Conversation
|
And this PR is based on |
8411e1b to
3027ae1
Compare
|
since #6666 has been merged, I rebased this one. Tested mkr1000, still works. |
| * @name SD Card device configuration | ||
| * @{ | ||
| */ | ||
| #define SDCARD_SPI_PARAM_SPI (SPI_DEV(1)) |
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 is the part, I'm not totally sure of. @haukepetersen or @vincent-d any comments?
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.
Depends on what the question is... Does the arduino-mkrzero come with an on-board SD-card slot? If yes, then this looks valid to me (as long as the SD-card slot is connected to the pins mapped for SPI_DEV(1)...).
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.
It should be ok, regarding the specs. I just don't know what CD1 is on the SD card reader.
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.
Could be "card detect"?
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.
Could be "card detect"?
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, googling points toward this direction. I added a define for this pin below in the file.
|
before merging this PR, I would however like to see a better solution for the |
Yes, I'm interested in looking into this except if you feel very motivated. |
|
done: #7068 |
| .clk_pin = GPIO_PIN(PA, 13), | ||
| .miso_mux = GPIO_MUX_D, | ||
| .mosi_mux = GPIO_MUX_D, | ||
| .clk_mux = GPIO_MUX_D, |
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 noticed my silly mistake while testing WINC1500 WiFi module. 🤕 Could you please change the MUX pads to:
.miso_mux = GPIO_MUX_C,
.mosi_mux = GPIO_MUX_C,
.clk_mux = GPIO_MUX_C,Thank you.
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.
no problem, directly squashed and pushed
32ab02a to
65dcbd4
Compare
| }, | ||
| { | ||
| .dev = &SERCOM2->SPI, | ||
| .miso_pin = GPIO_PIN(PA, 15), |
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 pin definition for the second SPI is different from mkr1000. I'll have to provide the SPI configuration for each boards.
|
now that #7068 is merged, would you mind to rebase and make use of it? |
I'm on it |
5b3281a to
b43879e
Compare
|
@astralien3000, I pushed a fix regarding the PWM: pin ~2 and ~3 are working but I couldn't find the correct conf for pin ~4 and ~5. So there's only 2 available PWM pins in the default configuration. Regarding the periph_timer test, I didn't test but it should work as I didn't change it and is working (normally) with mkr1000. |
|
@astralien3000, if you have some time can you give another try to this one ? |
|
fac316c to
ad88779
Compare
|
@astralien3000, thanks for testing again. Regarding the timer test issue, I fixed it: by default mkrzero use the In the mean time, I also fixed the second spi periph configuration which was wrong. Directly squashed and rebased. Can you test again ? |
|
Yes ! Now it works ! |
|
@haukepetersen, this one is ready now (and tested). Would be great if you could approve it (and merge ;)) ! |
9e6168d to
4c35afe
Compare
haukepetersen
left a comment
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.
Some minor things left, almost there :-)
| #define ARDUINO_PIN_A5 GPIO_PIN(PA, 6) /* AIN6 */ | ||
| #define ARDUINO_PIN_A6 GPIO_PIN(PA, 7) /* AIN7 */ | ||
| /** @} */ | ||
| /** @ */ |
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.
any reason for removing the }?
|
|
||
| /** | ||
| * @name Mapping of MCU pins to Arduino pins | ||
| * @name Mapping of MCU pins to Arduino pins |
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.
Indention off by one space.
| */ | ||
| #define XTIMER TIMER_0 | ||
| #define XTIMER_CHAN (0) | ||
| /** @} */ |
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.
please remove this block - no need to re-define the default configuration
| @@ -1,5 +1,5 @@ | |||
| /* | |||
| * Copyright (C) 2016 Inria | |||
| * Copyright (C) 2017 Inria | |||
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.
Actually, I think convention is to use 2016-2017 when editing. Applies to many files of this PR
|
@haukepetersen, comments addressed. |
haukepetersen
left a comment
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.
ACK
|
all green -> go |
And factorize code with arduino-mkr1000 since these boards are very similar.
The Arduino MKRZERO uses the second SPI to connect a SD card device, I configured it to use the one available in RIOT. This is not yet tested though.
I also noticed that there's a third one in the family: Arduino MKRFOX1200 that offers a SigFox compatible antenna.