labapart / polymcu

An open framework for micro-controller software
http://labapart.com/products/polymcu
202 stars 41 forks source link

Peripheral API #1

Open hackrid opened 8 years ago

hackrid commented 8 years ago

Hi,

what kind of peripheral API do you propose for your eco system? what do you think about CMSIS-Driver? is this suitable ?

it provides the interface for some of the most popular peripherals: https://github.com/ARM-software/CMSIS/tree/master/CMSIS/Driver/DriverTemplates

I have only found few implementations of this CMSIS-Drivers. NXP: https://github.com/ARM-software/NXP_LPC/tree/master/LPC4300/CMSIS/Driver "Freescale Kinetis K60 Series Device Support and Examples" from https://www.keil.com/dd2/pack/

STM32: "STMicroelectronics STM32F4 Series Device Support, Drivers and Examples" from https://www.keil.com/dd2/pack/

oliviermartin commented 8 years ago

Hi @hackrid , my intention was actually to use CMSIS-Driver for the peripheral API instead of creating a new API.

At the moment, only the UART CMSIS driver has been implemented for most devices (eg: https://github.com/labapart/polymcu/blob/master/Device/NXP/Driver/uart_debug/Driver_USART.c).

I am doing some work with SPI for a polymcu based project. I have implemented the SPI CMSIS driver for NXP using NXP SDK (ARM tends to write again the CMSIS drivers from scratch). I intend to push this support upstream.

As usual, any contribution are welcome :-)

hackrid commented 8 years ago

Hi @oliviermartin,

thanks for your reply.

On page 31 in this document ARM states, that they will provide the CMSIS-Drivers for

  • NXP: Kinetis K64F, LPC1700, LPC1800, LPC4300
  • Silicon Labs EFM32 Giant Gecko
  • ST Microelectronics STM32F1, STM32F2, STM32F4, STM32F7

Other implementations are vendor driven (Infineon, Atmel)

For the NXP parts, except K64F, you can find the CMSIS-Driver implementation here: https://github.com/ARM-software/NXP_LPC

It's very nice to see ARM moving their development towards github. It is still a bit cluttered to look for software at many different places (different github repos, chip vendors, ARM website, keil.com/dd2/pack, sure more to find....)

best regards

oliviermartin commented 8 years ago

It is still a bit cluttered to look for software at many different places (different github repos, chip vendors, ARM website, keil.com/dd2/pack, sure more to find....)

It is actually what I am trying to solve with PolyMCU:

The idea is to combine the best of each project into a single location.

ARM implementation of CMSIS-Drivers is bypassing the Vendor SDK. So there is a duplication of work between Vendor SDK and ARM CMSIS Driver implementation.

If your own MCU project is taking advantage of ARM implementation of CMSIS-Driver and a Vendor SDK then there is a real risk of driver duplication (that implies bigger firmware binary) and conflicts (that implies some debugging time).