Pages: 1 2 3 [4] 5 6 ... 23   Go Down
Author Topic: New optiboot; beta testers welcome...  (Read 103681 times)
0 Members and 6 Guests are viewing this topic.
0
Offline Offline
Faraday Member
**
Karma: 47
Posts: 5914
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i'm on win7-64
i used your optiloader with optiboot on 328P with success on an Arduino UNO

after that i tried to update an Atmega8A, the optiloader finish is job with no error, after that i create a new atmega8A board and put the 8A on the UNO board.

but when i try to load blink sketch on 8A by UNO board i receive this error:

Code:
Binary sketch size: 826 bytes (of a 7680 byte maximum)
java.lang.NullPointerException
at processing.app.debug.AvrdudeUploader.uploadViaBootloader(AvrdudeUploader.java:81)
at processing.app.debug.AvrdudeUploader.uploadUsingPreferences(AvrdudeUploader.java:56)
at processing.app.Sketch.upload(Sketch.java:1603)
at processing.app.Sketch.exportApplet(Sketch.java:1568)
at processing.app.Sketch.exportApplet(Sketch.java:1524)
at processing.app.Editor$DefaultExportHandler.run(Editor.java:2293)
at java.lang.Thread.run(Thread.java:619)

Do you have done test on Atmega8A or only on Atmega8 ?

this is the resulp from optiloader:
Code:
--------------------
OptiLoader Bootstrap programmer.
2011 by Bill Westfield (WestfW)

Target power on! ...No RESET pullup detected! - no target?

Target power OFF!

Type 'G' or hit RESET for next chip

OptiLoader Bootstrap programmer.
2011 by Bill Westfield (WestfW)

Target power on! ...
Starting Program Mode [OK]

Reading signature:9307
Searching for image...
  Found "optiboot_atmega8.hex" for atmega8
  Start address at 1E00
  Total bytes read: 482

Setting fuses for programming
  Lock: 3F FFE000  Low: BF FFA000  High: CC FFA800

Programming bootloader: 512 bytes at 0xF00
  Commit Page: F00:F00
  Commit Page: F20:F20
  Commit Page: F40:F40
  Commit Page: F60:F60
  Commit Page: F80:F80
  Commit Page: FA0:FA0
  Commit Page: FC0:FC0
  Commit Page: FE0:FE0

Restoring normal fuses
  Lock: 2F FFE000  Low: BF FFA000  High: CC FFA800

Target power OFF!

Type 'G' or hit RESET for next chip

thanks in advance
« Last Edit: September 11, 2011, 03:02:05 pm by Testato » Logged

- [Guida] IDE - http://goo.gl/ln6glr
- [Lib] ST7032i LCD I2C - http://goo.gl/GNojT6
- [Lib] PCF8574+HD44780 LCD I2C - http://goo.gl/r7CstH

SF Bay Area (USA)
Online Online
Tesla Member
***
Karma: 135
Posts: 6763
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Do you have done test on Atmega8A or only on Atmega8 ?
Only on mega8.  But the error you're seeing is weird (a java exception rather than a more informative message from avrdude.)
Can you try the upload in "verbose" mode (hold shift when clicking button, or change the preferences if you are running 1.0)
You should probably configure boards.txt to say you're compiling for a mega8, even if you have an 8A.  AVRDude may not understand the 8a...
Logged

0
Offline Offline
Faraday Member
**
Karma: 47
Posts: 5914
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I tried in verbose, but the message is about the same:
Code:
Binary sketch size: 826 bytes (of a 7680 byte maximum)
java.lang.NullPointerException
at processing.app.debug.AvrdudeUploader.uploadViaBootloader(AvrdudeUploader.java:81)
at processing.app.debug.AvrdudeUploader.uploadUsingPreferences(AvrdudeUploader.java:56)
at processing.app.Sketch.upload(Sketch.java:1603)
at processing.app.Sketch.exportApplet(Sketch.java:1568)
at processing.app.Sketch.exportApplet(Sketch.java:1524)
at processing.app.Editor$DefaultExportAppHandler.run(Editor.java:2327)
at java.lang.Thread.run(Thread.java:619)

This is the board created by me:
Code:
8Aoptiboot.name=Atmega8A (OptiBoot)
8Aoptiboot.protocol=stk500
8Aoptiboot.upload.maximum_size=7680
8Aoptiboot.upload.speed=115200
8Aoptiboot.bootloader.low_fuses=0xbf
8Aoptiboot.bootloader.high_fuses=0xcc
8Aoptiboot.bootloader.path=optiboot
8Aoptiboot.bootloader.file=optiboot_atmega8.hex
8Aoptiboot.bootloader.unlock_bits=0x3F
8Aoptiboot.bootloader.lock_bits=0x2F
8Aoptiboot.build.mcu=atmega8
8Aoptiboot.build.f_cpu=16000000L
8Aoptiboot.build.core=arduino

