Coder Social home page Coder Social logo

alkgrove / initmaker Goto Github PK

View Code? Open in Web Editor NEW
16.0 6.0 1.0 11.11 MB

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

Home Page: http://www.alkgrove.com

License: BSD 3-Clause "New" or "Revised" License

C 94.73% C++ 0.20% Makefile 0.14% Python 0.12% Awk 3.27% Shell 1.54%
samd51 atsamd51 systeminit sdo sdhc drivers d51 atmel-sam initialization pinout

initmaker's Introduction

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.

initmaker's People

Contributors

alkgrove avatar evandnautics avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

evandoiron

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.