Arduino Forum

Using Arduino => Microcontrollers => Topic started by: pico on May 09, 2015, 03:27 pm

Title: Mighty-1284p repo updated for IDE 1.6.x
Post by: pico on May 09, 2015, 03:27 pm
Just added a new v1.6.3 branch to the JChristensen github repo for the mighty-1284p:

https://github.com/JChristensen/mighty-1284p/tree/v1.6.3 (https://github.com/JChristensen/mighty-1284p/tree/v1.6.3)

There are three branches for this repo now, each with a different target set of IDE versions.

- The original v1.0.5 branch is for IDE 1.0.1 - 1.0.5.
- The v1.0.6 branch is for 1.0.6 only.
- The latest v.1.6.3 branch should work with 1.6.0-1.6.4 (tested only briefly on 1.6.4, but seems to be fine so far.)

Make sure you are on the correct branch when downloading the zip file.

The installation instructions are slightly different for 1.6.x (simpler, actually) so do read the installation steps.

The patched libs have been updated for 1.6.x. Thanks to Per (pert) for updating these!

Also thanks to Bill (bperrybap) for help with new the set-up for the 1.6.x files.

Any suggestions, questions, or problems, drop a note in this thread.

---

These are the manual installation steps on the github page from the link above:

Installation

1. Go to https://github.com/JChristensen/mighty-1284p/tree/v1.6.3 (https://github.com/JChristensen/mighty-1284p/tree/v1.6.3), click the Download ZIP button and save the ZIP file to a convenient location on your computer.

2. Ensure that the Arduino IDE is not running.

3. Go to your Arduino "hardware" folder.

4. Unzip the downloaded file into the hardware folder.

5. The download from GitHub will have a dash and branch name appended, so the folder will be named, e.g. mighty-1284p-v1.6.3. Rename the folder to just mighty-1284p.

6. The following folders and files should now exist:

◦ hardware\mighty-1284p\avr\bootloaders
◦ hardware\mighty-1284p\avr\libraries
◦ hardware\mighty-1284p\avr\patched-3rd-party-libs
◦ hardware\mighty-1284p\avr\variants
◦ hardware\mighty-1284p\avr\boards.txt
◦ hardware\mighty-1284p\avr\boards.txt.alt
◦ hardware\mighty-1284p.gitignore
◦ hardware\mighty-1284p\README.md

7. Move any mighty-1284p compatible 3rd party patched libs under [sketchfolder]\libraries as required. (Note: the mighty-1284p compatible "official" patched libs are already set-up to be used as default when using mighty-1284p by being in avr\libraries. If the wrong libs are being used, check to see that there aren't old versions of the patched libs still under [sketchfolder]\libraries, as those would take precedence.)

8. Restart the Arduino IDE.

9. Select the desired board from the Tools > Board menu and enjoy those extra pins and all that extra memory!
Title: Re: Mighty-1284p repo updated for IDE 1.6.x
Post by: mcnobby on Jun 01, 2015, 10:47 am
Thank you Pico !!!
This was exactly what I was looking for today :)
Title: Re: Mighty-1284p repo updated for IDE 1.6.x
Post by: pico on Jun 02, 2015, 04:01 pm
Thank you Pico !!!
This was exactly what I was looking for today :)
No probs -- glad you found it useful. You get karma points for actually bothering to say thank you.  :)

Recently we've added an alternative boards.txt file named board.txt.alt.

To explain, this note has been added under the installation instructions:

Note: There is an alternative version of the boards.txt file supplied named boards.txt.alt. It provides more combinations of boards and clock speeds than the standard boards.txt selection menu. It uses a two-step selection of board type and then clock-speed via a submenu. As this differs from the standard boards.txt format, it is provided as an option for those users with more specialized needs, while the default boards.txt retains the more familiar style of interface, to minimise any potential for confusion.

To enable the alternate version, rename boards.txt to boards.txt.org, and then rename boards.txt.alt to boards.txt. Restart IDE, and the new selection options will appear.


If you decide to try it out, and have any comments or questions, please post here.
Title: Re: Mighty-1284p repo updated for IDE 1.6.x
Post by: mcnobby on Jun 03, 2015, 08:28 am
Ok thanks for that, I already made an adapted entry for my 32MHz version, but I will have a look at that .alt :)
Title: Re: Mighty-1284p repo updated for IDE 1.6.x
Post by: dThirteen on Jun 04, 2015, 01:07 pm
Very cool. I picked up a Mighty-1284p compatible board off ebay a couple of weeks ago and have been keen to try it out. I really appreciate the work you guys put into it.
Title: Re: Mighty-1284p repo updated for IDE 1.6.x
Post by: THLL on Jun 06, 2015, 01:49 pm
Would you know if the atmega1284 (not P) 44pin tqfp has been tested with this bootloader?
Title: Re: Mighty-1284p repo updated for IDE 1.6.x
Post by: pico on Jun 07, 2015, 03:44 pm
Very cool. I picked up a Mighty-1284p compatible board off ebay a couple of weeks ago and have been keen to try it out. I really appreciate the work you guys put into it.
No probs. Let us know how you go.
Title: Re: Mighty-1284p repo updated for IDE 1.6.x
Post by: pico on Jun 07, 2015, 03:45 pm
Would you know if the atmega1284 (not P) 44pin tqfp has been tested with this bootloader?
I've tested the boot loader with a atmega1284  40 pin DIP, and it's fine -- I wouldn't expect any problems with the TQFP package.
Title: Re: Mighty-1284p repo updated for IDE 1.6.x
Post by: pico on Jun 15, 2015, 04:08 pm
Updated Mighty-1284p v1.6.3 repo today:

• added support for variant "Sleeping Beauty"
• updated boards.txt.alt to include menu options for enabling/disabling JTAG, as well as A4/A5 functionality for Sleeping Beauty
• updated boards.txt.alt clock speed options to disallow bootloader options that flash LED on PB7 for boards that do not have the board LED connected to PB7
• added platform.local.txt to restore Mighty-1284p separator heading in Tools|Board list

Thanks to Bill (bperrybap) for providing the variant file pins_arduino.h for "Sleeping Beauty" board.

