-
-
Notifications
You must be signed in to change notification settings - Fork 107
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 sizes on 8KB flash AVR parts #207
Comments
By default, the PlatformIO/MiniCore implementation includes a 512-byte bootloader by default. If you don't want to use a bootloader you can just redefine the flash size in platformio.ini. build_upload.maximum_size = 8192 The ATmega48 doesn't have a bootloader section. Thats why all 4096 bytes are "available" by default. |
@valeros would it be possible to automatically add 512 bytes to the |
I agree that all these manifests rather represent bare MCUs than full-fledged boards. IMO, the manifests should contain the precise memory size without any assumptions on bootloader presence. Anyone who want to use bootloader then should use the |
@valeros is this something that could be handled automatically for bare MCUs that are supported by Mighty/Mega/Mini/Major/MicroCore? We know the bootloader sizes for the various targets (512B or 1024B). Mabe a field in the manifest file: |
TBH, I'm a bit reluctant to pollute manifests with core-specific configurations. I guess users who know how to use bootloader should be aware of memory constraints it brings. Besides, how can we determine whether a target is using bootloader to reduce the memory size accordingly? |
For those who aren't using a bootloader, they are probably using the manifest files meant to be used with "my" Arduino cores. Since I've compiled all the bootloaders for all these boards, I know how big they are and how much space is allocated in every microcontroller. Just for fun, the bootloader build scrip I'm using also generates a file that contains some information about every file, for example atmega1284p_build_info.txt. But what matters here is the actual allocated space set by the fuse bits. Here's the rule for MightyCore, MegaCore, MiniCore and MajorCore:
|
Thanks for the info, but the question still remains, how can we detect that a bootloader is used and accordingly subtract the default bootloader size from the |
My cores support |
@MCUdude Could you please update the |
Sure! I'll see if I can submit a PR tonight. |
@valeros looks good to me! |
There is an issue of incorretly staded flash size on bare AVR parts with 8KB of flash memory, namely:
https://github.com/platformio/platform-atmelavr/blob/develop/boards/ATmega8.json
https://github.com/platformio/platform-atmelavr/blob/develop/boards/ATmega88.json
https://github.com/platformio/platform-atmelavr/blob/develop/boards/ATmega88P.json
https://github.com/platformio/platform-atmelavr/blob/develop/boards/ATmega88PB.json
The value of "upload" -> "maximum_size": is 7680, while it should probably be 8192 as these are bare ICS, therefore without any bootloader in them.
On the other side
https://github.com/platformio/platform-atmelavr/blob/develop/boards/ATmega48.json
seems to advertise the whole flash size in the json definitions.
In fact this is incosistent across most of the bare IC definitions, as ATMEGA parts mostly has the flash size liited, while ATTINY parts seem to advertise the whole flash size.
The text was updated successfully, but these errors were encountered: