NXC interaction with FW - mailboxes question

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.
Post Reply
ricardocrl
Posts: 117
Joined: 27 Dec 2010, 19:27

NXC interaction with FW - mailboxes question

Post by ricardocrl »

Hey,

I have a detail question.

When NXC accesses mailbox messages, does it send direct commands to FW, which in turn reply "to the NXT program", or is it an IO read/write process that doesn't need any direct command interaction with the FW?

Ricardo
linusa
Posts: 228
Joined: 16 Oct 2010, 11:44
Location: Aachen, Germany
Contact:

Re: NXC interaction with FW - mailboxes question

Post by linusa »

As far as I know, the direct commands (and I count "system commands" as a certain kind of direct commands) are only sent remotely, via USB or Bluetooth. You usually never invoke them locally. (An interesting observation is, that direct command handling is done by a firmware module and does not affect execution speed of "user space programs" (like NXC programs) which are being executed at the same time).

You can have a look at the NXCDefs.h file and other NXC source code files to see what SendMessage and ReceiveMessage really do. But it's very probable they just invoke some low level firmware commands, or directly write to fw registers/memory.
RWTH - Mindstorms NXT Toolbox for MATLAB
state of the art in nxt remote control programming
http://www.mindstorms.rwth-aachen.de
MotorControl now also in Python, .net, and Mathematica
ricardocrl
Posts: 117
Joined: 27 Dec 2010, 19:27

Re: NXC interaction with FW - mailboxes question

Post by ricardocrl »

Thanks linusa!
linusa wrote:An interesting observation is, that direct command handling is done by a firmware module and does not affect execution speed of "user space programs" (like NXC programs) which are being executed at the same time
I have asked that to myself as well. But how is that done? does it use a different processor?
linusa wrote: You can have a look at the NXCDefs.h file and other NXC source code files to see what SendMessage and ReceiveMessage really do. But it's very probable they just invoke some low level firmware commands, or directly write to fw registers/memory.
The most I find is this:

Code: Select all

#define SendMessage(_queue, _msg) asm { __sendMessage(_queue, _msg, __RETVAL__) }
Is this what you call low level firmware commands? Do we have access to this asm code? Because I've tried sometimes before to dig a little bit into NXC functions, but I never find any code..
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests