Re: Can Mynewt OS and BLE stack be run without the most highest priority interrupt?

2016-11-07 Thread WangJiacheng
Hi, Will,

Thanks for your help,

The reason of nRF require high priority interrupts is that, from the point of 
view of phone side, the nRF is a proxy of SIM card, it should be always ready 
to receive phone command (UICC-terminal interface command). The arriving time 
of this phone command can not be predicted since mobile network is also 
involved  in the authentication process (and I also can not control the 
baseband chip of mobile phone). Moreover, if this command is not responded in 
time, the phone will treat the (proxy) SIM card as a bad card and stop power 
supply (nRF need this power supply to power on). I use nRF GPIOTE to sense this 
phone command arriving event and give the highest priority to ensure the 
command is responded in time.

Yes, nRF51 have not enough resource to run both my program and BLE stack, I 
will focus on nRF52.

The high priority  interrupt time of the program need at least 1ms ~ 2ms to 
read the 5-byte phone command, after this command read process, some BLE events 
can be inserted between the conversation of  phone and SIM card. However, each 
talk of phone or SIM card can not be interrupted, this talk may be up to 100ms. 
I’m trying to make the BLE connections is not dropped during this phone-SIM 
conversation.

I’ll try more with you help information.

Best Regards,

Jiacheng


> 在 2016年11月8日,13:18,will sanfilippo <wi...@runtime.io> 写道:
> 
> Hello:
> 
> Yes, you can adjust interrupt priorities. With the develop branch of mynewt 
> you can adjust the priority for any interrupt.
> 
> By default, the radio uses the highest priority interrupt (0) for both the 
> nrf51 and nrf52. If you need the two highest priority interrupts you can do 
> that; you would change the radio priority to 2 and use priorities 0 and 1 for 
> your other interrupts. Note that the nrf51 only has 4 interrupt priorities so 
> you are somewhat limited there. The nrf52 has 8 I believe.
> 
> In the hal there is function called hal_bsp_get_nvic_priority(). By default, 
> all interrupt priorities are assigned the lowest priority. With 
> hal_bsp_get_nvic_priority() you can do some cool things:
> 
> 1) By adding a case to the switch statement, you can alter the priority that 
> is being set for the interrupt when NVIC_SetPriority() is called.
> 2) You can “see” the priority for the other interrupts that are being set. 
> All calls to NVIC_SetPriority() call hal_bsp_get_nvic_priority() so you can 
> always know if some code is trying to set a priority.
> 
> If no call to NVIC_SetPriority() is being made for an interrupt, that 
> interrupt will be at the lowest priority. Depending on the interrupt you want 
> to make highest, you might have to add a call to NVIC_SetPriority().
> 
> What interrupt(s) did you want to make the high priority interrupts? Just 
> curious…
> 
> As to potential issues: well, this is where things get tricky. If you are not 
> running the radio at the highest priority it is possible that the BLE stack 
> could be adversely affected. You could miss packets or drop connections; it 
> depends on quite a number of factors. The BLE timing is quite tight, so if 
> you are getting interrupted frequently and/or the interrupts take a long 
> time, you could have issues.
> 
> Hope this helps...
> 
> 
>> On Nov 7, 2016, at 8:19 PM, WangJiacheng <jiacheng.w...@icloud.com> wrote:
>> 
>> Hi,
>> 
>> I’m working on a personal project and need some help from the community, 
>> since I just start to know Mynewt recently and not familiar with it.
>> 
>> The project is about wireless SIM interface, this is a quite new concept, 
>> let’s give more words here.  Each mobile phone has an IC card called SIM 
>> card from network provider to access the mobile network, the most important 
>> functionality of SIM card is network access authentication of mobile phone. 
>> The current SIM-phone interface is UICC-terminal interface with contactor, 
>> this wired-connection protocol is defined by ISO/IEC-7816, ETSI TS 102 221, 
>> etc. The basic idea of wireless SIM is to insert a wireless link between 
>> phone and SIM card, thus mobile phone can get network access authentication 
>> wirelessly without a SIM card inside its card slot, the SIM card is actually 
>> in (for example) a smart watch. This usage model give user the freedom to 
>> use different device (Phone, Pad, Watch) with the same one SIM card but no 
>> any plug-out and plug-in, and switch between the device seamlessly.
>> 
>> Currently the wireless SIM interface can be run with nRF51822 and nRF52832, 
>> I want the program can co-exist with Mynewt OS and BLE stack. The most 
>> challenge is that the program require the 2 most highest priority interrupt 
>> (at least 1 for nRF

Re: Can Mynewt OS and BLE stack be run without the most highest priority interrupt?

2016-11-07 Thread will sanfilippo
Hello:

Yes, you can adjust interrupt priorities. With the develop branch of mynewt you 
can adjust the priority for any interrupt.

By default, the radio uses the highest priority interrupt (0) for both the 
nrf51 and nrf52. If you need the two highest priority interrupts you can do 
that; you would change the radio priority to 2 and use priorities 0 and 1 for 
your other interrupts. Note that the nrf51 only has 4 interrupt priorities so 
you are somewhat limited there. The nrf52 has 8 I believe.

In the hal there is function called hal_bsp_get_nvic_priority(). By default, 
all interrupt priorities are assigned the lowest priority. With 
hal_bsp_get_nvic_priority() you can do some cool things:

1) By adding a case to the switch statement, you can alter the priority that is 
being set for the interrupt when NVIC_SetPriority() is called.
2) You can “see” the priority for the other interrupts that are being set. All 
calls to NVIC_SetPriority() call hal_bsp_get_nvic_priority() so you can always 
know if some code is trying to set a priority.

