Go Down

Topic: NEWER New Optiboot bootloader (Read 92379 times) previous topic - next topic

westfw


Quote
I asked this some time ago, but did NOT got definitive answer.
Can be those boatloader used in commercial Products like Arduino UNO "clones"?
Yes.
The original author licensed Optiboot under GPL2, and it would certainly be painful to change the license since he disappeared.  I'm not sure that it's clearly defined what GPL2 means WRT bootloaders, but I'd put them in the same class as Desktop Operating Systems - of course you can write commercial products that run on open source operating systems!  If you make changes to optiboot itself as part of your commercial product, you should be prepared to release those changes as open source as well.  Personally, I lean toward less viral licenses (MIT or BSD.)


Quote
Which kind of bootloader those boards from China are using as bootloadeR?
How could anyone possibly know that?  Reports have ranged from Optiboot (but I don't know what version) (especially for Uno clones), Atmegaboot (especially on Nano clones), Adaboot (on Pro Mini clones, as per Sparkfun?), and "doesn't seem to have any bootloader at all".



Maverick71

Thanks,

I would not going to change anything on the software.
But without the software the hardware is useless.

I want to use 328PB under the IDE, but have got some problems here.
I have changed the board file and placed the hex file to the correct directory.
I also changed the pins_arduino.h file.

Code: [Select]
optibootxmini328pb.name=Optiboot Xplained Mini 328pb

optibootxmini328pb.upload.tool=arduino:avrdude
optibootxmini328pb.upload.protocol=arduino
optibootxmini328pb.upload.speed=57600

optibootxmini328pb.bootloader.tool=arduino:avrdude
optibootxmini328pb.bootloader.unlock_bits=0x3F
optibootxmini328pb.bootloader.lock_bits=0x2F

optibootxmini328pb.build.f_cpu=16000000L

optibootxmini328pb.build.board=AVR_UNO
optibootxmini328pb.build.core=arduino:arduino
optibootxmini328pb.build.variant=arduino:standard

optibootxmini328pb.upload.maximum_size=32128
optibootxmini328pb.upload.maximum_data_size=1024

optibootxmini328pb.bootloader.low_fuses=0xBF
optibootxmini328pb.bootloader.high_fuses=0xCE
optibootxmini328pb.bootloader.extended_fuses=0xFF
optibootxmini328pb.bootloader.file=optiboot/optiboot_xplained328pb.hex

optibootxmini328pb.build.mcu=atmega328p


I'm still not able to upload anything over IDE.

Any Ideas why?

Regards,
Maverick

Maverick71

I get this error:


Code: [Select]
Warning: Board arduino:avr:atmega328bb doesn't define a 'build.board' preference.
Auto-set to: AVR_ATMEGA328BB

avr-g++: error: unrecognized argument in option '-mmcu=atmega328pb'

avr-g++: note: valid arguments to '-mmcu=' are: at43usb320 at43usb355 ... and so on



Do You know where can I add my board (mmcu) ?


Regards,
Maverick

Coding Badly


Supported processors are burned into the compiler.  You need a newer toolset.


Maverick71

Hello,

Newer toolset?

I made the hex file with atmel studio 7.
The IDE is package version 1.6.9

What exactly should I update?

Coding Badly

#65
Jun 11, 2016, 04:19 am Last Edit: Jun 11, 2016, 04:25 am by Coding Badly

In the past, I have just copied the toolset from Atmel Studio to the correct location in the Arduino IDE directory.  I have also copied the entirety of... http://www.atmel.com/tools/ATMELAVRTOOLCHAINFORWINDOWS.aspx ...to the correct location in the Arduino IDE directory.  I believe I have even posted detailed instructions on this forum.

Yup...
http://forum.arduino.cc/index.php?topic=168152.msg1252235#msg1252235
But that may be out-of-date.


westfw

The easiest way to get a PB working is to pretend that it's just a 328P.
After that is "working" (bootloader burnt, sketches uploading successfully) you can start to think about how to access the PB features...  (in fact, the current optiboot PB support pretends to be a mere P, because of the state of the Arduino IDE compiler/etc.)

(The AS7 (7.0.943) that I installed TODAY does seem to support the 328PB.)


Maverick71

in fact, the current optiboot PB support pretends to be a mere P, because of the state of the Arduino IDE compiler/etc.
(The AS7 (7.0.943) that I installed TODAY does seem to support the 328PB.)
Yes, I saw that line in our code -> optibootxmini328pb.build.mcu=atmega328p

I try to get a solution to get it work under the Arduino IDE.

Regards,
Maverick

hawkagent

Hello

I have downloaded the newest Optiboot from github and placed it under 'Documents/Arduino/hardware/'. However whenever I try to burn the bootloader (Optiboot 28pins, 8Mhz) to an atmega328p with an USBasp I get the following error:
Code: [Select]
java.lang.NullPointerException
at cc.arduino.packages.uploaders.SerialUploader.burnBootloader(SerialUploader.java:363)
at processing.app.Editor.lambda$handleBurnBootloader$42(Editor.java:2752)
at java.lang.Thread.run(Thread.java:745)
Error while burning bootloader.

Also when I try to compile Blink, I get:
Code: [Select]

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x1 addr=0x0 pc=0x4b39ba]

