Go Down

Topic: MiniCore - An Arduino core for the ATmega8/ 48/ 88/ 168/ 328 (Read 4298 times) previous topic - next topic

hansibull

If the timing isn't correct, it means that you've set the wrong fuses. Select the correct click frequency, and hit "Burn bootloader". You can test this by uploading the blink sketch, and verify that delay(1000) is actually a second
MightyCore -  ATmega1284, mega644, mega324, mega164, mega32, mega16, mega8535
Github.com/MCUdude/MightyCore

MiniCore - ATmega8, mega48, mega88, mega168, mega328
Github.com/MCUdude/MiniCore

jim_beam

Thanks for the MiniCore, I had big problems trying on my own, MiniCore made my day!  :)

kprims

Thanks for the MiniCore, I had big problems trying on my own, MiniCore made my day!  :)
Thanks from me also. I am using Mega and Mini core now and hope to try out MightyCore in the near future.
Your work is appreciated!

bill2009

I'm using mini-core but i'm a bit unclear on how it works. To increase the serial buffer size i believe i have to copy the core, adjust a #define, and point to the new core in boards.txt - how do i do that with minicore?

It's great by the way, thanks!

hansibull

Hi everybody! Great to hear you guys use and enjoy MiniCore, that's the stuff that's keep me going :)

Quote
I'm using mini-core but i'm a bit unclear on how it works. To increase the serial buffer size i believe i have to copy the core, adjust a #define, and point to the new core in boards.txt - how do i do that with minicore?
MiniCore doesn't have it's own copy of the Arduino source files, like MightyCore and MegaCore. If you want to increase the serial buffer size, you'll actually have to do changes to the original source files. I've tried to redefine the serial buffer size in the sketch, but the source files are compiled before the sketch, and is not picked up..
MightyCore -  ATmega1284, mega644, mega324, mega164, mega32, mega16, mega8535
Github.com/MCUdude/MightyCore

MiniCore - ATmega8, mega48, mega88, mega168, mega328
Github.com/MCUdude/MiniCore

bill2009

Hi everybody! Great to hear you guys use and enjoy MiniCore, that's the stuff that's keep me going :)

MiniCore doesn't have it's own copy of the Arduino source files, like MightyCore and MegaCore. If you want to increase the serial buffer size, you'll actually have to do changes to the original source files. I've tried to redefine the serial buffer size in the sketch, but the source files are compiled before the sketch, and is not picked up..
so there's no way to point to a modified version of the core files?

hansibull

Quote
so there's no way to point to a modified version of the core files?
If course you can copy the Arduino source files and add them to the MiniCore directory.
Do a manual install of the core and paste the core files in the "/MiniCore/avr/cores/minicore" directory. You'll probably need to create the cores/minicore folders.

In the boards.txt file you'll need to replace arduino:arduino with minicore (all lowercase letters).
MightyCore -  ATmega1284, mega644, mega324, mega164, mega32, mega16, mega8535
Github.com/MCUdude/MightyCore

MiniCore - ATmega8, mega48, mega88, mega168, mega328
Github.com/MCUdude/MiniCore

BitKraken

Hi hansibull and congratulations for this great effort!!

I'm a newbie in Arduino and I'm giving MiniCore a try. Unfortunately, I've been having some problems uploading a bootloader into ATmega8. I'm using USBtiny programmer and IDE 1.8.3 (though I had same results with 1.6.13) and getting intermittent results...sometimes it uploads and some time it doesn't.

I've tried modifying the board with an upload.speed =19200 with similar results.

I get the following: "Error while burning bootloader"..... though bootloader has been uploaded correctly! and at other times...it will just fail.

Please let me know if you have any thoughts for these uncertain behavior.

Attach you will find a log of the error. Thanks!

pert

That's quite strange. I've never used an ATmega8 before. I do always have problems with the USBtinyISP (though maybe not that specific problem). Do you have an extra Arduino or microcontroller you can use for Arduino as ISP to see if that works better?

Jiggy-Ninja

I think I found it:
Code: [Select]
avrdude: verifying ...
avrdude: 1 bytes of lock verified
avrdude: reading input file "{bootloader.extended_fuses}"
avrdude: writing efuse (0 bytes):

Writing | ################################################## | 100% -0.00s

avrdude: 0 bytes of efuse written
avrdude: verifying efuse memory against {bootloader.extended_fuses}:
avrdude: load data efuse data from input file {bootloader.extended_fuses}:
avrdude: input file {bootloader.extended_fuses} contains 0 bytes
avrdude: reading on-chip efuse data:

