I haven't been playing with my Mindstorms for a while but since I have to teach a summer class on it, I pulled it out of storage and fired up RobotC. It informed me there is a newer RobotC version v3.61. So I downloaded and installed it on my laptop. So the obvious next step is to flash the brick with corresponding new firmware. For some reason it failed and the brick started clicking. I thought I did something wrong. So I pulled out a second brick and it failed too. Long story short, I managed to brick 3 NXT bricks. I powered them down, pulled the battery etc. But as soon as I reinserted the battery, the brick started clicking and hung. RobotC does not see these bricks at all, saying something about cannot find any brick in boot mode. Does anybody know what has gone wrong and how to unbrick them?

_________________A.K.A. inxt-generationSelf-proclaimed genius, and future world dominator.My Brickshelf Folder"Don't they teach recreational mathematics anymore?" - The Tenth DoctorBow down to Nikola Tesla, King of the Geek Gods.

Tue Jul 16, 2013 12:38 am

MHTS

Guru

Joined: Sun Nov 15, 2009 5:46 amPosts: 1523

Re: Failed to download firmware and the brick is bricked

Alright, I fixed my own problem. Here are the details:When the brick was clicking, it was in boot mode waiting for firmware update. However, RobotC didn't see the brick. Upon examining device manager, I noticed the brick had a device description "Bossa Program Port". That's strange because I remember it should be "LEGO MINDSTORMS NXT". Uninstalling the driver and reinstalling it yielded the same "Bossa Program Port". So I noted the hardware ID of the "Bossa Program Port" from device manager (USB\VID_03EB&PID_6124). Then I went to the c:\Windows\inf directory and searched for that ID. That ID appeared in two INF files oem11.inf and oem42.inf. oem11.inf has the device description "LEGO MINDSTORMS NXT Firmware Update Mode" and oem42.inf has the description "Bossa Program Port". So that's why it installed the wrong driver. Knowing that, I renamed oem42.inf to oem42.inf.bak and then uninstalled "Bossa Program Port" from device manager. Unplugging the USB cable of the brick and re-plugging it in enumerated and installed the correct driver. I can now download the firmware correctly. Problem fixed.Now, the question is: who installed oem42.inf? I think I know the answer. I recently acquired a Freeduino board and downloaded the Arduino development environment. I'd bet the Freeduino board has the same device ID as the "LEGO MINDSTORMS NXT Firmware Update Mode" device. After all, I think Freeduino uses the same controller as the Mindstorms (ATMEGA328P). That's surely confusing. I wonder if there is anything RobotC can do to prevent this from happening (e.g. when updating firmware failed, call SetupDi API to check the device description to make sure the driver is "Mindstorms firmware update mode". If not, either automatically reload the "firmware update mode" driver or at least warn the user about it. Or at least publish a trouble shooting FAQ. Alternatively, I don't have time to check this possibility out but it may be possible to differentiate the Freeduino and Mindstorms devices using Subsystem ID. If they do use different subsystem IDs, you could author the Mindstorm INF with the Subsystem ID info as part of the device ID. This way, Windows will pick the correct INF to install.

Tue Jul 16, 2013 5:36 am

tfriez

Site Admin

Joined: Wed Jan 24, 2007 10:42 amPosts: 620

Re: Failed to download firmware and the brick is bricked

It's actually the Arduino IDE itself... Their Arduino Due (using a Atmel 32-bit processor, similar to the NXT)

Tim,Thanks for looking into this. That's exactly what I suspect. The Freeduino is a version of the Arduino and is using the same Arduino IDE. It is unfortunately that they shared the exact same hardware ID. That makes Windows Plug and Play impossible to tell them apart. I noticed your picture shows the NXT has a revision number 0110. I know there are at least two hardware versions of the NXT Mindstorms. If you can check the hardware revision of all the Mindstorms versions and include the revision info into the Mindstorms INF. For example in the NXT's inf:

When Windows Plug and Play sees the hardware ID appearing in more than one INF, and seeing that the NXT's INF has a revision ID that matches exactly of the NXT's, it will pick the NXT's INF instead of the Arduino's INF. Even in the worst case that you did not include all possible NXT's revisions in the INF, the fact that you still have the hardware ID without revision in the NXT's INF, it will still install the NXT's driver if there is no Arduino INFs around. In other words, the INF change is backward compatible (i.e. it will do no worse than before).Hope that helps your investigation of the mitigation.

Last edited by MHTS on Sun Sep 29, 2013 10:12 pm, edited 1 time in total.

Fri Jul 26, 2013 1:12 pm

tfriez

Site Admin

Joined: Wed Jan 24, 2007 10:42 amPosts: 620

Re: Failed to download firmware and the brick is bricked

The trouble is we don't do the low-level device searching ourselves. LEGO/NI have provided their Fantom interface for enumerating the bricks and doing wifi/bluetooth connections and stuff. Apart of this is enumerating bricks that require firmware (because they're clicking and in "bootload" or "Firmware Update" mode) and then sending them the firmware file. If you've ever gotten this in ROBOTC, you'll see the Brick Name reports back as "SAMBA", which is the "SAM Boot Assistant (SAM-BA)"

The VID/PIDs correspond to the fancy bootloader that's found by default on the SAM7S series chips (which happens to be the NXT and the Arudino Due) - Hence the conflict because neither have customized this bootloader to use a different VID/PID and opted to use the out of box solution in the hope that someone else hadn't.