If no call to NVIC_SetPriority() is being made for an interrupt, that interrupt 
will be at the lowest priority. Depending on the interrupt you want to make 
highest, you might have to add a call to NVIC_SetPriority().

What interrupt(s) did you want to make the high priority interrupts? Just 
curious…

As to potential issues: well, this is where things get tricky. If you are not 
running the radio at the highest priority it is possible that the BLE stack 
could be adversely affected. You could miss packets or drop connections; it 
depends on quite a number of factors. The BLE timing is quite tight, so if you 
are getting interrupted frequently and/or the interrupts take a long time, you 
could have issues.

Hope this helps...


> On Nov 7, 2016, at 8:19 PM, WangJiacheng <jiacheng.w...@icloud.com> wrote:
> 
> Hi,
> 
> I’m working on a personal project and need some help from the community, 
> since I just start to know Mynewt recently and not familiar with it.
> 
> The project is about wireless SIM interface, this is a quite new concept, 
> let’s give more words here.  Each mobile phone has an IC card called SIM card 
> from network provider to access the mobile network, the most important 
> functionality of SIM card is network access authentication of mobile phone. 
> The current SIM-phone interface is UICC-terminal interface with contactor, 
> this wired-connection protocol is defined by ISO/IEC-7816, ETSI TS 102 221, 
> etc. The basic idea of wireless SIM is to insert a wireless link between 
> phone and SIM card, thus mobile phone can get network access authentication 
> wirelessly without a SIM card inside its card slot, the SIM card is actually 
> in (for example) a smart watch. This usage model give user the freedom to use 
> different device (Phone, Pad, Watch) with the same one SIM card but no any 
> plug-out and plug-in, and switch between the device seamlessly.
> 
> Currently the wireless SIM interface can be run with nRF51822 and nRF52832, I 
> want the program can co-exist with Mynewt OS and BLE stack. The most 
> challenge is that the program require the 2 most highest priority interrupt 
> (at least 1 for nRF52832), I have tried to make it co-exist with Nordic’s 
> soft-device BLE stack, but I have to disable the soft-device when the program 
> events need high priority interrupt (since soft-device reserved the 2 highest 
> priority interrupt), thus loss all the BLE connection. Although the 
> soft-device can be re-started after the program events, but this is not an  
> idea solution since all the BLE stack will go through again. 
> 
> Is it possible to run Mynewt OS and BLE stack without the 1 or 2 most highest 
> priority interrupt? if not, what is the potential issues?
> 
> Thanks a lot,
> 
> Jiacheng
> 



Can Mynewt OS and BLE stack be run without the most highest priority interrupt?

2016-11-07 Thread WangJiacheng
Hi,

I’m working on a personal project and need some help from the community, since 
I just start to know Mynewt recently and not familiar with it.

The project is about wireless SIM interface, this is a quite new concept, let’s 
give more words here.  Each mobile phone has an IC card called SIM card from 
network provider to access the mobile network, the most important functionality 
of SIM card is network access authentication of mobile phone. The current 
SIM-phone interface is UICC-terminal interface with contactor, this 
wired-connection protocol is defined by ISO/IEC-7816, ETSI TS 102 221, etc. The 
basic idea of wireless SIM is to insert a wireless link between phone and SIM 
card, thus mobile phone can get network access authentication wirelessly 
without a SIM card inside its card slot, the SIM card is actually in (for 
example) a smart watch. This usage model give user the freedom to use different 
device (Phone, Pad, Watch) with the same one SIM card but no any plug-out and 
plug-in, and switch between the device seamlessly.

Currently the wireless SIM interface can be run with nRF51822 and nRF52832, I 
want the program can co-exist with Mynewt OS and BLE stack. The most challenge 
is that the program require the 2 most highest priority interrupt (at least 1 
for nRF52832), I have tried to make it co-exist with Nordic’s soft-device BLE 
stack, but I have to disable the soft-device when the program events need high 
priority interrupt (since soft-device reserved the 2 highest priority 
interrupt), thus loss all the BLE connection. Although the soft-device can be 
re-started after the program events, but this is not an  idea solution since 
all the BLE stack will go through again. 

Is it possible to run Mynewt OS and BLE stack without the 1 or 2 most highest 
priority interrupt? if not, what is the potential issues?

Thanks a lot,

Jiacheng



Re: BLE Stack

