Firmware development

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

Moderators: 99jonathan, roger, imaqine

Firmware development

Postby mdr86 » Tue Sep 20, 2011 4:33 pm

What documentation/info was used to develop the leJOS firmware? After an afternoon of googling, all I've managed to find is the memory map...
Thanks!
mdr86
New User
 
Posts: 7
Joined: Fri Sep 16, 2011 8:31 pm

Re: Firmware development

Postby gloomyandy » Tue Sep 20, 2011 5:01 pm

What documentation are you looking for? There is a complete set of hardware doc (including schematics) on the Lego Mindstorms site, the source code for the standard firmware is also there. The Atmel site has plenty of documentation about the processor used by the NXT...
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4174
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: Firmware development

Postby mdr86 » Tue Sep 20, 2011 5:39 pm

Things like what state hardware is in on boot, the boot process, how I/O works...
I expect it's all in there, but I have almost no experience of translating hardware information and source code into my own understanding of how you actually program something; my experience of low-level programming so far has been in the x86 world where there is a vast amount of resources explaining things from a programming point of view (rather than a hardware point of view). I've been looking at the hardware docs and it all seems geared towards developing your own hardware (which makes sense, it being the hardware developer kit docs!), and I don't know how to translate that into Assembler or C. When doing x86 stuff, I have info like "video is memory mapped to 0xf800000, write using normal memory operations", "keyboard is on port 0x64, access using in and out instructions, these commands are available", and I guess I was hoping there would be similar information for the NXT.

Edit: Ah. Just disocovered at91sam7s256.h; things are beginning to make sense! As usual it *was* just my not having looked hard enough/in the right places...
mdr86
New User
 
Posts: 7
Joined: Fri Sep 16, 2011 8:31 pm

Re: Firmware development

Postby gloomyandy » Tue Sep 20, 2011 9:41 pm

Have you looked at the Atmel docs? If not you should. There is a huge amount of detail in them. The Lego hardware documentation explains how the system fits together and along with the Atmel docs you should be able to get a good idea of how things work. To be honest you won't find many embedded systems that are better documented than the NXT. The world of embeded systems is all about making creative use of the combined hardware and software to produce a complete system at a competative price. The NXT does a great job of that, and Lego have embraced the idea of making the design public which has to a large extent made projects like leJOS possible. The nature of embedded systems can make them harder to understand because each design tends to be different. But that is half the fun! You maymay have to work hard at understanding things but doing so will give you a much deeper understanding of the system.

Have fun and welcome to the world of embedded systems...

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

Re: Firmware development

Postby gloomyandy » Tue Sep 20, 2011 9:46 pm

Oh and this is the Atmel doc that you really need to understand:
http://www.atmel.com/dyn/resources/prod ... oc6175.pdf

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

Re: Firmware development

Postby mdr86 » Wed Sep 21, 2011 2:39 pm

Thanks for your patience and help :)
I've read the Atmel and Lego docs now; I'm unsure how they help with firmware programming though as all they have is circuit diagrams and the like, which (as far as I can tell) gives you no information as to how to program it.
I've tried writing a "smallest code that will put something on the LCD", but when I load it, the NXT just clicks; I then tried something that should just hang (511 nops and a branch back to the beginning) and that also just clicks.
mdr86
New User
 
Posts: 7
Joined: Fri Sep 16, 2011 8:31 pm

Re: Firmware development

Postby skoehler » Wed Sep 21, 2011 2:41 pm

mdr86 wrote:Thanks for your patience and help :)
I've read the Atmel and Lego docs now; I'm unsure how they help with firmware programming though as all they have is circuit diagrams and the like, which (as far as I can tell) gives you no information as to how to program it.
I've tried writing a "smallest code that will put something on the LCD", but when I load it, the NXT just clicks; I then tried something that should just hang (511 nops and a branch back to the beginning) and that also just clicks.

Sounds like the clicking sound of the SAM-BA in system programmer. How do you upload and run your code?
skoehler
leJOS Team Member
 
Posts: 1448
Joined: Thu Oct 30, 2008 4:54 pm

Re: Firmware development

Postby gloomyandy » Wed Sep 21, 2011 2:48 pm

As I tried to explain above you are unlikely to find anything that will tell you how to do this. With embedded systems each device is different and you have to understand how the hardware works and how it all fits together. So for instance there is no standard way to talk to say an LCD display, there is the way that in this case Lego decided to implement it. My best advice is to read the leJOS source code, and the Lego source and anything else you can get your hands on. It really is the best way to understand what is going on. It's not easy and it takes time, but it is the best way...

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

Re: Firmware development

Postby gloomyandy » Wed Sep 21, 2011 4:18 pm

Oh and if you do read the leJOS code, and have any questions about how it works, then ask away and I'll try and help...
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4174
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: Firmware development

Postby Tickstart » Wed Oct 12, 2011 10:30 am

I got the Atmel docs, but where is that LEGO doc you were referring to? appreciate it!
Tickstart
New User
 
Posts: 13
Joined: Tue Jul 12, 2011 4:39 pm

Re: Firmware development

Postby gloomyandy » Wed Oct 12, 2011 10:56 am

They are available from the Lego mindstorms site...
http://mindstorms.lego.com/en-us/suppor ... fault.aspx
in the various developer kits...
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4174
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK


Return to NXJ Software

Who is online

Users browsing this forum: No registered users and 2 guests

more stuff