Because the device doesn't use the LEGO .inf definition for the device, the Fantom driver reports back to ROBOTC that there are no bricks available. My guess is that LabVIEW and NXT-G will suffer from this same issue since they use the same interface.

Our options are either A) Hope not too many folks run into it and try and support them via a support/wiki page or B) Rewrite the bootloader download process that fantom provides for us to mitigate this issue ourselves.

Our options are either A) Hope not too many folks run into it and try and support them via a support/wiki page or B) Rewrite the bootloader download process that fantom provides for us to mitigate this issue ourselves.

Now that you guys are supporting Arduino with RobotC, I think this problem may happen more often than you anticipate. I am sure people who tinker with Arduino would have installed the Arduino IDE once upon a time. So if they also play with NXT, they will see this issue. I know you guys are very busy in releasing 4.0. If you guys need help in rewriting the bootloader, let me know and see if I can spare some cycles on it.

Fri Jul 26, 2013 4:03 pm

chuckmerja

Rookie

Joined: Sat Oct 25, 2008 12:18 amPosts: 19

Re: Failed to download firmware and the brick is bricked

THANKS!

I ran into this problem with new RobotC (v 3.6...) and new firmware AND new Arduino. I do NOT have this problem on a Win 7, Dell Laptop using Arduino v 1.0.1 and RobotC 3.54 (firmware = NxT_0955.rfw).

So did this arise in the new NxT/Arduino firmware? Do we uninstall the new Arduino IDE and go back to 1.0.1? Or was I just lucky somehow with 3.54 and Arduino 1.0.1?How will this impact RobotC for Arduino and NxT?

Tue Jul 30, 2013 9:26 am

MHTS

Guru

Joined: Sun Nov 15, 2009 5:46 amPosts: 1523

Re: Failed to download firmware and the brick is bricked

As long as the INFs shows both Arduino and the NXT firmware mode shared the same device ID, this will happen. Having said that, it will happen only if you have installed the Arduino IDE and then decided to flash the NXT firmware. If you flash the NXT firmware first then install the Arduino IDE, then there is no problem. The problem is that the NXT reports different device IDs when in normal mode and in firmware mode. It is the device ID in firmware mode that's in conflict with the Arduino.

Tue Jul 30, 2013 11:59 am

TedGoessling

Rookie

Joined: Sun Sep 29, 2013 5:51 pmPosts: 1

Re: NXT Firmware Update & Arduino IDE Issues (Renamed)

MHTS,

THANK YOU for figuring this out and presenting a clear explanation. I thought I was losing my mind. After getting a new Windows 8 laptop, I installed the Arduino software for my own fun, and the RobotC software for FTC robotics mentor duties. I then tried to update the NXT firmware and bricked the brick. After several hours of research that involved loading LabView, Mindstorms 1.1, and LeJOS, among other efforts to successfully get the firmware loaded, I found your post. I uninstalled the Aruduino software and all was well. Thank You!

I don't know what can be done to remedy this problem for others, but I'd suggest that the RobotC and Arduino developers work together on a fix. The NXT and Arduino camps have overlapping members, especially when it comes to geeky kids and their parents. RobotC Team, please do what you can to make this issue clearer. Maybe detect the Arduino software? Something.

Glad to finally be moving again!

Ted G.

Sun Sep 29, 2013 6:07 pm

MHTS

Guru

Joined: Sun Nov 15, 2009 5:46 amPosts: 1523

Re: NXT Firmware Update & Arduino IDE Issues (Renamed)

Ted,Thank you for reporting this. It will give an idea to the RobotC folks this is a real problem that may not be as rare as one thought.

Sun Sep 29, 2013 10:09 pm

MHTS

Guru

Joined: Sun Nov 15, 2009 5:46 amPosts: 1523

Re: NXT Firmware Update & Arduino IDE Issues (Renamed)

TedGoessling wrote:

After several hours of research that involved loading LabView, Mindstorms 1.1, and LeJOS, among other efforts to successfully get the firmware loaded,...

Ted,I reread your post and was unclear about when you said you "successfully get the firmware loaded" after trying all the loading LabView, Mindstorms 1.1, LeJOS and other efforts that if you meant they all failed or one of them did work? If one of them did work, I want to figure out how.

I registered just so I could thank MHTS for this clear explanation of what I was running into last week. IE I had this same problem and nothing worked until I read this thread and I was finally able to Un-Brick my Brick. Thanks again MHTS!

Mon Nov 04, 2013 7:40 am

MHTS

Guru

Joined: Sun Nov 15, 2009 5:46 amPosts: 1523

Re: Failed to download firmware and the brick is bricked

tfriez wrote:

The trouble is we don't do the low-level device searching ourselves. LEGO/NI have provided their Fantom interface for enumerating the bricks and doing wifi/bluetooth connections and stuff.

Tim,I just got to think about this some more. Didn't you guys redistribute the Fantom driver and INF in the RobotC installer? If so, you have the opportunity to fix the INF. You don't have to include them AS-IS. The only problem of course is that once you alter the INF, you need to digitally re-sign the driver package or Windows will complain about "tampering" (i.e. the driver is not digitally signed). And of course your hands may be tied if they distributed the driver package to you as a binary installer. I think the proper way is to contact the LEGO/NI folks and ask them to fix the INF by including the REV ID in their hardware IDs. That allows Windows Plug and Play to differentiate Mindstorms from Arduino.

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum