Re: Structure for external libraries, HAL

Nashif, Anas

On 21 May 2016, at 10:53, Kumar Gala <kumar.gala(a)> wrote:

On May 19, 2016, at 11:48 AM, Nashif, Anas <anas.nashif(a)> wrote:

As you are probably already aware, we have a few changes in review that add external components to Zephyr, especially the CMSIS headers needed for porting more Cortex-M MCUs and board.
Zephyr already has some external components. Some will need to move to the new proposed location outlined below.


create a top level directory for all external components and headers with the following structure (slightly modified):


we should be able to add more 2nd level categories under ext/, we might consider having drivers for example for drivers from vendor SDKs that are well tested and verified.

The advantages of having all the code in one place:
- easy to update and maintain
- files of the same license and from the same source all in one location
- can be excluded from zephyr style checks easily (to make CI happy)
- no contamination with original zephyr code

- the code will be in a location different from where it is being used and referenced
- need to create cross references across the tree
- …

We plan to make this final by next week. If you have any concerns or other suggestions please raise them now.

We should probably document rules on import in ext/README. Mostly around documenting to origins of the code import (i.e., what should be in a commit message, what meta file that documents the source of the code, what version or SHA/tag, etc).

Also, probably having a READMEs in ext/hal & ext/lib that has a one liner or two about what things are:

kext - NXP Kinetis SDK drivers
qmsi - Intel Quark Microcontroller Software Interface
cmsis - ARM Cortex Microcontroller Software Interface Standard

Yeah, README is fine here, I would also add this to the documentation, including usage and policies etc for external modules.

The other option would be a file kinda structured like MAINTAINERS in top level ext/hal & ext/lib that gets updated on imports:


D: directory
T: (source tree repo)
V: (repo version/tag info)

CMSIS - ARM Cortex Microcontroller Software Interface Standard
D: cmsis
V: v4.5.0

NXP Kinetis SDK drivers
D: kext
V: v2

QMSI - Intel Quark Microcontroller Software Interface
D: qmsi
V: v1.0.1
I would add those to the top level MAINTAINERS file we are planning to add. I do not thing we need another MAINTAINERS file.


(Needs some hashing out on the details related to how to handle version info/tags/SHAs)

- k

Join to automatically receive all group messages.