Nimble controller configuration

2016-05-05 Thread will sanfilippo
Hello:

Unless there are any objections I am going to make the following changes to the 
nimble stack in regard to controller configuration.

The main reason for the change is to move the controller configuration options 
out of the controller and into nimble_opt.h with the rest of the configuration 
options (allowing them to be set by the target).

The other issue that will be addressed is the option NIMBLE_OPT_LL_MAX_PKT_SIZE 
and devices that cannot support this size due to HW limitations. Currently, 
this option dictates the supported max tx/rx octets used for connection data 
length pdu management. It is also intended to be used to reduce controller RAM 
usage although currently it affects RAM usage only slightly.

The proposed changes are:

* Move the configuration options out of net/nimble/controller/include/ble_ll.h 
and into net/nimble/include/nimble/nimble_opt.h
* Encryption will now be supported by default (as opposed to being on/off by 
default).
* Only features which affect RAM/code size will be added to nimble_opt.h; 
others will automatically be set by the controller.
* If the LL_MAX_PKT_SIZE is set to a value greater than that allowed by HW the 
HW will use the maximum value it supports.

Thanks





[ANNOUNCE] Apache Mynewt 0.8.0-incubating released

2016-05-05 Thread marko kiiskila
Hello all,

The Apache Mynewt team is pleased to announce the release of Apache
Mynewt 0.8.0-incubating.

Apache Mynewt is a community-driven module OS for constrained, embedded
applications. Mynewt provides a real-time operating system, flash file system,
network stacks, and support utilities for real-world embedded systems.

The release is available here:
http://www.apache.org/dyn/closer.lua/incubator/mynewt/apache-mynewt-0.8.0-incubating
 


For full release notes, please visit the Apache Mynewt Wiki:
https://cwiki.apache.org/confluence/display/MYNEWT/Release+Notes 


For information about bugs fixed for this release, please view the Issue
Tracker Summary: 
https://issues.apache.org/jira/browse/MYNEWT/fixforversion/12334807/?selectedTab=com.atlassian.jira.jira-projects-plugin:version-summary-panel
 


We welcome your help and feedback. For more information on the project
and how to get involved, visit the project website at
http://mynewt.incubator.apache.org/ 

Regards,
The Apache Mynewt team

Disclaimer:
Apache Mynewt is an effort undergoing incubation at The Apache Software
Foundation (ASF) sponsored by the Apache Incubator PMC. Incubation is
required of all newly accepted projects until a further review
indicates that the infrastructure, communications, and decision making
process have stabilized in a manner consistent with other successful
ASF projects. While incubation status is not necessarily a reflection
of the completeness or stability of the code, it does indicate that
the project has yet to be fully endorsed by the ASF.



Re: BLE Tiny Unhandled exception

2016-05-05 Thread will sanfilippo
Hello:

Can you show me your targets? newt target show will do this. Also, can you 
describe the steps you used to build and load the image on the board? There are 
different ways to do this but this is what I did:

newt clean nrf52dk_bletiny
newt build nrf52dk_bletiny
newt create-image nrf52dk_bletiny 0.0.0
newt load nrf52dk_bletiny

After that gets loaded you can reset the board and bletiny should boot 
(assuming you already have the bootloader downloaded).

I have the latest off develop and I am not seeing the same issue. Here is the 
target I am building with (I show the bootloader target as well).

targets/nrf52dk_bletiny
app=apps/bletiny
bsp=hw/bsp/nrf52dk
build_profile=optimized
cflags=-DNIMBLE_OPT_SM=1 -DSTATS_NAME_ENABLE 
targets/nrf52dk_boot
app=apps/boot
bsp=hw/bsp/nrf52dk
build_profile=optimized



> On May 5, 2016, at 2:35 PM, Cody Smith  wrote:
> 
> Hey Everybody,
> 
> I've been working with the nRF52 development board PCA10040 and have had
> some issues running the bletiny example app that comes in the repo.  I
> switched to the dev branch of the repo to get the nrf52dk as opposed to the
> nrf52pdk, but that didn't solve this particular issue (although it did fix
> a few things).
> 
> I got the example code to build and load onto the board, but when it runs,
> I see the following output printed to the terminal window on my desktop
> (coming over the serial port in Tera Term) continuously.
> 
> :Unhandled interrupt (3), exception sp 0x20007fa0
> 0: r0:0x20007fa0  r1:0x200043a0  r2:0x0800  r3:0x0100
> 0: r4:0x200043a0  r5:0x0800  r6:0x0100  r7:0x200043c0
> 0: r8:0x  r9:0x00016047 r10:0x0501 r11:0x
> 0:r12:0x200043c0  lr:0x  pc:0x00016047 psr:0x0501
> 0:ICSR:0x0803 HFSR:0x4000 CFSR:0x8200
> 0:BFAR:0x0800 MMFAR:0x0800
> 
> The blinky app was running just fine.  I also see this same thing with the
> bletest app as well.  Any ideas on what this could be?
> 
> Thanks for the help,
> 
> Cody