what do you think ?
the atmega8 (non the A version), work on arduino UNO board with your optiboot version ?
Logged

- [Guida] IDE - http://goo.gl/ln6glr
- [Lib] ST7032i LCD I2C - http://goo.gl/GNojT6
- [Lib] PCF8574+HD44780 LCD I2C - http://goo.gl/r7CstH

SF Bay Area (USA)
Online Online
Tesla Member
***
Karma: 135
Posts: 6763
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

(part of the point is that it shouldn't be throwing java exceptions, even if the bootloader is totally munged and avrdude is busted as well.  Try using board names that don't begin with a number, or something.  (shouldn't matter.  Didn't seem to matter here (although there was an unexplained crash of the whole IDE.)  But it makes me nervous.)

Yes, it works fine here.  I have:
Code:
opti8.name=Arduino Optiboot8
opti8.upload.protocol=stk500
opti8.upload.maximum_size=7680
opti8.upload.speed=115200
opti8.bootloader.low_fuses=0xbf
opti8.bootloader.high_fuses=0xdc
opti8.bootloader.path=optiboot
opti8.bootloader.file=optiboot_mega8.hex
opti8.bootloader.unlock_bits=0x3F
opti8.bootloader.lock_bits=0x0F
opti8.build.mcu=atmega8
opti8.build.f_cpu=16000000L
opti8.build.core=arduino
/Applications/arduino/arduino-0022/Arduino-0022.app/Contents/Resources/Java/hardware/tools/avr/bin/avrdude -C/Applications/arduino/arduino-0022/Arduino-0022.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega8 -cstk500v1 -P/dev/tty.usbmodemfd3131 -b115200 -D -Uflash:w:/tmp/applet1234/Blink.cpp.hex:i

avrdude: Version 5.4-arduino, compiled on Oct  9 2007 at 11:20:31
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

         System wide configuration file is "/Applications/arduino/arduino-0022/Arduino-0022.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf"
         User configuration file is "/Users/billw/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port            : /dev/tty.usbmodemfd3131
         Using Programmer      : stk500v1
         Overriding Baud Rate  : 115200
« Last Edit: September 12, 2011, 12:10:08 am by westfw » Logged

Deep south of Italy
Offline Offline
Faraday Member
**
Karma: 8
Posts: 2955
The quieter you become, the more you can hear
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@westfw can i add your version of the optiboot bootloader/bootstrapper to ArduOpen ide?
Logged

0
Offline Offline
Faraday Member
**
Karma: 47
Posts: 5914
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

the worst problem is always the stupid problems   smiley

change this:
8Aoptiboot.protocol=stk500

to this:
8Aoptiboot.upload.protocol=stk500

 smiley

thanks

p.s. ArduOpen ide is a very good program, whit your modified optiboot and the optiloader it wil be perfect.
Logged

- [Guida] IDE - http://goo.gl/ln6glr
- [Lib] ST7032i LCD I2C - http://goo.gl/GNojT6
- [Lib] PCF8574+HD44780 LCD I2C - http://goo.gl/r7CstH

0
Offline Offline
Faraday Member
**
Karma: 47
Posts: 5914
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Your Optiloader and Optiboot is very good.
I make more tests, and I used Optiloader on Atmega8A also, by reducing the sketch (i leave only one bootloader in it). In this way i used Atmega8A with Optiloader on it, for load optiboot on another Atmega8A.

If you are interested may translate from italian by google:
http://arduino.cc/forum/index.php/topic,72005.msg538794.html#msg538794
Logged

- [Guida] IDE - http://goo.gl/ln6glr
- [Lib] ST7032i LCD I2C - http://goo.gl/GNojT6
- [Lib] PCF8574+HD44780 LCD I2C - http://goo.gl/r7CstH

SF Bay Area (USA)
Online Online
Tesla Member
***
Karma: 135
Posts: 6763
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
can i add your version of the optiboot bootloader/bootstrapper to ArduOpen ide?
Sure.  There's a slightly updated version now on github: https://github.com/WestfW/OptiLoader
It adds a couple changes to clarify the "unrecognized signature" error that also results from misconnections,
and adds an explicit license (MIT Open software license.)

Does arduOpen permit the "boards" menu to be customizable by the user?  Normally "adding lots of new CPUs" and "keeping things simple" are difficult to do at the same time.
Logged

Deep south of Italy
Offline Offline
Faraday Member
**
Karma: 8
Posts: 2955
The quieter you become, the more you can hear
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Great! thank you westfw. smiley-wink it will be added to the next build of ArduOpen for windows(023BB3) .
ArduOpen does nor prmit to the user to customize the boards, but they are arranged in groups and cores (the way they don't go out of the screen).
At this time we have the attiny, atmega and atcan familyes.
Logged

Global Moderator
Dallas
Online Online
Shannon Member
*****
Karma: 208
Posts: 12940
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


I realize Optiboot is at the fringe of available space so I'm posting this to start a discussion rather than asking for a change.

Occasionally, a user "bricks" their Arduino by flooding the serial port.  Something like this seems to cause problems...

Code:
void setup( void ) { Serial.begin( 115200 ); }

void loop( void ) { Serial.write( 'x' ); }

An occasional request from new users is the ability to "reset the board to factory defaults" or "clear the board".  They either want a way to get past the "serial flood" problem or they want to ensure the loaded sketch does not muck with the I/O after they changed the wiring.

My idea is simple... To clear the board, the user places a low-value resistor (but not so low as to exceed the current limit) from TX to GND.  The bootloader enables the internal pullup resistor on TX.  If the pin reads low, the user has put the "clear board resistor" in place.  The bootloader clears the Flash and then waits indefinitely for avrdude.

If the pin reads high, the bootloader disables the internal pullup and then goes about its normal business.

Thoughts?
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17294
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Thoughts?

Isn't the root problem with the firmware in the 8u2 rather then the bootloader? I don't recall 'serial flooding' being a problem with FTDI based boards? If that is the case, wouldn't a better solution be to fix the 8u2 firmware? Just asking, not at all sure of the symptom/problem as I'm still optiboot free at this time.  smiley-wink

Lefty
Logged

Global Moderator
Dallas
Online Online
Shannon Member
*****
Karma: 208
Posts: 12940
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Isn't the root problem with the firmware in the 8u2 rather then the bootloader? I don't recall 'serial flooding' being a problem with FTDI based boards?

I can't remember which boards / bootloaders have the problem and which don't.  (and the day-job has me too overloaded to research the answer)

Quote
If that is the case, wouldn't a better solution be to fix the 8u2 firmware?

Absolutely!

Regardless of the "serial flood" problem, a "clear board" feature would occasionally be handy.

Quote
Just asking,

And thank you for asking!  That's how the best ideas are formed.  Civil discussion.  If only our (old enough to know better) political leaders would do the same.  I think we need a "clear the board" feature for ballots.  And now back to our regularly scheduled program...

Quote
not at all sure of the symptom/problem as I'm still optiboot free at this time.  smiley-wink

If you use the Arduino ISP sketch, it is definitely worth the update.  And, I know, you have a proper programmer.
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17294
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
a "clear board" feature would occasionally be handy.

 Possibly, however the actual clear operation would have to be done in firmware by the bootloader and after all the size trimming to get to the Uno's minimum possible bootloader size, I suspect there would be no room for adding that code?

 Also the Arduino hardware designers seem to lough hardware jumpers, it might be a hard sell. And if they ever do bring back hardware jumpers I would rather or also want a auto-reset enable/disable jumper and maybe even a board voltage selector jumper. I still to this day believe 'artists' can be trained to properly utilize and configure jumper clips.  smiley-wink

Lefty
Logged

Global Moderator
Dallas
Online Online
Shannon Member
*****
Karma: 208
Posts: 12940
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
a "clear board" feature would occasionally be handy.
Possibly

It is.  Trust me.   smiley-grin

Quote
however the actual clear operation would have to be done in firmware by the bootloader

Yup.

Quote
and after all the size trimming to get to the Uno's minimum possible bootloader size, I suspect there would be no room for adding that code?

If the feature was added to Optiboot, it would enlarge to the size of the Duemilanove bootloader.  I envision it being a compile-time option.

Quote
Also the Arduino hardware designers seem to lough hardware jumpers, it might be a hard sell

I was thinking a loose resistor would be used.  A jumper (or even better, a pushbutton) would certainly be handy but not worth the extra cost (with the possible exception of an "academic" board).

Quote
And if they ever do bring back hardware jumpers I would rather or also want a auto-reset enable/disable jumper and maybe even a board voltage selector jumper

I agree!

Quote
I still to this day believe 'artists' can be trained to properly utilize and configure jumper clips.  smiley-wink

...and software types.
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17294
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
...and software types.

Humm, am I willing to go that far in my expectations? OK sure why not, it's no bigger a burden then training/coaching new users to use resistors with their leds.  smiley-wink
Logged

Pages: 1 2 3 [4] 5 6 ... 23   Go Up
Jump to: