Go Down

Topic: Optiboot for 8MHz 3.3V Arduino Pro Mini (Read 9710 times) previous topic - next topic

fanofard

But anyway - I still do not know why the 115200 baud / 16MHz optiboot bootloader does not work with the pro mini using 57600 baud when uploading sketch. But I will have to stop thinking about this because I wasted a lot of time yesterday with that unsuccessful experiments.

parthk

I did try the same thing but didnt work for me. Bootloader uploaded successfully but cant upload program. But its working correctly with pro mini 8mhz bootloader.
Getting following errors. I am using ft232rl for programming and Arduino as ISP for burning bootloader.


Sketch uses 1,042 bytes (3%) of program storage space. Maximum is 32,256 bytes.
Global variables use 9 bytes of dynamic memory.
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x5a
avrdude: stk500_recv(): programmer is not responding

SukkoPera

Well, same problem here. I tried compiling my own Optiboot at 115200@8 MHz but I haven't been able to carry out a single upload with that.
"Code is read much more often than it is written, so plan accordingly. Design for readability."

Guida rapida a ESP8266: https://goo.gl/kzh62E

parthk

SukkoPera.. Can you try to compile your optiboot with 57600 baud rate?

SukkoPera

I'll try ASAP. What is really strange is that the stock Optiboot works fine on a few standalone 328's I flashed it on, using the internal 8 MHz clock. But I can't get it to work on some Minis using an external oscillator.
"Code is read much more often than it is written, so plan accordingly. Design for readability."

Guida rapida a ESP8266: https://goo.gl/kzh62E

fanofard

#20
May 18, 2016, 03:52 pm Last Edit: May 18, 2016, 04:00 pm by fanofard
If anybody is interested, you can test the hex file I compiled with 56k baud rate / 8MHz. For me this bootloader works fine.

This is the entry in boards.txt I use for uploading sketches to the minis with the mentioned bootloader:
Code: [Select]
pro328.name=[Optiboot 6.2] Arduino Pro or Pro Mini (3.3V, 8 MHz) w/ ATmega328 for 56K
pro328.upload.protocol=arduino
pro328.upload.maximum_size=32256
pro328.upload.speed=57600
pro328.bootloader.low_fuses=0xFF
pro328.bootloader.high_fuses=0xDE
pro328.bootloader.extended_fuses=0x05
#pro328.bootloader.path=optiboot
pro328.bootloader.file=optiboot/optiboot_atmega328_pro_8MHz_56k.hex
pro328.bootloader.unlock_bits=0x3F
pro328.bootloader.lock_bits=0x0F
pro328.build.mcu=atmega328p
pro328.build.f_cpu=8000000L
pro328.build.core=arduino:arduino
pro328.build.variant=arduino:standard

SukkoPera

#21
May 18, 2016, 11:59 pm Last Edit: May 19, 2016, 12:00 am by SukkoPera
I can confirm that Optiboot at real 57600 bps works. Basically I built it with:
Code: [Select]
make atmega328 AVR_FREQ=8000000L LED_START_FLASHES=3 BAUD_RATE=57600

And the section in boards.txt is pretty much identical to what fanofard just posted.

Still I can't understand why the stock Optiboot worked on my bare 328 DIPs and didn't on my Minis...
"Code is read much more often than it is written, so plan accordingly. Design for readability."

Guida rapida a ESP8266: https://goo.gl/kzh62E

acitta

Hi sorry to dig this up again. I'm new to this level of arduino coding and this is the first time I've had to modify a make file. Can anyone give some basic steps on how to do that (on a mac if possible). I've messed around with the boards.txt file and tried using the hex file posted on this thread but with no success. What do I need to do to use this line

make atmega328 AVR_FREQ=8000000L LED_START_FLASHES=3 BAUD_RATE=57600

to get the required files so I can use optiboot on my mini 3.3v?

pert

Easiest way is to just install MiniCore:
https://github.com/MCUdude/MiniCore
It's very easy to install, well done, and has optiboot already compiled for your hardware configuration(and practically any other you could desire.

Of course then you will miss out on all the fun of learning makefiles and toolchains and compiling bootloaders from source.

acitta

Where have you been all my life pert! That was too easy. Thank you kindly

acitta

My mini is now having trouble communicating with my 3G module. It connects to my webserver fine but the response gets cut off. I had to set a larger buffer size in softwareserial.h to make this work before. Could the Minicore override that and have lowered my buffer size? If so how to I rectify that?

ron_sutherland

pert is being sarcastic, regarding learning about the toolchain and bootloader. Personally, I've stopped using this IDE and now prefer a makefile. Anyway AVR mega has a maximum optimal buffer size of 32, it has to do with the indirect indexing instruction (I think, but forget the specific one and am not going to look it up). Therefore a better way is to send out some data (less than 32 bytes) to the serial buffer and wait for the serial buffer to empty, preferably while looping through your program and doing other useful stuff, until serial is available again.

pert

I had to set a larger buffer size in softwareserial.h to make this work before. Could the Minicore override that and have lowered my buffer size?
No, I don't see how that would happen. MiniCore references the Arduino AVR Boards core so it will use the SoftwareSerial library included with that core. So MiniCore boards should work just the same with that library as Arduino AVR Boards. Remember that you need to redo your modifications to SoftwareSerial.h anytime you update to a new version of the Arduino IDE/Arduino AVR Boards.

pert is being sarcastic, regarding learning about the toolchain and bootloader.
Not true I was sincere in what I said. Learning how to use makefiles and set up the toolchain to compile a bootloader from source is certainly educational. It really depends on what your priorities are though. There are an infinite number of interesting and useful things to learn but if your goal is to complete a specific project in a finite period of time sometimes you have to set priorities on what you absolutely need to learn to accomplish that goal. The average beginner to intermediate Arduino user doesn't have any immediate need for that knowledge since hansibull has kindly done the work of compiling the bootloaders for them. When the time does come when knowing how to do that is desirable I hope people would jump right in and go for it, it's really not so hard as some make it out to be(though certainly not so easy as using the Arduino IDE). Bootloaders shouldn't be seen as a "black box". The source code is available for anyone to learn from and play around with if that's your thing.


kokuam

#29
Nov 15, 2018, 09:10 pm Last Edit: Nov 15, 2018, 09:11 pm by kokuam
Hello Everyone!
I tried precompiled Optiboot 8,0 on 8Mhz 328p, it can upload with 57600bps speed only.

Optiboot 6.x from MiniCore ( optiboot_flash_atmega328p_UART0_115200_8000000L.hex ) doesn't cope with 115200bps neither. Does anybody know if it's possible to get bootloader working on 8Mhz with 115200bps speed? Is there any fundamental obstacles?

Thank you!

Go Up