boards.txt.alt has been extended, with more menu options added - JTAG enable/disable (all boards), A4/A5 pin function select (Sleeping Beauty only).

Clock speed for boards that do not have a board LED attached to PB7 have had bootloader options that flash the LED using that pin have been removed from the boards.txt.alt menu. This affects avr_developers and the original "maniacbug" Mighty-1284p layouts.

The issue is that "optiboot_atmega1284p.hex" is currently the only bootloader file in the "bootloaders" directory that has the LED flash on bootloader startup disabled. For compatibility across the different board types, _all_ bootloaders should have the LED flashing disabled, otherwise some boards may be getting unexpected toggling of the PB7 pin, which may be appear as a bug.

After some discussion last year, it was decided the preferred approach would be to simply disable the LED flash on all bootloaders for Mighty-1284p, but unfortunately it is now evident this was only actually done for one version of the bootloader, not all.

To fix this would require rebuilding the bootloaders, possibly renaming them with an appended "_NO_LED" for additional clarity. It may also be an opportunity to update optiboot.c to the latest version -- the current optiboot.c Makefile is out of date for the current avr-gcc tools. (Thanks to Bill for uncovering these issues and bringing them to my attention.)

Volunteers for the "clean up the Mighty-1284p bootloaders/optiboot directory" project welcome.  :)
Title: Re: Mighty-1284p repo updated for IDE 1.6.x
Post by: mcnobby on Jun 15, 2015, 05:50 pm
I tried to make a 32MHz (TTL clock gen) entry into boards.txt with the correct clock gen unit.
No matter how hard I tried I just couldnt get it to work, it was like it was dead, or wouldnt start up
I lowered the frequency to 24MHz and changed the clock gen for a standard crystal (using the xtal1 & 2 pins) and everything was fine

I havent had any trouble getting '328, or Tiny's to work at 32MHz, just the '1284

Its probably well over the limit of overclocking :)
Title: Re: Mighty-1284p repo updated for IDE 1.6.x
Post by: bperrybap on Jun 15, 2015, 06:38 pm
Mark,
Seriously?
You didn't add the B7 bootloader for sleeping beauty?
And no renaming for all the other bootloaders for clarity.
Why?

So SleepingBeauty users loose the LED functionality that they originally had when they re-burn their bootloader with this core.
That is unacceptable to me.

OK. I've had enough of the bootloader mess.
As long as I can get it into the tree,
I'll go fix all this optibootloader crap that exists today since everyone seems to just keep avoiding it.
For me, it is way less work to just go fix it, than to point out the issues in what is there now since
doing it is pretty trivial and I'm sick of this bootloader disaster that is being allowed to persist.

I'll use the latest optiboot and create a wrapper script that creates all the needed 15 bootloaders with descriptive names that includes the cpu clock rate, baud rate, and led support.
And then update the boards.txt files to match.

If I do this, can I get this checked into the tree?


BTW as a FYI to others.
To unsugar coat the state of the bootloader stuff:.
In my view, the bootloader stuff is a total mess right now.
This is a sample of what is there now:
- The code in the optiboot directory does not match what is in the pre-built bootloaders
- the optiboot code and build tools included are very old and won't build with the latest tools that ship with the IDE that this core is for
- boards in boards.txt.alt are using bootloaders that toggle the wrong the LED pin


---- bill
Title: Re: Mighty-1284p repo updated for IDE 1.6.x
Post by: pico on Jun 15, 2015, 06:57 pm
Mark,
Seriously?
You didn't add the B7 bootloader for sleeping beauty?


And no renaming for all the other bootloaders for clarity.
Why?

So SleepingBeauty users loose the LED functionality that they originally had when they re-burn their bootloader with this core.
That is unacceptable to me.

OK. I've had enough of the bootloader mess.
As long as I can get it into the tree,
I'll go fix all this optibootloader crap that exists today since everyone seems to just keep avoiding it.
For me, it is way less work to just go fix it, than to point out the issues in what is there now since
doing it is pretty trivial and I'm sick of this bootloader disaster that is being allowed to persist.

I'll use the latest optiboot and create a wrapper script that creates all the needed 15 bootloaders with descriptive names
that includes the cpu clock rate, baud rate, and led support.
And then update the boards.txt files to match.

If I do this, can I get this checked into the tree?


---- bill
Sounds like we have a volunteer. :)

As we discussed offline, the consensus way back when was that no bootloader for the Mighty-1284p project should flash the LED. I know you strongly dissent from that decision, but in the absence of a new consensus reversing the original decision, I think it should stand. And personally, I also think it was the correct decision, FWIW. Bootloaders should not flash LEDs, period, IMHO.

But if you want to undertake the bootloader overhaul project, and nobody else voices an opinion at this stage one way or the other, I will submit your updates... even though I think personally think maintaining the additional bootloaders required for "LED flashing" and "non-LED non-flashing" versions of the bootloaders, depending on target board, is just messy, unnecessary and actually, undesirable.

But I don't feel as strongly about all of this as you obviously do!

Title: Re: Mighty-1284p repo updated for IDE 1.6.x
Post by: bperrybap on Jun 15, 2015, 07:27 pm
Sounds like we have a volunteer. :)

As we discussed offline, the consensus way back when was that no bootloader for the Mighty-1284p project should flash the LED. I know you strongly dissent from that decision, but in the absence of a new consensus reversing g the original decision, I think it should stand. And personally, I also think it was the correct decision, FWIW. Bootloaders should not flash LEDs, period, IMHO.

But if you want to undertake the bootloader overhaul project, and nobody else voices an opinion at this stage one way or the other, I will submit your updates... even though I think personally think the additional bootloader required for flashing and non-flashing versions of the bootloaders, depending on target board, is just messy, unnecessary and actually, undesirable.

But I don't feel as strongly about all of this as you obviously do!


The view of a non flashing led bootloader does not seemed to be shared by the wider arduino population (or at least team arduino.cc ) as all AVR based Arduino boards that are now shipping appear to have a blinking bootloader.

In general I don't believe in forcing personal/group opinions on people and instead believe in giving people the flexibility to "have it their way".


