Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong flash space for Arduino MEGA in boards.txt #2277

Closed
leomil72 opened this issue Aug 31, 2014 · 3 comments
Closed

Wrong flash space for Arduino MEGA in boards.txt #2277

leomil72 opened this issue Aug 31, 2014 · 3 comments

Comments

@leomil72
Copy link

It seems that there's an issue in the memory reserved for the bootloader on the Arduino MEGA2560 boards.

This is an extract of the Arduino MEGA2560 entry in the boards.txt:
mega2560.upload.protocol=wiring
mega2560.upload.maximum_size=258048
mega2560.upload.speed=115200

mega2560.bootloader.low_fuses=0xFF
mega2560.bootloader.high_fuses=0xD8

As you can notice, the entry tells the IDE that it can use up to 252K of Flash (258,048 bytes) for the user's sketches, so you lead to think that the bootloader space is only 4K wide:
256K => 262,144b
262,144 - 258,048 => 4,096b

But you can also notice that the high fuse, that sets the size of the bootloader area, reserves 4,096w (words), that are 8,192b (bytes). Its value is $D8. The page for the Arduino MEGA2560 says: "Flash Memory 256 KB of which 8 KB used by bootloader". So the size set by the fuse is correct but the maximum_size isn't.

Same for Arduino MEGA1280.

@matthijskooijman
Copy link
Collaborator

What you say seems to make sense. I haven't verified against the datasheet yet, but perhaps you'd care to prepare a pullrequest to fix this? Best fix it in the ide-1.5.x branch, btw.

@championswimmer
Copy link
Contributor

@matthijskooijman I have submitted the said pull request. Would please take a look at it

@cmaglie
Copy link
Member

cmaglie commented Sep 20, 2014

Fixed with #2313 for Mega 2560 and ADK.

For the Mega 1280 I see:

mega.menu.cpu.atmega1280.bootloader.high_fuses=0xDA

i.e. it reserves 2048w = 4096b, so the existing value 126976 == (128-4)*1024 is correct.

@cmaglie cmaglie closed this as completed Sep 20, 2014
cmaglie added a commit that referenced this issue Sep 23, 2014
set correct max size for mega2560 (to address issue #2277)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants