Page 1 of 1
NXC interaction with FW - mailboxes question
Posted: 08 Jun 2011, 13:18
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
Re: NXC interaction with FW - mailboxes question
Posted: 08 Jun 2011, 14:52
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.
Re: NXC interaction with FW - mailboxes question
Posted: 12 Jun 2011, 13:51
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..