BLE Tiny Unhandled exception

2016-05-05 Thread Cody Smith
Hey Everybody,

I've been working with the nRF52 development board PCA10040 and have had
some issues running the bletiny example app that comes in the repo.  I
switched to the dev branch of the repo to get the nrf52dk as opposed to the
nrf52pdk, but that didn't solve this particular issue (although it did fix
a few things).

I got the example code to build and load onto the board, but when it runs,
I see the following output printed to the terminal window on my desktop
(coming over the serial port in Tera Term) continuously.

:Unhandled interrupt (3), exception sp 0x20007fa0
0: r0:0x20007fa0  r1:0x200043a0  r2:0x0800  r3:0x0100
0: r4:0x200043a0  r5:0x0800  r6:0x0100  r7:0x200043c0
0: r8:0x  r9:0x00016047 r10:0x0501 r11:0x
0:r12:0x200043c0  lr:0x  pc:0x00016047 psr:0x0501
0:ICSR:0x0803 HFSR:0x4000 CFSR:0x8200
0:BFAR:0x0800 MMFAR:0x0800

The blinky app was running just fine.  I also see this same thing with the
bletest app as well.  Any ideas on what this could be?

Thanks for the help,

Cody


Re: Blinky on nrf52DK needs repos/apache-mynewt-core to be on master

2016-05-05 Thread Christopher Collins
On Thu, May 05, 2016 at 05:13:25PM +0530, Anuj Deshpande wrote:
> Hi all
> 
> I followed the instructions on how to setup newt tool and then blinky on
> the nrf52 DK.
> 
> http://mynewt.apache.org/os/tutorials/nRF52/
[...]
> I had to change the branch of the repos/apache-mynewt-core repo which was
> cloned for me using the newt tool. This isn't reflected in the docs (and I
> don't think it should be). Is there something amiss with the newt tool ?

Hi Anuj,

As you suspected, you should not need to change the branch using git.
The problem here is that nrf52dk support is a new feature that is going
into the upcoming release.  If all goes well, this release will be out
in a day or two.  Until the release is out, the apache-mynewt-core
repository points to the old tag (mynewt_0_8_0_b2_tag) which lacks this
feature.

Manually pointing the repo to a different branch with git solves the
problem in the short term, but it might cause trouble for you the next
time you try to upgrade the core repo.  I don't believe we have
documented the correct way to use developmental features, so I am
certainly not criticizing you for doing what you did!

The preferred way to use developmental features is to change your
project.yml as follows:

FROM:

repository.apache-mynewt-core:
type: github
vers: 0-latest
user: apache
repo: incubator-mynewt-core

TO:

repository.apache-mynewt-core:
type: github
vers: 0-dev
user: apache
repo: incubator-mynewt-core

(change the "vers" field).

Then upgrade your packages with "newt upgrade", e.g.,

[ccollins@iori:~/tmp/myproj]$ newt upgrade
apache-mynewt-core
Would you like to upgrade repository apache-mynewt-core from 0.7.9-none to 
0.0.0-none ? [Yn] y

Naturally, this branch is quite unstable.

Chris

On Thu, May 05, 2016 at 05:13:25PM +0530, Anuj Deshpande wrote:
> Hi all
> 
> I followed the instructions on how to setup newt tool and then blinky on
> the nrf52 DK.
> 
> http://mynewt.apache.org/os/tutorials/nRF52/
> 
> ➜  apache-mynewt-core git:(2bec33d) ls hw/bsp
> native  nrf51dk  nrf51dk-16kbram  nrf52pdk  olimex_stm32-e407_devboard
> ➜  apache-mynewt-core git:(2bec33d) git checkout master
> Previous HEAD position was 2bec33d... Merge branch 'develop'
> Switched to branch 'master'
> Your branch is up-to-date with 'origin/master'.
> ➜  apache-mynewt-core git:(master) git pull origin master
> From https://github.com/apache/incubator-mynewt-core
>  * branchmaster -> FETCH_HEAD
> Already up-to-date.
> ➜  apache-mynewt-core git:(master) ls hw/bsp -l
> total 28
> drwxrwxr-x 4 anuj anuj 4096 May  5 16:55 bmd300eval
> drwxrwxr-x 4 anuj anuj 4096 May  5 16:55 native
> drwxrwxr-x 4 anuj anuj 4096 May  5 16:55 nrf51dk
> drwxrwxr-x 4 anuj anuj 4096 May  5 16:55 nrf51dk-16kbram
> drwxrwxr-x 4 anuj anuj 4096 May  5 16:55 nrf52dk
> drwxrwxr-x 4 anuj anuj 4096 May  5 16:55 nrf52pdk
> drwxrwxr-x 4 anuj anuj 4096 May  5 16:55 olimex_stm32-e407_devboard
> ➜  apach
> 
> I had to change the branch of the repos/apache-mynewt-core repo which was
> cloned for me using the newt tool. This isn't reflected in the docs (and I
> don't think it should be). Is there something amiss with the newt tool ?
> 
> I was able to build and load by following the other instructions to the T.
> 
> PS: new to the project, looks cool ! Looking forward to contribute !
> 
> Cheers,
> 
> Anuj
> ​


