Hi Wayne,

On 4/23/16 1:55 PM, Wayne Keenan wrote:
Cool, although I'm sticking to 'latest' for the moment as I've gotten
carried away into being right in the middle of something...

Basically, I have a tiny reptilian hissing out 'Hello World!' to the
Newt UART console on the nrf52 just after Nimble's BLE advertising starts.
It just a very early hatchling/POC, but at some point I'd like to make
the jump from building a standalone/isolated Newt app to being able to
provide a Newt library (1),  and then further down the road perhaps
being able to provide another scripting language to sit alongside LAU in
newt (2).


cool!

Any pointers for the journey down that path would be greatly received.


re [1]: every project can be redistributed as a repository. In order for newt to download a project, and install it, you need a repository.yml file in the master git branch. The repository contains both the library, and your applications, so you can test your library and release it. A good example of this is the Arduino Zero support that Runtime distributes separately from Mynewt:

https://github.com/runtimeinc/mynewt_arduino_zero/tree/develop

If you look at the develop branch here, you'll see there is a program arduino_test, which is a useful little shell app that allows you to set/get I/O on the Arduino Zero boards.

Somebody can either directly git clone this as a project, and compile the arduino test application-- or, they can include it remotely as a library by placing the following in their project.yml:

repository.mynewt_arduino_zero:
    type: github
    vers: 0-latest
    user: runtimeinc
    repo: mynewt_arduino_zero

The way newt resolves that, is it goes to the master branch of mynewt_arduino_zero, and pulls the repository.yml file: https://github.com/runtimeinc/mynewt_arduino_zero/blob/master/repository.yml

It then says, "oh, you want 0-latest, that resolves to a specific version 0.0.0, which resolves to a branch: mynewt_arduino_zero_0_0_0_tag." If you wanted 0-dev it would resolve to 0.0.1, and then develop.

Once you add this repository.yml file to your project, you can then redistribute it as newt.

In the build system, you can point to the individual packages within the repository to stitch together the dependencies. You do that with a repository descriptor, so, for example with the project.yml above, you would reference the arduino zero bsp in a target by using:

$ newt target set my_target bsp=@mynewt_arduino_zero/hw/bsp/arduino_zero

There are more tutorials on this here:

- http://mynewt.apache.org/os/tutorials/add_repos/
- http://mynewt.apache.org/os/tutorials/create_repo/

re [2]: I'm not sure I can help much, except to say: Awesome! I'm a big fan of both Espruino and Micropython. I personally like Javascript for these environments a bit more (smaller standard library makes it look more like the real thing), but its really great what both of those guys are doing, and I think hooking in a scripting language to Mynewt is excellent.

I'd start with getting the kernel (libs/os) mapped, and leaving their HALs intact. Eventually it would be cool to see those engines broken out, so that they could be mapped into our HAL as well. But that's kinda all I've got -- not sure if others have opinions here.

In the meantime there's quite a few HAL and BLE bits to wire/wrap up to
keep me busy.


Yeah. :-)

Sterling

Reply via email to