ATmega8 doesn't have an efuse, so there's no value specified for it in the boards.txt file. So this shows up in the command line: -Uefuse:w:{bootloader.extended_fuses}:m  avrdude can't write a fuse that the microcontroller doesn't have, and it's got a nonsense value on the command line on top of that. The lfuse, hfuse, bootloader and lock bits all write properly, but because of these efuse issues it shows an error.
Hackaday: https://hackaday.io/MarkRD
Advanced C++ Techniques: https://forum.arduino.cc/index.php?topic=493075.0

pert

I believe what happened is that hansibull originally had a hack in place to work around the no efuse issue by defining a separate AVRDUDE tool for ATmega8:
https://github.com/MCUdude/MiniCore/commit/afa29e293ceb587390ea50bc48b6f7abaf4a354b

But later a cleaner solution was found that consists of adding a dummy efuse definition to avrdude.conf:
https://github.com/MCUdude/MiniCore/commit/3c5c11fc8f8ae317349f4bb6ffb26864cdb2ab63
but he forgot to add an extended_fuses property to boards.txt for the ATmega8.

They did the same fix for the "Arduino NG and Older" board in Arduino AVR Boards but as you can see they added an empty extended_fuses property in boards.txt:
https://github.com/arduino/Arduino/blob/master/hardware/arduino/avr/boards.txt#L773

So try this:
  • Open C:\Users\Carlos\Documents\Arduino\hardware\MiniCore\avr\boards.txt in a text editor
  • Add the line:

Code: [Select]
8.bootloader.extended_fuses=
  • Save the file
  • Restart the Arduino IDE
  • Try burning the bootloader again.


I don't have an ATmega8 to test it.

kprims

Using a Usbasp with jp2 shorted, I am able to burn bootloader using another Usbasp with no problems using MiniCore.

Using USBtinyisp (two different versions) I fail every time.


Changing  efuse makes no difference for me.

###################
#### ATmega8/A ####
###################

8.name=ATmega8
8.upload.tool=avrdude
8.upload.protocol=arduino
8.upload.maximum_size=7680
8.upload.maximum_data_size=1024

8.bootloader.tool=avrdude
8.bootloader.unlock_bits=0x3f
8.bootloader.lock_bits=0x0f
8.bootloader.low_fuses=0b{bootloader.bod_bits}{bootloader.sut_cksel_bits}
8.bootloader.extended_fuses=
8.build.core=arduino:arduino
8.build.board=AVR_ATmega8

I have attached the failure printout for the USBtinyisp.

BitKraken

Hi guys. Thank you for your prompt responses. Here are my findings:

1)   I have added 8.bootloader.extended_fuses= with no luck. Problem persists.
2)   However, as Pert suggested I've used Arduino as ISP configuration and it works flawless!!

As a side note, let me comment that there is in fact a problem between USBtiny programmer and latest AVRdude 6.3 version. I even have problems uploading a simple blink program by using USBtiny programmer and either ATmega8 or Atmega328p!! What I had to do (based on a suggestion from someone on the matrix) is configure an IDE with an old AVRdude (version 5.10). And this is how I do it whenever I need to upload programs with USBtiny and Arduino IDE.

So I've commented out  the "8.bootloader.extended_fuses=" and re did the test…

Still works with "Arduino as ISP" setup! So I'm concluding that it is something between USBtiny and AVRdude 6.3.

It is unfortunately that I am not able to use my USBtiny programmer but I'm happy that I will be able to use MiniCore with Arduino as ISP set up. Maybe it is time for me to buy another programmer;-)

Thanks a lot for your suggestions!!

pert

Sorry to send you two on a wild goose chase with my guess as to the problem. Looks like my first hunch was better. It does look like the blank extended_fuses property in boards.txt does result in less confusing AVRDUDE output so it still might be worth considering adding that to MiniCore

I'm a big fan of the USBasp and it sounds like kprims had success using one with MiniCore and ATmega8. Some people swear by the USBtinyISP but I have a few of them and just don't get consistent success. I never have problems with my USBasp or Arduino as ISP and (with the latest AVRDUDE) my AVRISP mkII works fine too. I also think the USBtinyISP have some limitations regarding programming chips with more flash.

BitKraken

On the contrary, thank you for your suggestions Pert and kprims for posting your findings!! I have fun doing these tests; it is a learning process for me. I agree with you in including "8.bootloader.extended_fuses=" in MiniCore Board.txt.

I learned a lot from this and other sites and hope all these findings will help others as well!!

Go Up