In the case of SB users, I think that by default, SB users should get the same bootloader that they had when then received their board when they use the IDE and this core to re-burn a SB bootlaoder. If they don't want the blinking led, then then can go in an modify their boards.txt entry to point to a non blinking LED bootloader.


In the larger picture, can I get an updated optiboot directory that uses the newer optiboot and creates all the combinations of bootlaoders with more descriptive names in to the tree?
(if there is concern, perhaps rename the current optiboot directory to something else when this is added)

--- bill
Title: Re: Mighty-1284p repo updated for IDE 1.6.x
Post by: pico on Jun 15, 2015, 07:44 pm
In general I don't believe in forcing personal/group opinions on people and instead believe in giving people the flexibility to "have it their way".
Sounds good to me.

In the larger picture, can I get an updated optiboot directory that uses the newer optiboot and creates all the combinations of bootlaoders with more descriptive names in to the tree?
(if there is concern, perhaps rename the current optiboot directory to something else when this is added)
Yes, as I said, unless anyone else comes forward with a strong opinion about it one way or the other, if you are willing to do the tidy up, I will upload your updates to the repo. As you say, if anyone has strong religious convictions about the issue one way or the other, they can manually adjust which bootloader they want. (It's not like they will be wanting for choice...)
Title: Re: Mighty-1284p repo updated for IDE 1.6.x
Post by: pico on Jun 15, 2015, 08:00 pm
- boards in boards.txt.alt are using bootloaders that toggle the wrong the LED pin
No, this isn't true - I fixed that. All the available bootloaders for each board match up to the board. (I think you were confused because you didn't realize Jack's Mini actually has a LED connected to PB7, unlike the original "maniacbug" Mighty layout. )
Title: Re: Mighty-1284p repo updated for IDE 1.6.x
Post by: bperrybap on Jun 15, 2015, 09:01 pm
I see the modifications.
However, I wouldn't call it "fixed", but rather temporarily patched it to hide/remove/disable the offending entries by commenting them out.
This is a loss of boards entries from the previous release.

I also did see what looks like another issue.
The 20mhz clock entries are using the same bootloader and baud rate as the 16MHz bootloader.
Wont' the the baud rate when using a 20Mhz clock be double vs 16Mhz since they are both using the same bootloader?

--- bill
Title: Re: Mighty-1284p repo updated for IDE 1.6.x
Post by: pico on Jun 16, 2015, 05:54 am
I see the modifications.
However, I wouldn't call it "fixed", but rather temporarily patched it to hide/remove/disable the offending entries by commenting them out.
This is a loss of boards entries from the previous release.
This is permanently patched until someone puts the time in to provide the "no led" versions of the bootloader suitable for avr_developers and "maniacbug" Mighty layouts.

The last release introduced the boards.txt.alt file as an alternative boards.txt that extended the clock options for different boards. As it turns out, not all of those new options were valid for some boards. That was a bug. That's been fixed. The latest boards.txt.alt file only allows valid combinations of boards and bootloaders.

I also did see what looks like another issue.
The 20mhz clock entries are using the same bootloader and baud rate as the 16MHz bootloader.
Wont' the the baud rate when using a 20Mhz clock be double vs 16Mhz since they are both using the same bootloader?
That was reported as working by another user -- I don't have a 20MHz xtal on hand to test myself, unfortunately.

If you (or anyone else interested) have a 20MHz xtal, please test and advise if there are any problems.

A bootloader expecting 115200 @ 16MHz would presumably be looking for 144000 @ 20MHz, so changing upload.speed to 144000 might work. Else, a new bootloader compiled for 20MHz would be needed. In the meantime, only ICSP programming would be supported.
Title: Re: Mighty-1284p repo updated for IDE 1.6.x
Post by: bperrybap on Jun 16, 2015, 09:01 am
The issue/bug with using the incorrect LED bootloaders in boards.alt.txt was not fixed. You can't call that a  fix.
It is like a person having an issue on channel 4 on their TV and taking it to the repair shop and the guy returns it saying it is fixed.
But the "fix" was to disable the TV from being able to select channel 4.
As far as the customer is concerned it was not fixed and he would not be happy since he knows there is a channel 4 but now he can't get to it at all.

On the 20Mhz clock. Clearly nobody tested (or even thought about) the effects of using a 16Mhz bootloader with a 20Mhz clock at 115.2k baud. There is no way that is going to work since the baud rate is directly driven off the CPU clock. Alter the CPU clock and the resulting baud rate changes.

While my comment about it being double was wrong, (It is actually 20/16 of the baud rate or 144000) it still won't work.
You can not use the same bootloader image that was built for 16Mhz and 115200 baud and have 115200 baud work with both a 16Mhz and 20 Mhz clock since at 20Mhz the baud rate will be 144000.

BTW, I let my self get sucked into the 1284p optiboot mess vortex again and did hook it up to see what would happen.
First, avrdude doesn't like 144000 baud, it complains but goes ahead and tries it.
Then linux appears to silently ignore the non standard 144000 requested baud rate and drops back down to 9600 on the FTDI chip.
I verified this using a logic analyzer.

I did quick build of a B7 bootloader at 20Mhz for 115.2k and it works as expected.
Since I used the 1284p optiboot stuff vs the latest optiboot stuff, I also had to correct the makefile to allow it to be built
with the latest avr-gcc tools.
Not a big deal, it took like 5 minutes to correct the makefile, build the image and test it on my SB board.

This latest issue is just another example of how using better more descriptive file names would have helped prevent using incorrect pre-built bootloaders.

Like I said before, this optiboot bootloader stuff is a real mess.

--- bill

Title: Re: Mighty-1284p repo updated for IDE 1.6.x
Post by: bperrybap on Jun 16, 2015, 09:18 am
Some additional FYI on the never ending optiboot bootloader issues:
The latest official optiboot has used some conditional features in make to allow external scripts to control some of the parameters such as CPU frequency, LED, baud rate, etc...
Unfortunately, there is a bug in older versions of make that causes it to not work correctly.
This bug was fixed in gnu make version 4.0 so any 4.x version works.
However while version 4.0 is several years old most *nix OS distributions (including Ubuntu and Linux mint) are still shipping with make version 3.81 which is whopping 9 years old!
Most of the minw/msys tool sets for Windows and the make that used to ship with the Windows Arduino IDE are also using make 3.81

While this issue is a bug in make it is very unfortunate that the new optiboot depends on having a newer version of make to be able to build bootloaders and at this point in time it appears to me that most users will not have this newer version of make.

During my testing with the new optiboot, i just went and grabbed make 4.2 and built it.
While building a new version of make is trivial on *nix machines, it is not so easy on Windows since Windows doesn't come with real s/w build tools that come standard in *nix operating systems.

Oh and then after I finally got a 20Mhz 115.2k bootloader built with the new optiboot, it didn't work on the SB board. It wasn't dead but it didn't work. I didn't spend any time trying to figure out why.

Just another part of the overall messy state of optiboot bootloaders.

--- bill
Title: Re: Mighty-1284p repo updated for IDE 1.6.x
Post by: john1993 on Jun 16, 2015, 02:04 pm
afaik the idea of eliminating the silly flashing was brought up by me first a couple years ago in that other mega-thread. imo a blinky is great for a demo but serves little purpose in a bootloader.  actually potential for big problems. much worse when nobody seems to agree on what pin to use. relays clicking and displays showing mysterious garbage on startup are real annoyances.

i do agree there is a big mess in many of these arduino packages. too many cooks spoil the broth. TMI seems to be a bigger issue for beginners than not enough info. sometimes less is more. kiss.
Title: Re: Mighty-1284p repo updated for IDE 1.6.x
Post by: pico on Jun 16, 2015, 06:41 pm
Oh and then after I finally got a 20Mhz 115.2k bootloader built with the new optiboot, it didn't work on the SB board. It wasn't dead but it didn't work. I didn't spend any time trying to figure out why.
I've just built a fresh 20MHz optiboot named

optiboot_1284p_20MHz_noled.hex

and added it to the bootloaders dir in the repo. I've also updated boards.txt.alt to use it for the 20MHz clock option.

I don't have a 20MHz xtal to hand to test directly, but I tested the version using the same build parameters for 16MHz, and that worked OK on one of my "Skinny Bob" boards. This is built from the latest optiboot v6.2.

If anyone has a 20MHz xtal to test with a 1284p, please test and report here.
Title: Re: Mighty-1284p repo updated for IDE 1.6.x
Post by: bperrybap on Jun 16, 2015, 07:21 pm
Why use that name that doesn't include the baud like the others?
It seems be yet another inconsistent ambiguous file name for a pre-built bootloader.

And since the .lst file is not there, it is particularly difficult to tell what is in that .hex image.


Why can't we use  better more descriptive file names that are all consistent with each other?
I'd like to use my previous recommendation for all the bootloader names so people know how they were built and what the heck is in them.
i.e here are the names I suggested for the existing bootloaders in the repo at this point in time:
optiboot_1284p_20MHZ_115.2k_NOled.hex
optiboot_1284p_20MHZ_115.2k_NOled.lst
optiboot_1284p_16MHZ_115.2k_NOled.hex
optiboot_1284p_16MHZ_115.2k_NOled.lst
optiboot_1284p_16MHZ_1M_B7led.hex
optiboot_1284p_16MHZ_1M_B7led.lst

optiboot_1284p_8MHZ_28.8k_B7led.hex
optiboot_1284p_8MHZ_28.8k_B7led.lst
optiboot_1284p_8MHZ_57.6k_B7led.hex
optiboot_1284p_8MHZ_57.6k_B7led.lst
optiboot_1284p_8MHZ_500k_B7led.hex
optiboot_1284p_8MHZ_500k_B7led.lst             

It would also be good to add the other B7 bootloader that I gave you:
optiboot_1284p_16MHZ_115.2k_B7led.hex
optiboot_1284p_16MHZ_115.2k_B7led.hex

So SB users could re-burn their blinking led bootloader that came with the board.
And bobuino uses could also have a blinking bootloader if they wanted it.



Given all the issues and confusion over the bootloaders and their contents, I'm not understanding the reluctance to use better and more consistent names for the pre-built bootloaders so people can look at the file and tell what they are going to get.


Also, what I've noticed is that when building optiboot with the newer compiler tools, the .lst file is not very useful as the code is optimized differently and the objdump tool no longer inserts the C code for main() which is pretty much all the code. So unless you weed through the actual machine code you can't tell how the code was built.
So when using the newer tools, using the more descriptive names becomes even more important.

--- bill



further note:
Once things are properly renamed you could avoid needing some pre-built bootloaders to save on files.
You could get away with just doing 8Mhz and 20Mhz prebuilt bootloaders.
For example.
The 8Mhz 57.6k B7 led bootloader is the same as the 16Mhz 115.2k B7 led bootloader so the boards.txt could use that instead of having to supply both.

In other words you don't need both the 16Mhz and 8Mhz versions of prebuilt bootloaders since they can be shared for the two clock rates since the 8Mhz baud rates can be used to get 16Mhz 57.6, 115.2 and 1M or they could all be called 16Mhz bootloaders which also get 28.8, 57.6 and 500k at 8Mhz


But I still strongly believe that the key to removing so much of the confusion and issues is to name the files consistently with better names that include build parameters.
And if addtional NOled bootloaders are wanted/needed just add them.
Title: Re: Mighty-1284p repo updated for IDE 1.6.x
Post by: john1993 on Jun 16, 2015, 07:59 pm
i have a 20mhz 1284 and will try that when if i get a chance. periodic links to the files is helpful to avoid searching big threads.

a list file would also be very helpful as i do almost all development in asm. it was essential for my implementation of m256 opti with >128k capabilty. i would like to enhance 1284 too but lack of lst hinders. if somebody could compile one with the old tools that would be great because the c comments are useful.
Title: Re: Mighty-1284p repo updated for IDE 1.6.x
Post by: john1993 on Jun 16, 2015, 11:32 pm
well i downloaded a new 1.6.4 and tested ok with m328 then copied "avr-developers.com" section into boards.txt and set fuses. e=fd h=de l=f7. copied contents of zip file into ardunio/hardware. next flashed 20mhz opti and selected "avr-deveopers.c..." (in addition to baud in hex filename might be a good idea to mention m1284 in the boards entry). Got this:


Quote
Arduino: 1.6.4 (Windows XP), Board: "avr-developers.com pinout, JTAG disabled, 20Mhz Full Swing"

In file included from Blink.ino:18:0:
G:\arduino-1.6.4\hardware\arduino\avr\cores\arduino/Arduino.h:247:26: fatal error: pins_arduino.h: No such file or directory
 #include "pins_arduino.h"
                          ^
compilation terminated.
Error compiling.
evidently some files are in the wrong place. I use this chip almost daily but couple years since trying with arduino so maybe could use a hint where to put them.
Title: Re: Mighty-1284p repo updated for IDE 1.6.x
Post by: bperrybap on Jun 17, 2015, 12:15 am
The latest 1284p code in Jack's 1.6.3 repo branch that mark updated is all working with IDE 1.6.4 for me on linux.
Not sure how/what you installed as you should not need to modify any files.

All you have to do is get the latest 1.6.3 1284p core from jack's repo (make sure to get the 1.6.3 branch and not the 1.0.6 default zip) and you will get everything you need including all the the needed bootloaders and boards entries.
You don't edit anything. Just install/extract it under the {user_sketchbookdir}/hardware directory so it works with whatever 1.6x IDE release you use.
I added a menu label to the boards manager menu so that all the 1284 boards are all grouped together away from the official Arduino boards with a title separator "Mighty-1284p Boards" when selecting a board.
And  yeah I agree that the 1284p avr-developers board name is a bit dopey.


--- bill
Title: Re: Mighty-1284p repo updated for IDE 1.6.x
Post by: john1993 on Jun 17, 2015, 04:40 pm
You don't edit anything. Just install/extract it under the {user_sketchbookdir}/hardware directory
this conflicts with instructions from first post here which require editing the folder name to "mighty-1284p" instead of "mighty-1284p-v1.6.3". in any case i tried both approaches with same results. files are exactly where pico says. strangely the path in that error does not seem to mention any 1284 so i dunno.

btw i did select "avr-developers.c","jtag disabled", and "20mhz full swing", and correct com port.

personal experience and observing several semesters of students it looks like roughly 95% of problems deal with issues like this and little with actual programming. most likely ive made some stupid mistake or possibly those who put these packages together. no wonder a few are driven in desperation to assembly instead of "portable" and "productive" hll.

here's the error again not abbreviated this time:

Quote
Arduino: 1.6.4 (Windows XP), Board: "avr-developers.com pinout, JTAG disabled, 20Mhz Full Swing"

Build options changed, rebuilding all



G:\arduino-1.6.4\hardware\tools\avr/bin/avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega1284p -DF_CPU=20000000L -DARDUINO=10604 -DARDUINO_1284P_AVR_DEVELOPERS -DARDUINO_ARCH_AVR -IG:\arduino-1.6.4\hardware\arduino\avr\cores\arduino -IG:\arduino-1.6.4\hardware\arduino\avr\variants\avr_developers C:\DOCUME~1\r\LOCALS~1\Temp\build4488457291395959552.tmp\Blink.cpp -o C:\DOCUME~1\r\LOCALS~1\Temp\build4488457291395959552.tmp\Blink.cpp.o

In file included from Blink.ino:18:0:
G:\arduino-1.6.4\hardware\arduino\avr\cores\arduino/Arduino.h:247:26: fatal error: pins_arduino.h: No such file or directory
 #include "pins_arduino.h"
                          ^
compilation terminated.
Error compiling.
same for empty sketch:

Quote
Arduino: 1.6.4 (Windows XP), Board: "avr-developers.com pinout, JTAG disabled, 20Mhz Full Swing"

G:\arduino-1.6.4\hardware\tools\avr/bin/avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega1284p -DF_CPU=20000000L -DARDUINO=10604 -DARDUINO_1284P_AVR_DEVELOPERS -DARDUINO_ARCH_AVR -IG:\arduino-1.6.4\hardware\arduino\avr\cores\arduino -IG:\arduino-1.6.4\hardware\arduino\avr\variants\avr_developers C:\DOCUME~1\r\LOCALS~1\Temp\build4488457291395959552.tmp\sketch_jun17a.cpp -o C:\DOCUME~1\r\LOCALS~1\Temp\build4488457291395959552.tmp\sketch_jun17a.cpp.o

In file included from sketch_jun17a.ino:1:0:
G:\arduino-1.6.4\hardware\arduino\avr\cores\arduino/Arduino.h:247:26: fatal error: pins_arduino.h: No such file or directory
 #include "pins_arduino.h"
                          ^
compilation terminated.
Error compiling.
why isnt arduino even looking in the new 1284 folders?
Title: Re: Mighty-1284p repo updated for IDE 1.6.x
Post by: bperrybap on Jun 17, 2015, 08:07 pm
I agree that there are many issues like this that show in in forum threads.
In nearly all the cases I've seen, it is due to incorrectly installing things which comes from either not following the installation instructions or misinterpreting them OR from attempting a trial and error guessing process of editing and patching things which corrupts the installation.


Your include paths look messed up.
The second -I option to the compiler should point to the variant directory for the board selected which is down under where the core is installed.
In your case, it looks like the second include directory is pointing down under the IDE directories avr core directory rather than to the variant directory under the 1284p core.
That shouldn't happen as the variant directory that the IDE "calculates" is relative to where the boards.txt file is and the 1284p core boards.txt will be in a different directory than the IDE supplied avr core.

While it could be a problem with the Windows version of the 1.6.4 IDE,
I'm guessing this is because the 1284p core was either installed incorrectly or there were some manual edits to some files in the tree that altered things and it has now confused the IDE.

While you can install the core under the IDE area, I think it is better to install it under your personal hardware directory so that it works with more than just the single IDE installation and will work with future IDE installations.
I believe that was the intent of #3 of instructions in the first post of this thread:

Quote
3. Go to your Arduino "hardware" folder.
How and where did you install it?
It really is as simple as just unziping 1284p core image under your {sketcthbookdire}/hardware directory.
You don't even have to rename the mighty-1284p-1.6.3 directory created by the unzipping.

Looking forward, one thing that would help, would be to update the 1284p core package and git tree to support the new library/core manager so that the IDE could install the core and allow the user to update it from the IDE when updates are available.
It's a pretty nice feature of the latest IDEs.

--- bill
Title: Re: Mighty-1284p repo updated for IDE 1.6.x
Post by: john1993 on Jun 17, 2015, 08:30 pm
How and where did you install it?
I downloaded 1.6.4 and unzipped it into a large partition. then downloaded the package from post #1 and copied contents into /hardware of the arduino i just installed and tested with uno. nothing else.

the difference between "my" hardware folder and "theirs" is not clear. i do have a few dozen other versions of arduino from 0013 up to latest. maybe this is trouble. the irony is a rather large group of individuals consider me the ardu-guru in spite of all denials so you can imagine what they go through on their own. some people have "good luck"... others... not so fortunate.

 what exactly did i do wrong? next step?
Title: Re: Mighty-1284p repo updated for IDE 1.6.x
Post by: bperrybap on Jun 17, 2015, 09:58 pm
I've also installed into the IDE hardware directory with 1.6.4. and that works as well.
Although I still recommend putting the 1284p core under your hardware directory and not the IDE hardware directory so it can work with more than just that one IDE.

You are leaving out details and details matter.
The steps you described in post #27 disagree with your steps in post #23
post #27 said:
Quote
copied contents into /hardware of the arduino i just installed and tested with uno. nothing else.
But this comment from post #23 concerns me:
Quote
... then copied "avr-developers.com" section into boards.txt ...
Which boards.txt did you edit and why? as
you shouldn't have to do any editing of any of the board.txt files that come with the 1284p core as all the board entries are included. For sure you don't want to be editing the IDE's boards.txt file to add 1284p boards as that won't work since the include paths will be wrong just like what we are seeing as the variant directory is based on where the boards.txt file is and the 1284p core is not in the same location as the IDEs avr core and variant files.

Sounds like you may have confused your installation by doing some editing of files.
Perhaps you also have an older version of the 1284 core installed down in your hardware directory?

I would install the 1284p core in your hardware directory vs the IDE hardware directory as that way it will work with all the IDEs that support the new 1.5x add on cores.


All you have to do is unzip the file in your hardware directory.
And if you need the 20Mhz support, rename the boards.txt.alt to boards.txt in the 1284 core so you get it.
It really is just that easy.




--- bill
Title: Re: Mighty-1284p repo updated for IDE 1.6.x
Post by: john1993 on Jun 17, 2015, 10:47 pm
Which boards.txt did you edit and why?
at first i just downloaded and unzipped files. when that didnt work i copied boards.txt from 1284 folder to the avr folder. at least the 1284 options showed up then but still that error. then as a last resort i put the original boards.txt back and added the 20mhz no-led entry to it. then got serious about editing and changing and of course things got worse. initially though no luck before any changes or editing.

i will delete all this and start over from scratch. as always your help and patience is appreciated.
Title: Re: Mighty-1284p repo updated for IDE 1.6.x
Post by: bperrybap on Jun 17, 2015, 10:49 pm
at first i just downloaded and unzipped files. when that didnt work i copied boards.txt from 1284 folder to the avr folder. at least the 1284 options showed up then but still that error. then as a last resort i put the original boards.txt back and added the 20mhz no-led entry to it. then got serious about editing and changing and of course things got worse. initially though no luck before any changes or editing.

i will delete all this and start over from scratch. as always your help and patience is appreciated.
What would you suggest to the instructions to make it clearer how to install the package?
Title: Re: Mighty-1284p repo updated for IDE 1.6.x
Post by: john1993 on Jun 18, 2015, 12:34 am
almost impossible to improve upon the instructions in post #1, except of course it didnt work for me this time. im sure i did something silly.

anyway lets find out why it failed before i make any real suggestions. only improvement at this time is adding the name of the board so it is easier to find in the menu and maybe the baud naming thing you mentioned. But these are trivial cosmetic items not worth mentioning.

i started right at the beginning of arduino and things were not working too well which is understandable for anything new. around 0018-0023 everything was great. chances a sketch worked was almost certain and all this folder stuff was manageable. then things started downhill and issues with compatibility and file locations cropped up. it wouldnt be the first time in computers that "progress" and "improvements" caused downhill slide.

this is not just myself but observations from many other beginners. my only general comment would be to make things easier for noobs and simplify instead of complicate. ive had many general suggestions over the years here for things like clock, pin naming, baud, pc interface, loaders, etc but dont want to get too far off topic. mostly i just want to see where i went wrong with this particular install. i will wipe this pc and start from scratch. stay tuned.
Title: Re: Mighty-1284p repo updated for IDE 1.6.x
Post by: john1993 on Jun 18, 2015, 08:52 pm
so i reformatted the hd, reinstalled windows and followed instructions again. this time it worked. as confirmation the original crowded image was restored and the same procedure duplicated. this time it failed again. so something on the drive, maybe registry or other arduino droppings interfere.

anyway while things were working i tested a few benchmark programs. there is definite improvement since last time i played with arduino for this chip couple years back. thanks to all those who put effort into making it better. particularly the opti.

speaking of which it would be nice to get a lst file with comments so i can crunch it down and squeeze in some favorite enhancements.
Title: Re: Mighty-1284p repo updated for IDE 1.6.x
Post by: pico on Jun 19, 2015, 05:07 am
so i reformatted the hd, reinstalled windows and followed instructions again. this time it worked. as confirmation the original crowded image was restored and the same procedure duplicated. this time it failed again. so something on the drive, maybe registry or other arduino droppings interfere.
When you mentioned that you first saw the boards.txt entries when you copied the file up one level from mighty-1284p/avr to mighty-1284p, that gave me pause.

It suggests that the IDE you are running is 1.0x rather than 1.6.x.

The Arduino IDE developers changed the position of the files starting with the 1.5.x IDEs.

IDEs 1.5.x and later (including 1.6.x) expects boards.txt to appear under mighty-1284p/avr, while IDEs 1.0.x and earlier expects to find them in mighty-1284p.

Are you installing the Windows IDE using the windows installer version, or the zip file install version? If the former, try installing with the zip file version instead -- much less chance of interference between new and previous installed versions of the IDE. In fact, pretty much the only way to do it if you want to run multiple installed versions of the IDE (which is often required for a variety of reasons.)
Title: Re: Mighty-1284p repo updated for IDE 1.6.x
Post by: john1993 on Jun 19, 2015, 11:21 pm
always zip file because i agree installers in general are evil. as mentioned i downloaded another copy of 1.6.4 and know exactly which version is being used because i always click on the exe flle. no task bar, desktop icons. or win start menu here. in the "crowded" partition i have every version of arduino from 0013 up and something there conflicts. maybe some rainy day i will take time to find exactly what.

for now if the need arises to use arduino with this chip i can always restore that virgin windows partition which works fine. atm the only reason to do that would be enhancing the bootloader and i wouldnt even start on that w/o a lst file.
Title: Re: Mighty-1284p repo updated for IDE 1.6.x
Post by: pico on Jun 20, 2015, 05:36 am
always zip file because i agree installers in general are evil. as mentioned i downloaded another copy of 1.6.4 and know exactly which version is being used because i always click on the exe flle. no task bar, desktop icons. or win start menu here. in the "crowded" partition i have every version of arduino from 0013 up and something there conflicts. maybe some rainy day i will take time to find exactly what.

for now if the need arises to use arduino with this chip i can always restore that virgin windows partition which works fine. atm the only reason to do that would be enhancing the bootloader and i wouldnt even start on that w/o a lst file.
Well, then it deepens the mystery because the zip file installs are supposed to be mostly limited to working within their own trees (but that's never been 100% true, and is even less so now with all the burgeoning BM stuff.)

BTW, the bootloaders all have .lst files -- I have uploaded a .lst file for the 20MHz optiboot bootloader for reference.
Title: Re: Mighty-1284p repo updated for IDE 1.6.x
Post by: pico on Jun 20, 2015, 05:43 am
Thanks to Per (pert) for testing and confirming the operation of the new 20MHz optiboot bootloader!

Per also found and corrected a typo in the new 'sleeping beauty" entry in boards.txt.alt. Pull request has been merged, and v1.6.3 of repo updated.

If you want to manually correct the typo, rather than downloading again, just change

slwwpingbeauty.upload.maximum_data_size=16384  

to  

sleepingbeauty.upload.maximum_data_size=16384
Title: Re: Mighty-1284p repo updated for IDE 1.6.x
Post by: john1993 on Jun 20, 2015, 05:58 pm
it was a surprise to see the noled version so much bigger than the led one. not 2x but almost half again. so much for my theory that pretty flashing lights take up valuable memory space.

i must say the first post here is an example of how things should really be done. excellent attention to instructions and links, if only more developers followed suit. thanks for doing such a great job. maybe arduino is becoming a practical tool for me to use on one of my favorite avrs.
Title: Re: Mighty-1284p repo updated for IDE 1.6.x
Post by: bperrybap on Jun 20, 2015, 07:15 pm
it was a surprise to see the noled version so much bigger than the led one. not 2x but almost half again. so much for my theory that pretty flashing lights take up valuable memory space.

Go look at the .lst file and you can see why.
The 20Mhz image has code that is not in the optiboot.c code that is in the tree.
The 20Mhz image is not only built with a different version of the optiboot code (which is not what is checked into this 1284 core tree) but appears to have been built with the BIGBOOT option which adds extra features like EEPROM support.
All the other images were built with an older version of optiboot.

While I think it is great to have a pre-built image with the newer optiboot code and with BIGBOOT support, I think it is bad to have this 20 Mhz image using code that came from some other place than what is checked into the tree.

In looking at the location in the image where the optiboot version is stored, it looks like the 20Mhz image was built with optiboot version 6.2 while all the other images were built with optiboot version 5.0

The optiboot.c image that is in the tree is version 4.5 so it appears that none of the pre-built images were built with the optiboot.c source code that is in the tree.

I think it is bad to ship pre-built bootloaders that were not built with the accompanying source code.

--- bill

Title: Re: Mighty-1284p repo updated for IDE 1.6.x
Post by: john1993 on Jun 20, 2015, 08:26 pm
i would have to agree that its better to have correct source with the binary. in my case the list file is the source so no biggy. since im trying to cram a lot of non-standard function into minimum boot block the smaller older images are more useful. it only took me a couple minutes to change baud in the old/small opti to 20mhz. im just glad to have some working m1284 code as a starting point. and very happy libraries are improved so more programs work compared to last time i tried.
Title: Re: Mighty-1284p repo updated for IDE 1.6.x
Post by: pico on Jun 22, 2015, 03:57 am
i would have to agree that its better to have correct source with the binary. in my case the list file is the source so no biggy. since im trying to cram a lot of non-standard function into minimum boot block the smaller older images are more useful. it only took me a couple minutes to change baud in the old/small opti to 20mhz.
Yes, not ideal to supply source when it doesn't actually match the built object code in the repo. I'm thinking in this case it might be better just to remove the obsolete source files, since anyone who is really interested in building their own custom bootloader for the 1284p, like yourself, is going to be likely to have their own opinion about which version of optiboot they are going to use, etc., and will certainly be capable of the google search to find the latest version of optiboot, etc.

I'll leave the .lst files as they do match the .hex files, and are useful as a reference (or even source) for anyone interested in the bootloader details.

Otherwise, for most users, the existing bootloader files will continue to do the job, regardless of which version of the source code they were originally built from. If someone wants to do a house clean at some time to tidy things up, they are welcome to, but it's not a high priority as far as I'm concerned. It's a relatively quick job to rebuild and rename all the bootloaders, but more work to then go in and change the boards.tx(.alt), and then actually test everything thoroughly to make sure everything is actually still working. As Bill (bperrybap) discovered, just because you build a new bootloader doesn't necessarily mean it's going to work first time.

im just glad to have some working m1284 code as a starting point. and very happy libraries are improved so more programs work compared to last time i tried.
Yeah, thanks, and glad you are finding it useful. I think with the new boards.txt.alt it's getting pretty slick. I'm even  toying with the idea of making it the standard boards.txt. Thoughts?

I think the patched standard libs are pretty essential. I remember having to argue with some people about that (well, one person in particular, as I recall), and whether they actually should be included in the repo, but after a certain point I ended up just doing it instead of spending all the time arguing about whether it could or should be done. Much more time efficient in the end!  :)

Title: Re: Mighty-1284p repo updated for IDE 1.6.x
Post by: Insiduous on Jul 02, 2015, 11:41 pm
I have just spent the week reading everything I could find about the 1284p, from MB's site thru the forums (as crosslinked), and I'm excited. Downloaded the zip for the current IDE and got it all installed in moments.

(I just wish I had a board to test with ;-)

Curious, however: it's been over a year down this road and there are still issues with the bootloader sources?? Why?

I've also noticed that the new IDE doesn't list the 1284[p] as a Boards-Manager Option. No one has looked into that process?

In any event, I really want to thank the lot of you for hammering it into shape and getting it over the 1.6.x
Title: Re: Mighty-1284p repo updated for IDE 1.6.x
Post by: pico on Jul 05, 2015, 07:54 am
I have just spent the week reading everything I could find about the 1284p, from MB's site thru the forums (as crosslinked), and I'm excited. Downloaded the zip for the current IDE and got it all installed in moments.

(I just wish I had a board to test with ;-)
The boards.txt file lists some links to various board and kit offerings that match up with the variant files in the repo:

bobuino.name=Bobuino and Skinny Bob, 16MHz using Optiboot
# Bobuino: http://crossroadsfencing.com/BobuinoRev17/index.html (http://crossroadsfencing.com/BobuinoRev17/index.htm)
# Skinny Bob: http:embeddedcoolness.com/shop/rfx-1284p-devdep-board-w-prototyping-area-nrf24l01-headers-kit/ (http://http:embeddedcoolness.com/shop/rfx-1284p-devdep-board-w-prototyping-area-nrf24l01-headers-kit/)

mighty_opt.name="maniacbug" Mighty 1284p 16MHz using Optiboot
# https://maniacbug.wordpress.com/2011/11/27/arduino-on-atmega1284p-4/ (https://maniacbug.wordpress.com/2011/11/27/arduino-on-atmega1284p-4/)

mightymini.name=Mighty Mini 1284p @ 16MHz, Optiboot @ 1Mbps
#http://github.com/JChristensen/mini1284 (http://github.com/JChristensen/mini1284)

sleepingbeauty.name=Sleeping Beauty 16MHz using OptiBoot
# http://www.firebirduino.com/sleeping_beauty/ (http://www.firebirduino.com/sleeping_beauty/)

These range form fully assembles boards (Bobuino, Sleeping Beauty) to self-assembly kits (RFX "Skinny Bob", "Mighty mini" 1284p) to breadboard projects ("maniacbug" Mighty 1284p).

The skill level for the kits varies according to your soldering fu: The "Skinny Bob" kit uses all through-hole components, whereas the "Mighty mini" uses smt components.

And of course you can always design or breadboard your own board using any of the pin layouts, so there are a lot of options covered here.

Curious, however: it's been over a year down this road and there are still issues with the bootloader sources?? Why?
In practice, it's never been a big deal, actually. If you just want to burn an existing bootloader file, you don't need the source to do that. If you are an advanced user who wants to build their own bootloader for some reason, you are likely going to want to use the latest optiboot version anyway. Or you can even use a listing file for source, if you know how, as has been discussed in this thread.

I should probably just delete the out-of-date optiboot source in the repo, since apparently it doesn't even correspond to the built bootloaders anyway.

I've also noticed that the new IDE doesn't list the 1284[p] as a Boards-Manager Option. No one has looked into that process?
It's been looked at, and rejected, as it offers no significant upside for the user over the current installation process, but does have a few material downsides.

In any event, I really want to thank the lot of you for hammering it into shape and getting it over the 1.6.x
No probs -- glad you are getting some value from it.  :)
Title: Re: Mighty-1284p repo updated for IDE 1.6.x
Post by: Insiduous on Jul 05, 2015, 06:29 pm
Yes. Bills come first, but reading all this - and then the install - was informative and painless. (contrast to trying to figure out how to download and plop/drop teensy 3.1 or the stm32 support: those simply fail).

