[on Thu 07 of Jan., 2010 02:38 EST, by zhanx]
If your like me you forget things. and once in a while its not go to forget them. It may result in a few issues.
Like you uploaded something to the Flash and now it don't work right.
This is done on ubuntu using the lastest svn (95)
Navigate to here:
*/leaflabs-read-only/trunk/library/src
edit your main.cpp
here is the default setup for the file
int ledPin = 13;
int toggle=0;
void setup() {
pinMode(ledPin,OUTPUT);
}
void loop() {
digitalWrite(ledPin,HIGH);
delay(200);
digitalWrite(ledPin,LOW);
delay(200);
}
int main(void) {
init();
setup();
while (1) {
loop();
}
return 0;
}
Which is the blinky program. I included it so you can undo any changes that you may have made.
the rest needs to be ran in the terminal.
make sure your path is :
~/leaflabs-read-only/trunk/library$
$make clean
$make LINKER=lanchon-stm32-user-rom.ld DEFFLAGS=VECT_TAB_ROM
The next command get ready but dont hit enter yet:
$sudo make programFlash
unplug your board plug it in. Notice the series of flashes?
5 fast, 3 slow. On the second slow blink hit enter.
This is what you should see:
~/leaflabs-read-only/trunk/library$ sudo make programFlash
dfu-util -a1 -d 0110:1001 -D build/main.bin -R
dfu-util - (C) 2007-2008 by OpenMoko Inc.
This program is Free Software and has ABSOLUTELY NO WARRANTY
Opening USB Device 0x0110:0x1001...
Claiming USB DFU Runtime Interface...
Determining device status: state = appIDLE, status = 0
Device really in Runtime Mode, send DFU detach request...
Resetting USB...
Opening USB Device...
Found Runtime: 0x0110:0x1001 devnum=12, cfg=0, intf=0, alt=1, name="UNDEFINED"
Claiming USB DFU Interface...
Setting Alternate Setting ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
Transfer Size = 0x0400
bytes_per_hash=115
Starting download: ################################################## finished!
state(8) = dfuMANIFEST-WAIT-RESET, status(0) = No error condition is present
Done!
Resetting USB to switch back to runtime mode
This is what you might get:
~/leaflabs-read-only/trunk/library$ sudo make programFlash
dfu-util -a1 -d 0110:1001 -D build/main.bin -R
dfu-util - (C) 2007-2008 by OpenMoko Inc.
This program is Free Software and has ABSOLUTELY NO WARRANTY
No DFU capable USB device found
make: *** programFlash Error 1
You missed the window keep trying. it will take a couple of tries to get it. I kept hammering at it. Took a couple of tries but i got it.
After you see the Done! You should be all set. You can continue back with the IDE and your normally scheduled day.