goroutine 1 [running]:
arduino.cc/builder.(*SetupBuildProperties).Run(0x692034, 0x12054000, 0x0, 0x0)
c:/jenkins/workspace/arduino-builder-windows/src/arduino.cc/builder/setup_build_properties.go:86 +0x10ba
arduino.cc/builder.(*ContainerSetupHardwareToolsLibsSketchAndProps).Run(0x692034, 0x12054000, 0x0, 0x0)
c:/jenkins/workspace/arduino-builder-windows/src/arduino.cc/builder/container_setup.go:59 +0x4e6
arduino.cc/builder.runCommands(0x12054000, 0x12025dc4, 0x3, 0x3, 0x1, 0x0, 0x0)
c:/jenkins/workspace/arduino-builder-windows/src/arduino.cc/builder/builder.go:181 +0xe2
arduino.cc/builder.(*ParseHardwareAndDumpBuildProperties).Run(0x12025df0, 0x12054000, 0x0, 0x0)
c:/jenkins/workspace/arduino-builder-windows/src/arduino.cc/builder/builder.go:170 +0x157
arduino.cc/builder.RunParseHardwareAndDumpBuildProperties(0x12054000, 0x0, 0x0)
c:/jenkins/workspace/arduino-builder-windows/src/arduino.cc/builder/builder.go:217 +0x35
main.main()
c:/jenkins/workspace/arduino-builder-windows/src/arduino.cc/arduino-builder/main.go:307 +0xfd7
arduino-builder returned 2

Error compiling for board Optiboot on 28-pin cpus.

Obviously the paths are wrong (There is no C:\jenkins\workspace\). I'm sure I've missed a huge step during install, how can I fix this?

westfw

Did it work for normal platform builds before you tried to add the ne optiboot?
What ide version are you using?

hawkagent

Did it work for normal platform builds before you tried to add the ne optiboot?
What ide version are you using?

When "Atmega328 on a breadboard 8Mhz" (from tutorial) is selected I can burn the bootloader and upload sketches without problems, is that what you mean?

I'm using Arduino IDE 1.6.9

Maverick71

@westfw Could You complete optiboot for the 328PB?

nebula83

@westfw I am using WinAVR-20100110 to compile optiboot. I am now sanity checking my output by comparing the original hex file with my compiled version. They match up except for this line:

Original
   :087FD000E7DFEE27FF2709940B

Fresh compile
   087FD000E7DFE0E0FF27099460


The most important bit being E7DFEE27FF270994 versus E7DFE0E0FF270994 (E27 or 0E0)
Is this a relevant difference? And what does it mean?

Isaac96

Does anyone know if there is a version of optiboot for the ATTiny 4313? I went through the old optiboot thread searching for it. No luck. Incidentally, I have 1Kbyte of flash remaining.
Do not PM me for help. I will delete immediately.
CONNECT THE GROUNDS!

After Tuesday, even the calendar goes W T F

westfw

Quote
The most important bit being E7DF EE27 FF27 0994 versus E7DF E0E0 FF27 0994 (E27 or 0E0)
The original has an instruction:
Code: [Select]
    7fd0:       e7 df           rcall   .-50            ; 0x7fa0 <watchdogConfi\
g>                                                                             
  __asm__ __volatile__ (                                                       
    7fd2:       ee 27           eor     r30, r30                               
    7fd4:       ff 27           eor     r31, r31                               
    7fd6:       09 94           ijmp             


With the EE27 instruction being the "eor r30, r30" - an exclusive or with yourself is one way to clear the register.
The new version has "e0e0" instead, which is "ldi r30, 0" - which does the same thing (zero the register.)  So you should be fine...


Go Up