You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mynewt.apache.org by Wayne Keenan <wa...@gmail.com> on 2016/04/23 10:54:23 UTC

How do you get newt to compile asm source in app folders?

Hi,

I've got an app with asm  (*.[s|S])  files but `newt build` is not picking
them up.

What is special about the ./repos/apache-mynewt-core/hw/bsp/nrf52pdk such
that a build picks up gcc_startup_nrf52.s for assembly?

I've had a look in the various p*.yml files but nothing jumped out.

All the best
Wayne

Re: How do you get newt to compile asm source in app folders?

Posted by Sterling Hughes <st...@apache.org>.
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

Re: How do you get newt to compile asm source in app folders?

Posted by Wayne Keenan <wa...@gmail.com>.
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).

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

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

All the best
Wayne

On Sat, Apr 23, 2016 at 8:20 PM, Sterling Hughes <st...@apache.org>
wrote:

> Thanks Wayne.  I've just committed a fix for the *.S not compiling on the
> develop branch of newt, so it will make it into the release next week.  If
> you want to try it out in the interim, just grab develop.
>
> Cheers,
>
> Sterling
>
> On 4/23/16 12:03 PM, Wayne Keenan wrote:
>
>> Hi Sterling,
>>
>> I removed the pkg.arch directive and the build was still successful,
>> thanks.
>>
>>
>> All the best
>> Wayne
>>
>> On Sat, Apr 23, 2016 at 5:34 PM, Sterling Hughes <sterling@apache.org
>> <ma...@apache.org>> wrote:
>>
>>     Hi Wayne,
>>
>>     Good point, the .s should be case-insensitive. We'll change that.
>>
>>     Can you retest without adding pkg.arch to [APP_DIR]/pkg.yml?  The
>>     architecture should be specified by the BSP, and that should apply
>>     to the application package (I just tested this locally.)  So if
>>     you're seeing something different, I want to make sure we
>>     understand/fix it.
>>
>>     Thanks!
>>
>>     Sterling
>>
>>
>>     On 4/23/16 2:42 AM, Wayne Keenan wrote:
>>
>>         Hi,
>>
>>         For those that follow, after digging around I found I needed
>>         todo the
>>         following for my app:
>>
>>
>>         1. in [APP_DIR]/pkg.yml added the new line:
>>
>>         pkg.arch: cortex_m4
>>
>>
>>         2. Put .s  (and currently not .S) files under:
>>
>>         [APP_DIR]/src/arch/cortex_m4
>>
>>
>>
>>
>>
>>         All the best
>>         Wayne
>>
>>         On Sat, Apr 23, 2016 at 9:54 AM, Wayne Keenan
>>         <wayne.keenan@gmail.com <ma...@gmail.com>>
>>         wrote:
>>
>>             Hi,
>>
>>             I've got an app with asm  (*.[s|S])  files but `newt build`
>>             is not picking
>>             them up.
>>
>>             What is special about the
>>             ./repos/apache-mynewt-core/hw/bsp/nrf52pdk such
>>             that a build picks up gcc_startup_nrf52.s for assembly?
>>
>>             I've had a look in the various p*.yml files but nothing
>>             jumped out.
>>
>>             All the best
>>             Wayne
>>
>>
>>
>>

Re: How do you get newt to compile asm source in app folders?

Posted by Sterling Hughes <st...@apache.org>.
Thanks Wayne.  I've just committed a fix for the *.S not compiling on 
the develop branch of newt, so it will make it into the release next 
week.  If you want to try it out in the interim, just grab develop.

Cheers,

Sterling

On 4/23/16 12:03 PM, Wayne Keenan wrote:
> Hi Sterling,
>
> I removed the pkg.arch directive and the build was still successful, thanks.
>
>
> All the best
> Wayne
>
> On Sat, Apr 23, 2016 at 5:34 PM, Sterling Hughes <sterling@apache.org
> <ma...@apache.org>> wrote:
>
>     Hi Wayne,
>
>     Good point, the .s should be case-insensitive. We'll change that.
>
>     Can you retest without adding pkg.arch to [APP_DIR]/pkg.yml?  The
>     architecture should be specified by the BSP, and that should apply
>     to the application package (I just tested this locally.)  So if
>     you're seeing something different, I want to make sure we
>     understand/fix it.
>
>     Thanks!
>
>     Sterling
>
>
>     On 4/23/16 2:42 AM, Wayne Keenan wrote:
>
>         Hi,
>
>         For those that follow, after digging around I found I needed
>         todo the
>         following for my app:
>
>
>         1. in [APP_DIR]/pkg.yml added the new line:
>
>         pkg.arch: cortex_m4
>
>
>         2. Put .s  (and currently not .S) files under:
>
>         [APP_DIR]/src/arch/cortex_m4
>
>
>
>
>
>         All the best
>         Wayne
>
>         On Sat, Apr 23, 2016 at 9:54 AM, Wayne Keenan
>         <wayne.keenan@gmail.com <ma...@gmail.com>>
>         wrote:
>
>             Hi,
>
>             I've got an app with asm  (*.[s|S])  files but `newt build`
>             is not picking
>             them up.
>
>             What is special about the
>             ./repos/apache-mynewt-core/hw/bsp/nrf52pdk such
>             that a build picks up gcc_startup_nrf52.s for assembly?
>
>             I've had a look in the various p*.yml files but nothing
>             jumped out.
>
>             All the best
>             Wayne
>
>
>

