Skip to content

Scripted tool to generate initialization code for the ATSAMD51 MCU + low level drivers and other goodies

License

Notifications You must be signed in to change notification settings

alkgrove/initmaker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 

Repository files navigation

initmaker

This is a simplified driver set for the ATSAMD5x processor and SystemInit creator scripts for the Microchip (Atmel) ATSAMD5x chips. This is intended for developers of the Microchip ATSAMD5x processor programming in C using arm-none-eabi-gcc. For more information, see www.alkgrove.com. It needs a bash shell environment and Gnu awk.

Updates

Added initialization for QSPI, RTC. Added tags (#define macros) for SERCOM, DMAC and TC/TCC Added an option (-s) to build a summary file of the system init. This generates .txt.
Fixed the I2CM recovery of bad bus faults. Various bug fixes.

Description

For ATSAMD5x and ATSAME5x processor families, Microchip provided ASF4 for high and low level drivers, register description includes, initialization code, startup code and high level example code. The initialization was customized through the start.atmel.com website. These processors have sophisticated clocking scheme, multiuse serial ports, event system, configurable logic blocks and more. Initialization of the MCU was significantly more complex than it has been in the past and start.atmel.com was Microchips answer.

start.atmel.com uses graphical interface and menu selections to customize the initialization code. This lacked the flexibility and accessibility that we needed for development, so I came up with initmaker.

initmaker, through a series of bash/awk scripts, takes a terse configuration file and converts it into a rather large SystemInit procedure. It uses a basic macro expansion parser that takes the configuration properties with code template files to create chunks of code that make up the SystemInit().

I've pulled over the ASF4 register description includes and cleaned them up a bit. This could have been done pure pointer arithmetic but I feel the use of static inline functions to describe this is easier to read. The ASF4 hri includes after some severe bash/awk translation does provide this and are included. The files marked as beta are tested in practice, the ones marked as alpha compile without error but haven't been tested.

I have included some higher level routines for a few of the peripherals.
The directory structure is:
chip -> inc ; static inline functions severely modified from ASF4 hri includes
chip -> inc -> component ; from ASF4
chip -> inc -> instance ; from ASF4
chip -> inc -> pio ; from ASF4
chip -> src ; specific higher level drivers and startup_samd51.c initmaker -> documentation -> ATSAMD5XE5X pins.xlsx ; excel spreadsheet of devices pins and functions
initmaker -> documentation -> Initmaker.pdf ; pdf file documentation for initmaker
initmaker -> scripts -> initmaker.sh ; this runs SystemInit creator - see documention
initmaker -> templates ; source code with markup language for initmaker

For development, you will also need CMSIS

Notes

In updating my software, I see some busy body changed awk. This broke a lot of code by generating warnings that were not there before. Doesn't actually change the behavior of the code but the warnings hide real errors and so I fixed the cosmetic issues to avoid the warnings. I thought using a program as old as awk, that we could avoid this meddling but apparently its not in the programmers nature to leave well enough alone.

About

Scripted tool to generate initialization code for the ATSAMD51 MCU + low level drivers and other goodies

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published