Pages: 1 ... 20 21 [22] 23   Go Down
Author Topic: New optiboot; beta testers welcome...  (Read 103444 times)
0 Members and 3 Guests are viewing this topic.
Leeds, UK
Offline Offline
Edison Member
*
Karma: 80
Posts: 1726
Once the magic blue smoke is released, it won't go back in!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I wasn't sure what values OSCCAL could take, so I hedged my bets. The byte would have been wasted anyway as all opcodes are 2bytes long, so it does no harm being there and it acts as an extra measure of protection.
« Last Edit: October 20, 2012, 07:23:56 pm by Tom Carpenter » Logged

~Tom~

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

The byte would have been wasted anyway as all opcodes are 2bytes long

When reading Flash as data it is byte-wise.  Check the LPM instruction for details.
Logged

Leeds, UK
Offline Offline
Edison Member
*
Karma: 80
Posts: 1726
Once the magic blue smoke is released, it won't go back in!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Ahh, you were thinking about reading the flag to check it. I was thinking about the byte of program memory it takes to store. If necessary it can be removed later, but at the moment doing so will not reduce the overall size of the bootloader as it will take up an integer number of 64 byte pages. As it stands, the bootloader takes up exactly 9 pages. If at some point more space us needed, I will remove that check.
Logged

~Tom~

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

There is now a .zip file for Optiboot 5.0
There are no "important" changes for the core Arduino platforms in 5.0, but it does support the ATmega32, ATmega1284, and has a new makefile structure that should make it much easier to build custom version of optiboot from the source.
http://code.google.com/p/optiboot/downloads/detail?name=optiboot-v5.0.zip&can=2&q=
Logged

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


Excellent!  Thank you!
Logged

Global Moderator
Italy
Online Online
Brattain Member
*****
Karma: 332
Posts: 22811
Logic is my way
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

@westfw:
Just a suggestion. You should update the rev. number into the comments of the optiboot.c file .
The last modify is still marked as " Mar 2013 - 4.6"  smiley-wink
Logged


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

@westfw:
i tried to install optiboot5 on IDE 1.5.2 (windows) in the hardware directory, inside the sketch directory, like your installation guide, but do not work

the "hardware directory method" it is valid for 1.5.x branch of IDE ?
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)
Offline Offline
Tesla Member
***
Karma: 134
Posts: 6762
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
You should update the rev. number into the comments
oops!
Logged

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

Code:
make atmega328 AVR_FREQ=16000000 BAUD_RATE=1000000

BAUD RATE CHECK: Desired: 1000000, Real: 1000000, UBRRL = 1, Error=0.0%
avr-gcc -g -Wall -Os -fno-inline-small-functions -fno-split-wide-types -mshort-calls -mmcu=atmega328p -DF_CPU=16000000  -DBAUD_RATE=1000000 -DLED_START_FLASHES=3       -c -o optiboot.o optiboot.c
optiboot.c:277:2: error: #error Unachievable baud rate (too fast) BAUD_RATE
make: *** [optiboot.o] Error 1

Argh!
Logged

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


Why check for a UBRRn value below 3?  The new baud rate check traps troublesome combinations very nicely...


make atmega328 AVR_FREQ=16000000 BAUD_RATE=900000

BAUD RATE CHECK: Desired: 900000, Real: 1000000, UBRRL = 1, Error=-11.1%
avr-gcc -g -Wall -Os -fno-inline-small-functions -fno-split-wide-types -mshort-calls -mmcu=atmega328p -DF_CPU=16000000  -DBAUD_RATE=900000
optiboot.c:252:2: error: #error BAUD_RATE error greater than -5%
make: *** [optiboot.o] Error 1

Logged

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

@westfw:
i tried to install optiboot5 on IDE 1.5.2 (windows) in the hardware directory, inside the sketch directory, like your installation guide, but do not work
the "hardware directory method" it is valid for 1.5.x branch of IDE ?

Sorry for the bump, may you confirm that it is not compatible with IDE 1.5x ?
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)
Offline Offline
Tesla Member
***
Karma: 134
Posts: 6762
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
not compatible with IDE 1.5x
What do you mean by "doesn't work"?  Doesn't compile?  Boards.txt not imported to IDE?  Something else?

The whole multi-platform stuff is still not finalized, so I've been delaying dealing with it.  Actually, it's not working very well with the 1.0 stuff either, at least from a "build" perspective.
Logged

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

I've put up a 5.0a zip file download, due to problems people were having compiling 5.0 on some unix systems.
(I don't actually fix anything, but I now ignore errors in the "baudcheck" target, so that the build will proceed anyway.)

http://code.google.com/p/optiboot/downloads/detail?name=optiboot-v5.0a.zip
Logged

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

Quote
not compatible with IDE 1.5x
What do you mean by "doesn't work"?  Doesn't compile?  Boards.txt not imported to IDE.
Board not appear under Ide 1.5
Logged

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

Rapa Nui
Offline Offline
Edison Member
*
Karma: 60
Posts: 2073
Pukao hats cleaning services
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am not a beta tester, but I have a simple question:
I want conditionally bypass the optiboot. At the start of the optiboot I do a check, and if negative I want to exit optiboot properly and I want enter the actual application. Could you advice me on the proper way, plz?
Thanks.

Another one:
I want add few hundreds bytes of code, placed before the actual optiboot show starts (no impact on the optiboot). The stuff compiles about 670bytes today, it will grow.
Q: provided my code works fine, is the only thing to consider the change of the fuses (to 512 words) and its starting address in boards.txt, or shall I be aware of something other as well?
« Last Edit: June 09, 2013, 02:49:56 pm by pito » Logged

Pages: 1 ... 20 21 [22] 23   Go Up
Jump to: