-
Notifications
You must be signed in to change notification settings - Fork 136
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
Support for ATSAM arm processors #189
Comments
modm relies heavily on the data in modm-devices to generate the HAL. In order to properly support the Atmel SAM platform, I would first need a data source similar to CubeMX with machine-readable data. (See Introducing modm-devices blog post). Otherwise you'd go crazy trying to manually add all this data to a similar degree of completeness and correctness as with the existing AVR and STM32 platforms and it wouldn't really be maintainable for us either. Do you know of some configuration GUI or similar data source for Atmel SAMs? |
Bullseye: http://packs.download.atmel.com has SAM* data as well. We already use this for AVR, a quick glance over the |
yes the packs link contains the |
I think the |
I'll give it a shot. Looks like I need to do two things:
I'll probably start with the D21 since the featherD21 is very easy to get and cheap compared to all my custom L21 hardware. If I hit a wall I will post here. |
Does this also include Atmel SAM3X8E ARM Cortex-M3 found in Due? |
I don‘t see a reason why the modm-devices parser couldn‘t parse ALL pack files of ALL SAM* devices. The formats are pretty much all the same (but the devil is in the detail like with the STM32 Cube Data). What the extend of the HAL implementation will be, depends heavily on the fragmentation of the hardware. But modm is very modular, so we can build that up gradually. I‘d focus first on startup, then GPIO, then UART, then the rest. |
So, yes, why not? Once we have the modm-devices data, everything becomes significantly easier to port. Note that I recently separated the Cortex-M core from the STM32 core, in anticipation of additional Cortex-M based vendors: #176. |
Please don't hesitate to ask for help if your stuck, since my code is not particularly Pythonic or well documented. |
Header repo similar to modm-io/cmsis-header-stm Also packs contain separate trees for each variant. For example SAMD21 has SAMD21A. SAMD21B, SAMD21C... etc. I did diffs on the folders and there are differences so I just made each variant a top level folder. fork of modm-devices |
Ok, we now have data, lets format that into some code using lbuild. Here's a checklist to add a new Cortex-M platform to modm:
The startup code is shared for ARM Cortex-M platforms in the The Cortex-M module provides you with predefined sections to assemble the linkerscripts.
This module provides the CMSIS header files and CPP defines for the specific device.
The spinning (blocking) delay functions While it is not necessary to implement system clock abstractions right away, it is very useful
Implement the very basic Note that the existing implementations implement
Get it to compile, then get it to program with OpenOCD using Once you can program, you can also You should now be able to blink an LED. *slow clap*
PS: There is a lot of duplicate Python code in modm that should be moved to modm-devices. |
Btw, I ordered a different SAMD21 breakout board, so I can test your port and add another board. |
Me too! Great to see some porting effort here! I just received an NXP board ... BTW, I get a
when I do a |
I've done a bunch of work (CircuitPython) with the SAMD21 and SAMD51 and can help answer questions if folks have them. |
Thanks for reminding me about this work, @tannewt! I think all the hard stuff for SAMD support is already done, including modm-devices data, so I will work on merging modm-devices and cleaning up the PR and merging it too in the current state. Then others can continue porting GPIO/UART/etc without having to deal with the foundations too. |
The Atmel (Microchip) ATSAM line of ARM microprocessors are very nice microcontrollers. The SAMD21 is used on Arduino boards. Adafruit has SAMD21 and SAMD51 based feather boards. Peripherals are conceptually similar to the nicer AVR peripherals (SERCOM, timers, etc) and there is a lot of code/pinout compatibility between models.
I actually use the SAML21 processor on a few projects, which is a very low power M0+. I build very low power data-loggers for physiological experiments, and it seems like my use case has a large overlap with modm.
Perhaps I can help add support for these processors?
The text was updated successfully, but these errors were encountered: