Due to high demand expect some shipping delays at this time, orders may not ship for 1-2 business days.
0

"stage2" problem
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

"stage2" problem

by klaser on Sun Jul 20, 2008 12:31 pm

Yesterday I accidentally clicked on the stage2.eeprom link in the webgui and canceled the download. When I did that, I got a "webserver exception" on the terminal and then I could no longer boot into the widgets. I could get into the bootloader, but nothing else. When I would try to boot stage2, the ybox would just turn off and not come back on. I clicked on the stage2.eeprom link again and downloaded it completely and now everything works like it did before.

What exactly happened here?

klaser
 
Posts: 8
Joined: Mon Jul 14, 2008 1:55 pm

Re: "stage2" problem

by lou on Sun Jul 20, 2008 12:47 pm

klaser wrote:What exactly happened here?


You cancelled a firmware upload before it was finished. It had written some, but not all, of the firmware, so whenever program flow went to the inconsistent part, the instruction found there was either invalid or made no sense in context. In other words, it crashed.

Reflashing stage2 removed that problem by writing a complete and consistent firmware image.

This is a common problem when flashing an image into anything. If you've ever flashed a PC motherboard BIOS, it's the same deal, and there were probably warnings galore in the documentation of the flash utility. Don't abort firmware uploads in progress. It is worse to have a partial "correct" image than a complete wrong one.
Last edited by lou on Sun Jul 20, 2008 12:51 pm, edited 1 time in total.
lou
 
Posts: 91
Joined: Fri Jul 11, 2008 9:39 am

by klaser on Sun Jul 20, 2008 12:50 pm

I was not writing anything. Unless that's how that feature works, there was no writing going on.

klaser
 
Posts: 8
Joined: Mon Jul 14, 2008 1:55 pm

by lou on Sun Jul 20, 2008 12:55 pm

klaser wrote:I was not writing anything. Unless that's how that feature works, there was no writing going on.


I don't know this platform in particular. What is the intended function of that button? If its function is to upload the stage 2 loader into FLASH/EEPROM, then, yes, writing would be happening under the covers.

In the parlance I use, uploading is host to device, and downloading is device to host.
lou
 
Posts: 91
Joined: Fri Jul 11, 2008 9:39 am

by klaser on Sun Jul 20, 2008 1:16 pm

I understand. I'm not even sure what the point of those links are, but I was extracting the stage2.eeprom file from the ybox.

I usually refer to uploading as when I push a file onto a device, and downloading where I read a file from a device.

klaser
 
Posts: 8
Joined: Mon Jul 14, 2008 1:55 pm

by lou on Sun Jul 20, 2008 1:34 pm

So our parlances agree. That is always far more convenient than when the other person is thinking exactly the opposite.

Assuming that link does what you think it does, I don't know the answer to your original query.
lou
 
Posts: 91
Joined: Fri Jul 11, 2008 9:39 am

by darco on Sun Jul 20, 2008 2:15 pm

The stage two button is for booting into stage two.

Clicking on the stage2.eeprom from your web browser should start downloading the stage2 firmware from your ybox2 to your computer.

It sounds like somehow your stage2 image got corrupted. This isn't a big deal though, because it is easy enough to fix with CURL.

Instructions for how to refresh the stage2 firmware can be at the top of this file: http://svn.deepdarc.com/code/ybox2/trunk/firmware/bootloader.spin.

Simply upload the infowidget binary and you should be fine.


------------------------

EDIT

I misread the original post.

That is really weird behavior. Downloading Stage2 doesn't do write anything to the EEPROM. I'm not exactly sure what happened. Not really the answer you were looking for, but I just wanted to address it.
Last edited by darco on Sun Jul 20, 2008 2:20 pm, edited 1 time in total.
darco
 
Posts: 118
Joined: Wed Jun 04, 2008 7:54 pm
Location: Campbell, CA

by klaser on Sun Jul 20, 2008 2:18 pm

I think I may have a bigger problem. I can't seem to change any of the settings and whenever I try to upload a new widget, it doesn't write anything. It tells me it has written some number of bytes and it is done, but when I reboot it again it just goes back to the info widget and when I try to save new settings the webserver portion stops responding and requires a reboot.

klaser
 
Posts: 8
Joined: Mon Jul 14, 2008 1:55 pm

by darco on Sun Jul 20, 2008 2:24 pm

Try a reset:

Code: Select all | TOGGLE FULL SIZE
       TO RESET: Hold down the button while booting. Keep holding it
                down until the system reboots. You will hear a lot of warning chirps,
                but make sure you hold down the button until it reboots! After it reboots
                let go. Your ybox2 has been reset. This will erase every setting except
                for the MAC address, UUID, and LED configuration. If you forget the
                password, this is what you need to do.


Other than that... Can you show me the exact command line you are using?

Another way to debug these things would be for you to temporarily open a port on your router to the ybox2 and let me have a look at the device myself remotely. (If you want to do this, it would be best to send me the link in a private message)
darco
 
Posts: 118
Joined: Wed Jun 04, 2008 7:54 pm
Location: Campbell, CA

by darco on Sun Jul 20, 2008 2:29 pm

Also: what is the voltage and amp rating on your power supply? If you installed the diode on your ybox2, you will need at least 6v, 300ma. Anything less will cause problems.
darco
 
Posts: 118
Joined: Wed Jun 04, 2008 7:54 pm
Location: Campbell, CA

by darco on Sun Jul 20, 2008 3:11 pm

I just wanted to update anyone else who was following this...

Klaser and I connected via google talk, and I was able to log into his ybox2 remotely and verify that it was indeed misbehaving. It would appear to have accepted new stage2 firmware, but then mysteriously boot into the previous stage2 firmware. (more specifically, the eeprom wasn't being updated)

The reason for this is that pin7 (write protect) on the EEPROM is not being explicitly pulled low. Now according to the datasheet this pin will be internally pulled low if left unconnected... but apparently this isn't always the case.

Adding a haywire from pin7 (the only unconnected pin on the EEPROM) to a pin on the other side of the chip (which are all connected to VSS) fixed his problems.

I would recommend everyone doing the same at some point, especially before upgrading the bootloader if you don't have a prop-plug.
darco
 
Posts: 118
Joined: Wed Jun 04, 2008 7:54 pm
Location: Campbell, CA

Please be positive and constructive with your questions and comments.