[Tinyos-help] telosb with windows 8

2013-06-06 Thread Michael Schippling
Has anyone used serial port communication to a telosb mote
under Windows 8? I have a program that works fine under XP
but I don't seem to be able to get the right FTDI driver magic
under 8. We, may have, followed the instructions for loading
their VCP driver. When the program starts it detects that
there are devices on COM3 and COM5, but neither of those port
names actually connect to the mote.

To make matters worse I am debugging this over the phone with
someone who knows nothing about Windows on the other end, I
do not have any of the hardware to test...and its all TOS1.x


thx
MS
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


Re: [Tinyos-help] any documentation on tasklets?

2013-06-06 Thread Miklos Maroti
Hi Eric!

There is no internal documentation of the Tasklet interface, so let me
post it here if others would be interested.

The RFXLINK stack almost never uses atomic sections (unlike other
radio stacks) because we ensure that the stack is not reentered
asynchronously. If a (radio or timer) interrupt arrives and the
previous interrupt handler has not returned, then we do not reenter
the radio stack but remember that we have to handle this interrupt
when the previous one is finished. Similarly, if we are in the middle
of sending of a packet, then we are not going to handle an incoming
message interrupt until we have finished with the send. This
simplifies all stat transitions and the readability of the code, and
does not impose much limitations since there is usually a shared
resource (SPI, radio chip) which would prevent concurrent access
anyways (this is achieved by huge and long running atomic blocks in
other drivers).

Thus we need a task like semantics, lets call it tasklet, which allows
only one tasklet to run at a time. This tasklet scheduling domain sits
between real tasks and interrupts in a way that it can be configured
either to be regular tasks (if TASKLET_IS_TASK is defined) or will run
in interrupt context.

Tasklet can be scheduled to be executed (similar to posting a task)
and the Tasklet.run will be executed when no other tasklet is runing.
You can disable/enable the execution of tasklets with the
disable/enable commands, which is used when we want to enter the radio
stack to send a message and want to get exclusive access (no
interruption). Of course only the time critical parts of RFXLINK are
protected by tasklets.

If Tasklets are configured to run in interrupt context, then taking
the first interrupt (A) we call Tasklet.schedule() which will call the
Taskletr.run() command immediately, but it remembers internally that a
tasklet is already running. When a subsequent interrupt arrives (B)
before (A) has returned, and calls Tasklet.schedule() again, then we
just remember that Tasklet.run() must be called again, and we
immediatelly return from the (B) interrupt. When interrupt (A)
returns, then we check whether there were other interrupts so whether
we should call Tasklet.run() again. This is why you see the forever
loop in the tasklet code: the first interrupt handler acts as a
dispatcher (tasklet scheduler) for all subsequent tasklet calls.

I hope this makes sense. A similar logic is used in the fast serial
path where we prevent the reentrance of the serial interrupt driver by
bufferring subsequent received bytes in memory and later calling the
handler when the previous one has returned. In fact, I think a general
Tasklet infrastructure should be moved to the core tinyos library. It
can adapt the Tasklet from the RFXLINK library, but it should allow
the creation of independent tasklets (THE RFXLINK library has a single
one shared by all components, and everyone will be notified if someone
called schedule). Let me know if someone would like to play with such
an idea.

Best,
Miklos

On Tue, Jun 4, 2013 at 10:52 PM, Eric Decker  wrote:
>
> I've started looking at the rfxlib stuff and am wondering why tasklets.
>
> Any internal documentation that talks about why and how it works?
>
> --
> Eric B. Decker
> Senior (over 50 :-) Researcher
>
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


Re: [Tinyos-help] any documentation on tasklets?

2013-06-06 Thread Johny Mattsson
On 7 June 2013 02:56, Miklos Maroti  wrote:

> If Tasklets are configured to run in interrupt context, then taking
> the first interrupt (A) we call Tasklet.schedule() which will call the
> Taskletr.run() command immediately, but it remembers internally that a
> tasklet is already running. When a subsequent interrupt arrives (B)
> before (A) has returned, and calls Tasklet.schedule() again, then we
> just remember that Tasklet.run() must be called again, and we
> immediatelly return from the (B) interrupt. When interrupt (A)
> returns, then we check whether there were other interrupts so whether
> we should call Tasklet.run() again.


I'm curious - which platforms have nested interrupts enabled? In my
experience their usage has always been discouraged (and I ended up not
using them for my Arduino-port-in-progress). Have there been any
measurements done in terms of performance impact of using interrupt vs
TASKLET_IS_TASK? The typical driver approach of bottom-in-interrupt,
top-in-task is after all designed to ensure device timing constraints are
adhered to without hogging interrupts for too long. With the tasklet stuff
it seems that unless nested interrupts are used (and their priorities
managed correctly), one either runs the risk of blocking other interrupts
for potentially a very long time (as the "dispatcher" does not yield), or
not responding to the interrupt in a timely manner (if a long-running task
is currently executing or scheduled to be executed before the tasklet task).

Thanks for posting the write-up! Can I suggest it be added to the github
wiki, or the regular doc site as well?

Cheers,
/Johny
-- 
Johny Mattsson
Senior Software Engineer

DiUS Computing Pty. Ltd.
*where ideas are engineered
*
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Re: [Tinyos-help] telosb with windows 8

2013-06-06 Thread He Dajiang (I2R)
It looks like a FTDI driver problem.
Try the followings:
1) reinstall the USB to serial driver? 
(http://digital.ni.com/public.nsf/allkb/FD238ED75B22740B86257315004E35FE)
2) use other serial COM reading code like .NET to test whether there is 
incoming data on the particular port.
3) use the tos-provided code lile net.tinyos.tools.Listen


>Has anyone used serial port communication to a telosb mote
>under Windows 8? I have a program that works fine under XP
>but I don't seem to be able to get the right FTDI driver magic
>under 8. We, may have, followed the instructions for loading
>their VCP driver. When the program starts it detects that
>there are devices on COM3 and COM5, but neither of those port
>names actually connect to the mote.

>To make matters worse I am debugging this over the phone with
>someone who knows nothing about Windows on the other end, I
>do not have any of the hardware to test...and its all TOS1.x

Institute for Infocomm Research disclaimer:  "This email is confidential and 
may be privileged. If you are not the intended recipient, please delete it and 
notify us immediately. Please do not copy or use it for any purpose, or 
disclose its contents to any other person. Thank you."

___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help