You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mynewt.apache.org by Sterling Hughes <st...@apache.org> on 2016/09/14 17:23:51 UTC

Merge of sterly_refactor -> develop in _1 WEEK_

Hey,

I think sterly_refactor is getting pretty close to ready.  Chris & Vipul 
are working on some final items (updating to Will’s latest SPI 
changes, and finishing the ADC driver for the STM32F4 boards.)

I’d like to merge sterly_refactor into develop in 1 week, this will 
likely lead to some instability in develop for a week or so.  IMO, 
that’s consistent with our branching strategy where “master” is 
designed to be stable latest.  SO, if you’re following along with 
develop: be aware, some instability will be introduced, and please 
switch to master if you want to avoid it (now is a good time.)

Changes in sterly_refactor:

- Import of chip vendor packages in an “ext” directory, and a new 
package type of SDK.
	- These include newt changes to support this
	- An example of a driver pack import is the Nordic pack here: 
https://github.com/apache/incubator-mynewt-core/tree/sterly_refactor/hw/mcu/nordic
	- you can find the files in src/ext/*, and the compile definitions in 
pkg.yml

- Introduction of a drivers framework:
	- Devices: 
https://github.com/apache/incubator-mynewt-core/blob/sterly_refactor/libs/os/src/os_dev.c
	- Example drivers: 
https://github.com/apache/incubator-mynewt-core/tree/sterly_refactor/drivers

- Refactoring of the HAL:
	- As a refresher, previously the HAL was meant to be higher layer 
abstraction of HW.  We’ve refactored it to be lower-layer, and base 
peripheral abstraction.  The “drivers” layer can then provide 
friendly abstractions, and leverage the base HAL services.
	- The main benefit of the HAL is that it resides with the MCU, and is a 
core set of services that will be implemented with every MCU that we 
support.
	- An good example of a driver using the HAL to provide extra 
functionality is the uart driver above, which uses HAL GPIO and UART to 
provide multiple serial ports on the NRF52 (but allowed on other 
platforms too.)
	- The new HAL is here: 
https://github.com/apache/incubator-mynewt-core/tree/sterly_refactor/hw/hal/include/hal
		- After commit we plan on moving CPUtime to the OS, and adding a HAL 
timer library

- System Initialization
	- Chris has moved system init from the App to the BSP, and replaced 
“features” with a system configuration framework with a 
configuration framework.
	- A good example file is located here: 
https://github.com/apache/incubator-mynewt-core/blob/sterly_refactor/hw/bsp/nrf52dk/pkg.yml

- Low power framework
	- The drivers have suspend/resume functions to save and restore state
	- A HAL has been added to HAL BSP to provide hooks for system states: 
https://github.com/apache/incubator-mynewt-core/blob/sterly_refactor/hw/hal/include/hal/hal_bsp.h

- Addition of sys/defs and standardized error codes: 
https://github.com/apache/incubator-mynewt-core/tree/sterly_refactor/sys/defs


Post merge, I think there are a few other things I’d like to clean up:

- Directory re-org: as previously mentioned, json and os should not be 
siblings :-)

- C++ header guards (Tim’s latest work)

- Second stage of sysinit work to centralize flash layout definitions 
and boot loader options.

- Addition of HAL timer, and move of CPUtime to the OS

- Replace current error codes with the sys/defs package error codes 
where appropriate, and make sure that is properly integrated.

best,

Sterling