Re: Structure for external libraries, HAL


Nashif, Anas
 

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


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

Hi,
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.

Proposal:

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

ext/
hal/
cmsis
qmsi
ksdk
...
lib/
tinycrypt
matt-bar
lwm2m-foo
foo-tls
….

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

disadvantages:
- 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.


Anas
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

(etc)
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:

ext/hal/README:

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

CMSIS - ARM Cortex Microcontroller Software Interface Standard
D: cmsis
T: https://github.com/ARM-software/CMSIS
V: v4.5.0

NXP Kinetis SDK drivers
D: kext
T: http://kex.nxp.com/
V: v2

QMSI - Intel Quark Microcontroller Software Interface
D: qmsi
T: https://github.com/01org/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.

Anas


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

- k

Join devel@lists.zephyrproject.org to automatically receive all group messages.