Re: How do you get newt to compile asm source in app folders?

Posted by Wayne Keenan <wa...@gmail.com>.
Hi Sterling,

I removed the pkg.arch directive and the build was still successful, thanks.


All the best
Wayne

On Sat, Apr 23, 2016 at 5:34 PM, Sterling Hughes <st...@apache.org>
wrote:

> Hi Wayne,
>
> Good point, the .s should be case-insensitive. We'll change that.
>
> Can you retest without adding pkg.arch to [APP_DIR]/pkg.yml?  The
> architecture should be specified by the BSP, and that should apply to the
> application package (I just tested this locally.)  So if you're seeing
> something different, I want to make sure we understand/fix it.
>
> Thanks!
>
> Sterling
>
>
> On 4/23/16 2:42 AM, Wayne Keenan wrote:
>
>> Hi,
>>
>> For those that follow, after digging around I found I needed todo the
>> following for my app:
>>
>>
>> 1. in [APP_DIR]/pkg.yml added the new line:
>>
>> pkg.arch: cortex_m4
>>
>>
>> 2. Put .s  (and currently not .S) files under:
>>
>> [APP_DIR]/src/arch/cortex_m4
>>
>>
>>
>>
>>
>> All the best
>> Wayne
>>
>> On Sat, Apr 23, 2016 at 9:54 AM, Wayne Keenan <wa...@gmail.com>
>> wrote:
>>
>> Hi,
>>>
>>> I've got an app with asm  (*.[s|S])  files but `newt build` is not
>>> picking
>>> them up.
>>>
>>> What is special about the ./repos/apache-mynewt-core/hw/bsp/nrf52pdk such
>>> that a build picks up gcc_startup_nrf52.s for assembly?
>>>
>>> I've had a look in the various p*.yml files but nothing jumped out.
>>>
>>> All the best
>>> Wayne
>>>
>>>
>>

Re: How do you get newt to compile asm source in app folders?

Posted by Sterling Hughes <st...@apache.org>.
Hi Wayne,

Good point, the .s should be case-insensitive. We'll change that.

Can you retest without adding pkg.arch to [APP_DIR]/pkg.yml?  The 
architecture should be specified by the BSP, and that should apply to 
the application package (I just tested this locally.)  So if you're 
seeing something different, I want to make sure we understand/fix it.

Thanks!

Sterling

On 4/23/16 2:42 AM, Wayne Keenan wrote:
> Hi,
>
> For those that follow, after digging around I found I needed todo the
> following for my app:
>
>
> 1. in [APP_DIR]/pkg.yml added the new line:
>
> pkg.arch: cortex_m4
>
>
> 2. Put .s  (and currently not .S) files under:
>
> [APP_DIR]/src/arch/cortex_m4
>
>
>
>
>
> All the best
> Wayne
>
> On Sat, Apr 23, 2016 at 9:54 AM, Wayne Keenan <wa...@gmail.com>
> wrote:
>
>> Hi,
>>
>> I've got an app with asm  (*.[s|S])  files but `newt build` is not picking
>> them up.
>>
>> What is special about the ./repos/apache-mynewt-core/hw/bsp/nrf52pdk such
>> that a build picks up gcc_startup_nrf52.s for assembly?
>>
>> I've had a look in the various p*.yml files but nothing jumped out.
>>
>> All the best
>> Wayne
>>
>

Re: How do you get newt to compile asm source in app folders?

Posted by Wayne Keenan <wa...@gmail.com>.
Hi,

For those that follow, after digging around I found I needed todo the
following for my app:


1. in [APP_DIR]/pkg.yml added the new line:

pkg.arch: cortex_m4


2. Put .s  (and currently not .S) files under:

[APP_DIR]/src/arch/cortex_m4





All the best
Wayne

On Sat, Apr 23, 2016 at 9:54 AM, Wayne Keenan <wa...@gmail.com>
wrote:

> Hi,
>
> I've got an app with asm  (*.[s|S])  files but `newt build` is not picking
> them up.
>
> What is special about the ./repos/apache-mynewt-core/hw/bsp/nrf52pdk such
> that a build picks up gcc_startup_nrf52.s for assembly?
>
> I've had a look in the various p*.yml files but nothing jumped out.
>
> All the best
> Wayne
>