Basic USB communication with firmware, not java

This is where you talk about the NXJ software itself, installation issues, and programming talk.

Moderators: 99jonathan, roger, imaqine

Basic USB communication with firmware, not java

Postby jhebus » Thu Jan 09, 2014 6:07 pm

I am trying to get the firmware to communicate with a pc so that i can output printf statements from c to the PC, without the JVM even being present on the device. I suspect that this is possible as there are printf statements littered around the firmware.

Could anyone offer any help on the matter :)
jhebus
New User
 
Posts: 6
Joined: Wed Sep 18, 2013 8:56 pm

Re: Basic USB communication with firmware, not java

Postby gloomyandy » Thu Jan 09, 2014 6:23 pm

It is possible but not easy. You will need to enable the debug output in the printf.c file (and possibly in the usb file), this will allow you to use printf in the firmware. However the way it is normally used is to run a Java program on the NXT that accepts the incoming connection and enables the firmware, this then allows the use of the standard rconsole application on the PC side. If you don't want to have the JVM running then you will need to write code to listen for and accept the incoming USB connection, possibly not too hard but not something I've ever needed to do.

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 3630
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: Basic USB communication with firmware, not java

Postby jhebus » Thu Jan 09, 2014 11:11 pm

hi Andy,

thanks for the quick reply. I was thinking something like this. could you tell me where I can find the protocol?
jhebus
New User
 
Posts: 6
Joined: Wed Sep 18, 2013 8:56 pm

Re: Basic USB communication with firmware, not java

Postby gloomyandy » Fri Jan 10, 2014 12:58 am

The protocol is defined in the lejos.nxt.comm package...
User avatar
gloomyandy
leJOS Team Member
 
Posts: 3630
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: Basic USB communication with firmware, not java

Postby jhebus » Fri Jan 10, 2014 12:58 pm

Thanks, going through this to see what is going on, for the mean time i am using the LCD to see the printfs, even thought there are truncated.
jhebus
New User
 
Posts: 6
Joined: Wed Sep 18, 2013 8:56 pm


Return to NXJ Software

Who is online

Users browsing this forum: Baidu [Spider] and 1 guest

more stuff