Creating a generic firmware upload tool

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

Moderators: 99jonathan, roger, imaqine

Creating a generic firmware upload tool

Postby lejosfan » Fri Oct 14, 2011 4:54 pm

Hello guys,

I am trying to create a firmware upload tool for the Atmel devices (SAM7S and SAM7X) that would run in Windows 7 (32 and 64).

To that end, I have successfully adapted the NXJFlashG tool to update firmware in any device that uses the SAM7S, and it's working fine.
The problem I'm having right now is that it doesn't work for the SAM7X512 microcontroller.

I realize this may be a little off the forum's goals, but I'd immensely appreciate if I could get any pointers from the Lejos developers on what could be the problem. When I try to update a SAM7X512, the program displays on the console "Found SAM-BA v2.0" instead of "SAM-BA v1.4" displayed on I update the LEGO's brick for instance.

Any help is greatly appreciated. Thanks.

Lejosfan
lejosfan
New User
 
Posts: 19
Joined: Sat Jan 24, 2009 6:45 pm

Re: Creating a generic firmware upload tool

Postby skoehler » Fri Oct 14, 2011 5:45 pm

There are several potential problems here:
  • the piece of code we upload to the NXT's RAM to be able to write Flash pages may not work on a SAM7X. See here for the source code of FlashWrite.bin, which is responsible for writing to Flash
  • the SAM-BA protocol may differ. See here for my documentation of the SAM-BA. It would also be helpful to see a protocol-trace of Atmel's SAM-BA software tool. Note that in principle, the tool works the same way: it uploads a piece of software to the CPU's RAM, and then uses subroutines of that program to write flash pages

May I ask, why you don't use Atmel's tool?
skoehler
leJOS Team Member
 
Posts: 1448
Joined: Thu Oct 30, 2008 4:54 pm

Re: Creating a generic firmware upload tool

Postby lejosfan » Fri Oct 14, 2011 6:14 pm

Thanks for the reply skoehler.

To answer your question: it's because I am tired of trying anything and everything to make the Atmel's SAM-BA GUI work on Windows 7 (64 bits) and it simply doesn't work. I have tried JDK 32bits, SAM-BA 2.10, SAM-BA 2.9, nothing seems to work, although it works fine in a Windows XP machine.

And I see that quite a few people on the Web is having the same problem; when I try to update the driver and point the driver folder of SAM-BA 2.10, for instance, Windows complains that that is not a Windows 64bit driver.

Now to your comments: I might be able to capture a protocol trace of Atmel's SAM-BA. Would you take a look at it if I did?
Also, the SAM7X512 has two 256K flash banks (2 controller?). Could that be a possible cause of the problem?

Thanks a million.
lejosfan
New User
 
Posts: 19
Joined: Sat Jan 24, 2009 6:45 pm

Re: Creating a generic firmware upload tool

Postby skoehler » Fri Oct 14, 2011 7:01 pm

lejosfan wrote:To answer your question: it's because I am tired of trying anything and everything to make the Atmel's SAM-BA GUI work on Windows 7 (64 bits) and it simply doesn't work. I have tried JDK 32bits, SAM-BA 2.10, SAM-BA 2.9, nothing seems to work, although it works fine in a Windows XP machine.


I have been using Atmel's SAM-BA 2.10 software on both Windows and Linux. Works like a charm. But you need to switch the driver from the Lego driver to Atmel's one. If the device manager doesn't show a virtual COM port, it won't work.

lejosfan wrote:And I see that quite a few people on the Web is having the same problem; when I try to update the driver and point the driver folder of SAM-BA 2.10, for instance, Windows complains that that is not a Windows 64bit driver.

I wonder whether I had this issue and patched the inf file. Can't remember whether I did that. But make Windows 7 search on Windows Update for a driver. It will find one which creates a virtual COM port.

lejosfan wrote:Now to your comments: I might be able to capture a protocol trace of Atmel's SAM-BA. Would you take a look at it if I did?


Google for free serial port monitor

lejosfan wrote:Also, the SAM7X512 has two 256K flash banks (2 controller?). Could that be a possible cause of the problem?


Certainly.
skoehler
leJOS Team Member
 
Posts: 1448
Joined: Thu Oct 30, 2008 4:54 pm

Re: Creating a generic firmware upload tool

Postby lejosfan » Fri Oct 14, 2011 8:55 pm

Hi.

So, here's what I just tried with no success:

1. Installed SAM-BA 2.10 in a Windows 7 64bits machine.
2. Connected my SAM7S256 device to USB (connecting a SAM7X makes no difference)
3. Windows' Device Manager detects a device called "GPS Camera Detect", which creates a virtual COM port (COM3) just like you said it would.
4. Started SAM-BA, which takes about a minute to show the initial dialog box that reads "COM3, no board"
5. Then I select from the drop-down my board type. The dialog now reads "COM3, at91sam7s256-ek"
6. When I press "Connect", I get the message box "Communication Error".

Sorry for being verbose, but I am trying to see if there is anything I might be missing.

Can you confirm if your Windows 7 is 64bits (Control Panel -> System will tell). If it is, any other trick I could try?

Thanks for trying to help me.
Lejosfan.
lejosfan
New User
 
Posts: 19
Joined: Sat Jan 24, 2009 6:45 pm

Re: Creating a generic firmware upload tool

Postby skoehler » Sat Oct 15, 2011 12:32 pm

I will retry using the Atmel Software on Windows 7 64Bit during the next days. I will report back.
You're problem however reminds me of one issue: aren't there two shortcuts in the startmenu? One CDC version and one non-CDC version? You need to run the CDC version.
skoehler
leJOS Team Member
 
Posts: 1448
Joined: Thu Oct 30, 2008 4:54 pm

Re: Creating a generic firmware upload tool

Postby skoehler » Sun Oct 16, 2011 11:23 am

I pushed the hidden reset button of the NXT. Afterwards it was clicking and running SAM-BA.
I connected it via USB, and in the device manager, I switched the driver from the Lego one to "GPS Camera Detect" and it was listed as "GPS Camera Detect (COM12)".

I started the Atmel SAM-BA software via the shortcut "SAM-BA v2.10_cdc" from the startmenu. It takes a while to start. I then chose COM12 and at91sam7s256-ek and it connected without a hassle.

This was done on Windows 7, 64Bit.
skoehler
leJOS Team Member
 
Posts: 1448
Joined: Thu Oct 30, 2008 4:54 pm


Return to NXJ Software

Who is online

Users browsing this forum: Google [Bot] and 5 guests

more stuff