(( and the support for the avr 8-bit devices is much, much more consolidated and complete ))

I can see developing on a 1284p to see where you are, and then compacting and trimming to fit a 328p, too: wonderful idea all by itself.

(I think I even have a low-profile ZIF that fits these dips.. I'll find out tomorrow ;-)
Title: Re: Mighty-1284p repo updated for IDE 1.6.x
Post by: scargill on Sep 05, 2016, 08:01 am
I am hoping someone can help here. I stumbled across this - I've just loaded up these files.... and everything compiles just fine.

I am hoping someone can help me. The code you see below lets you have 2 port bits on the 328 as 16 bit PWM - which is marvelous - and works - pins 9 and 10 - I'm hoping I can extend this to 4 pins on the 1284.

void setupPWM16() {
    DDRB |= _BV(PB1) | _BV(PB2);        /* set pins as outputs */
    TCCR1A = _BV(COM1A1) | _BV(COM1B1)  /* non-inverting PWM */
        | _BV(WGM11);                   /* mode 14: fast PWM, TOP=ICR1 */
    TCCR1B = _BV(WGM13) | _BV(WGM12)
        | _BV(CS10);                    /* no prescaling */
    ICR1 = 0xffff;                      /* TOP counter value */
}

/* 16-bit version of analogWrite(). Works only on pins 9 and 10. */
void analogWrite16(uint8_t pin, uint16_t val)
{
    switch (pin) {
        case  9: OCR1A = val; break;
        case 10: OCR1B = val; break;
    }
}

Clearly references to OCR1A and B can be added in as OCR3A and B but I'm not sure which 2 pins to add - and also the setup, I'm not at all clear what needs changing in a duplicate of that code - to set up TIMER3 and the relevant pins.

Any clever 1284 guys out there able to help?