2016-05-24 Thread Christopher Collins
On Tue, May 24, 2016 at 03:15:22PM +0400, Vitya Gnatyuk wrote:
> I make up your stack in EmBitz 0.42 with apps\bleprph example. But an one
> error has occurred: undefined reference to `__vector_tbl_reloc__'
> What I can do with it?

Hi Vitya,

Are you using the "newt" tool to build your project, as documented here:
http://mynewt.apache.org/os/get_started/project_create/ ?  It sounds
like you are using the EmBitz IDE instead of newt.  It should certainly
possible to build Mynewt projects without using newt, but it is not
something that we have tried before, and it is not the recommended
setup.

The particular error you are seeing appears to be caused by the
appropriate bsp code not getting linked in to your project.  The newt
tool handles this for you automatically.  If you would like to forgo
using the newt tool, then you will need to manually point your build
tool at all your project's dependencies.

Chris


Re: BLE Stack

2016-05-24 Thread Vitya Gnatyuk
I make up your stack in EmBitz 0.42 with apps\bleprph example. But an one
error has occurred: undefined reference to `__vector_tbl_reloc__'
What I can do with it?

On Thu, May 19, 2016 at 2:42 PM, Vitya Gnatyuk  wrote:

> Hi! I earlier wrote you on github as gnatyukv. I forgot to ask a main
> qustion. May your projects (from the apps folder) be compiled in Keil IDE?
> How to do it? I have uVision V5.17 and Armcc compiler. I cannot compile
> your code yet. Maybe another compiler (GCC) needed?
>


Re: BLE Stack

2016-05-20 Thread Sterling Hughes

Hi Vitya,

On 5/19/16 5:42 AM, Vitya Gnatyuk wrote:

Hi! I earlier wrote you on github as gnatyukv. I forgot to ask a main
qustion. May your projects (from the apps folder) be compiled in Keil IDE?
How to do it? I have uVision V5.17 and Armcc compiler. I cannot compile
your code yet. Maybe another compiler (GCC) needed?



Unfortunately we don't support the armcc compiler yet.  You are correct, 
it needs GCC to compile.


A fair amount of the code uses GCC specific features, that said: it 
shouldn't be too hard to make it agnostic to compiler platform.  If 
you'd like to take on the project, I'd be happy to support you as you 
make the changes.


I think the easiest way to go would be to pick a few libraries, get them 
compiling with ARM's compiler, and then send a mail to the dev@ list 
with the changes we need to make (i.e. "DON'T explcitly used 
__attribute__((packed))") -- and then everyone else will pitch and help 
convert things over so the code cleanly compiles with both GCC and ARM.


Hope this helps.

Best,

Sterling


BLE Stack

2016-05-19 Thread Vitya Gnatyuk
Hi! I earlier wrote you on github as gnatyukv. I forgot to ask a main
qustion. May your projects (from the apps folder) be compiled in Keil IDE?
How to do it? I have uVision V5.17 and Armcc compiler. I cannot compile
your code yet. Maybe another compiler (GCC) needed?


[Dev][GSoC:2016]MYNEWT-118:Android or iOS application to interact with devices/boards powered by Mynewt OS and BLE stack (Nimble)

2016-02-26 Thread Nathiesha Maddage
Hi all,
I am a 3rd year computer engineering undergraduate from University of
Moratuwa,Sril Lanka.I am interested in above project.I have been
researching about bluetooth api of Android. Please let me know how to
proceed with this project.


Re: Android app to interact with devices powered by Mynewt OS and BLE stack

2016-02-16 Thread aditi hilbert
Hi Samurdhi,

Thanks for joining the @dev list! It’s great to hear you are interested in the 
work we are doing. The specific project you have inquired about is one we would 
love to offer for GSoC; however, the official start is a few months away and we 
are currently still working on the core elements of the OS and networking (BLE) 
stack that are essential for the Android/iOS app project. If you think you have 
the right background and experience I urge you to go through the code and docs 
for Apache Mynewt closely, stay in close touch with the progress being made, 
and suggest one or more small things to contribute in the meantime to get 
closer to the project launch. 

In the event the Android/iOS app project needs more time to take off we could 
probably roll your suggestions/contributions into a GSoC project so you are 
eligible for the credit and reward (besides the satisfaction of pushing Apache 
Mynewt forward :) ). 

thanks,
Aditi


> On Feb 16, 2016, at 8:26 PM, Samurdhi Karunarathne <samurdhi...@gmail.com> 
> wrote:
> 
> Hello All,
> 
> I'm Samurdhi Karunarathne and I'm a student at the Faculty of Engineering,
> University of Peradeniya, Sri Lanka. I came across this project in Jira
> intended for GSoC 2016, to develop an Android or iOS app to interact with
> devices running MyNewt OS and BLE stack. As I have considerable experience
> in this direction I am very interested in working on this project for GSoC
> 2016.
> Hope you could give me some guidelines to get myself up and aboard the
> task. Thanks in advance!
> 
> Regards,
> Samurdhi