Ports: Arduino MKR WIFI 1010 #10656
-
Hello all! This is a great project, so thanks for the hard work everyone! I was curious if it was reasonable to create a port of micropython for the Arduino MKR WIFI 1010. If so, I'm happy to take on the challenge of making the new board and pins files and submitting the PR. It seems as if it should be straightforward as the MCU (SAMD21) and Wifi chipset (Nina-w102) are already both supported by micropython. Anyone have any other gotchas or reasons why this shouldn't work? Store Link: https://store-usa.arduino.cc/products/arduino-mkr-wifi-1010 |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 1 reply
-
I started working through the pin assignments here in my fork: keenanjohnson@33fdc04 |
Beta Was this translation helpful? Give feedback.
-
Adapting the Pins should be easy, and the firmware should work straight away. There is already support for the Nina UBLOX module in the RP2040 port. So it might be possible to port that. But the show stopper for WiFi is the lack of available flash space, which is already being fully used. The only way to gain more space is reducing the size of the file system or dropping some MicroPython modules. But even that would not gain sufficient space for a good WiFi support, not to mention the lack of RAM. Unfortunately the Arduino board does not provide additional flash on the board like the Adafruit boards do. And I do not know why Arduino uses the SAMD21G18 for a relatively expensive board instead of the SAMD51G19, which offers way more Flash & RAM. |
Beta Was this translation helpful? Give feedback.
-
A word on your pins.csv file: define every GPIO only once and do not add conflicting assignments, like the same Dx for different GIO pins. That will just create confusion. A good starting point are as well the GENERIC boards. Pre-built binaries are here: https://github.com/robert-hh/Shared-Stuff/tree/master/samd_firmware, and I added the generic board definitions. If you get a REPL prompt with these, than little adaption is required. |
Beta Was this translation helpful? Give feedback.
-
Thanks very much for the help! I didn't know about those generic binaries and I will certainly try that out. My pins file I linked above is certainly still a draft haha. Hmmm I hadn't considered how much space the wifi drivers may take, so thanks for pointing that out! |
Beta Was this translation helpful? Give feedback.
-
Update: Flashing the Adafruit bootloader as described here and then moving the generic binary linked above allowed me to successfully enter the REPL on the MKR 1010. |
Beta Was this translation helpful? Give feedback.
-
That sounds good. The only drawback with the generic build is the lack of board names for pins. So have to use the CPU names or numbers, like |
Beta Was this translation helpful? Give feedback.
-
Is there a guide somewhere for how to disable the modules to try and get the size down to a reasonable enough limit to configure the wifi module? |
Beta Was this translation helpful? Give feedback.
-
The modules are enabled or disabled in the repective mpconfigxxx.h, For the samd port, these are mpconfigboard.h, mpconfigmcu.h, mpconfigport.h and py/mpconfig.h, in that order. To see all configurable modules you have to look into py/mpconfig.h. But WiFi requires a loot of flash. While working on the port, I noted the size of some features.
So you could drop the math lib (sin, cos, ...), gaining 8k. There is a dedicated flag in mpconfigmcu.h for that. Or you can shrink the size of the flash file system, which is 64 K at the moment. That can be done in boards/samd21x18a.ld. With the PR #10233 comes a simple flag to set the code size in the mpconfigboard.mk file per board. It's a pity that Arduino did not add an extra flash chip to their relatively expensive board. |
Beta Was this translation helpful? Give feedback.
Adapting the Pins should be easy, and the firmware should work straight away. There is already support for the Nina UBLOX module in the RP2040 port. So it might be possible to port that. But the show stopper for WiFi is the lack of available flash space, which is already being fully used. The only way to gain more space is reducing the size of the file system or dropping some MicroPython modules. But even that would not gain sufficient space for a good WiFi support, not to mention the lack of RAM. Unfortunately the Arduino board does not provide additional flash on the board like the Adafruit boards do. And I do not know why Arduino uses the SAMD21G18 for a relatively expensive board inst…