Re: Setting cflags correctly in bletiny

2016-05-05 Thread Christopher Collins
On Thu, May 05, 2016 at 06:28:19PM +0530, Anuj Deshpande wrote:
> Hi all,
> 
> I am on 64 bit 16.04 Ubuntu with a manually installed toolchain which has
> been added to my path.
> 
> Before building the app, while setting the cflags for the target, the
> documentation says that one should not give the - symbol.
> 
> http://mynewt.incubator.apache.org/os/tutorials/bletiny_project/
> 
> I had to give that to get it to build.
[...]

Good catch, Anuj.  The documentation is wrong.  I'll submit a pull
request to fix that typo.

Thanks,
Chris


Setting cflags correctly in bletiny

2016-05-05 Thread Anuj Deshpande
Hi all,

I am on 64 bit 16.04 Ubuntu with a manually installed toolchain which has
been added to my path.

Before building the app, while setting the cflags for the target, the
documentation says that one should not give the - symbol.

http://mynewt.incubator.apache.org/os/tutorials/bletiny_project/

I had to give that to get it to build. Here's the error -

➜  myapp1 newt target set myble build_profile=optimized
Target targets/myble successfully set target.build_profile to optimized
➜  myapp1 newt target set myble cflags=DSTATS_NAME_ENABLE
Target targets/myble successfully set pkg.cflags to DSTATS_NAME_ENABLE
➜  myapp1 newt target show
targets/my_blinky_sim
app=apps/blinky
bsp=@apache-mynewt-core/hw/bsp/native
build_profile=debug
targets/myble
app=@apache-mynewt-core/apps/bletiny
bsp=@apache-mynewt-core/hw/bsp/nrf52dk
build_profile=optimized
cflags=DSTATS_NAME_ENABLE
➜  myapp1 newt build myble
Building target targets/myble
Error: arm-none-eabi-gcc: error: DSTATS_NAME_ENABLE: No such file or directory

I fixed this with -

➜  myapp1 newt target set myble cflags=-DSTATS_NAME_ENABLE
Target targets/myble successfully set pkg.cflags to -DSTATS_NAME_ENABLE
➜  myapp1 newt target show
targets/my_blinky_sim
app=apps/blinky
bsp=@apache-mynewt-core/hw/bsp/native
build_profile=debug
targets/myble
app=@apache-mynewt-core/apps/bletiny
bsp=@apache-mynewt-core/hw/bsp/nrf52dk
build_profile=optimized
cflags=-DSTATS_NAME_ENABLE
➜  myapp1 newt build myble
Building target targets/myble
Compiling gatt_svr.c
Compiling main.c




Blinky on nrf52DK needs repos/apache-mynewt-core to be on master

2016-05-05 Thread Anuj Deshpande
Hi all

I followed the instructions on how to setup newt tool and then blinky on
the nrf52 DK.

http://mynewt.apache.org/os/tutorials/nRF52/

➜  apache-mynewt-core git:(2bec33d) ls hw/bsp
native  nrf51dk  nrf51dk-16kbram  nrf52pdk  olimex_stm32-e407_devboard
➜  apache-mynewt-core git:(2bec33d) git checkout master
Previous HEAD position was 2bec33d... Merge branch 'develop'
Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.
➜  apache-mynewt-core git:(master) git pull origin master
>From https://github.com/apache/incubator-mynewt-core
 * branchmaster -> FETCH_HEAD
Already up-to-date.
➜  apache-mynewt-core git:(master) ls hw/bsp -l
total 28
drwxrwxr-x 4 anuj anuj 4096 May  5 16:55 bmd300eval
drwxrwxr-x 4 anuj anuj 4096 May  5 16:55 native
drwxrwxr-x 4 anuj anuj 4096 May  5 16:55 nrf51dk
drwxrwxr-x 4 anuj anuj 4096 May  5 16:55 nrf51dk-16kbram
drwxrwxr-x 4 anuj anuj 4096 May  5 16:55 nrf52dk
drwxrwxr-x 4 anuj anuj 4096 May  5 16:55 nrf52pdk
drwxrwxr-x 4 anuj anuj 4096 May  5 16:55 olimex_stm32-e407_devboard
➜  apach

I had to change the branch of the repos/apache-mynewt-core repo which was
cloned for me using the newt tool. This isn't reflected in the docs (and I
don't think it should be). Is there something amiss with the newt tool ?

I was able to build and load by following the other instructions to the T.

PS: new to the project, looks cool ! Looking forward to contribute !

Cheers,

Anuj
​