-
Notifications
You must be signed in to change notification settings - Fork 22
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
MegaCoreX dynamic fuses and bootloader #9
Comments
@valeros any thoughts? |
Hi @MCUdude ! I've pushed your development with slight modification, including fixes for the issues your specified above. It'd be great if you could test new functionality using the platform for dev branch. Thanks! |
I'm not completely done testing, since there are some issues that are preventing me. First, I'm getting the incorrect device signature in Avrdude again. I've manually deleted the
I'm not sure what's causing this. I was able to sneak in the -F flag to continue my testing. Setting fuses works fine. However, bootloading not so much:
The corerct path is Another thing. I'm pretty sure all fuses are supposed to be in capital letters. At least, that's what Microchip uses in Atmel Studio and in their datasheets |
About the 0x200 offset. I think we should use the
In this example, since |
Thanks for testing! I see you didn't specified
Thanks, now I see why you used
Thanks, fixed as well. |
🤦 Of course! I'm being sloppy, sorry! This fixed the issues I faced. There's one tiny formatting thing I'd like to have fixed:
You can probably guess what it is? Add a space in front of the |
Another question @valeros. Is it possible to get access to a parameter defined in one environment in another environment? [env:environment1]
upload_protocol = xplainedmini_updi
[env:environment2]
upload_protocol = ${environment1.upload_protocol}
This would be very convenient in the platformio.ini template I'm creating for MegaCoreX EDIT: [env:environment1]
upload_protocol = xplainedmini_updi
[env:environment2]
upload_protocol = ${env:environment1.upload_protocol}
|
Thanks, the formatting should be fine now. |
Awesome! Here are the README and platformio.ini template I've created for MegaCoreX users: https://github.com/MCUdude/MegaCoreX/blob/master/PlatformIO.md |
Are we ready for a new atmelmegaavr release? |
Is there any chance you could port that page to PlatformIO docs? Something similar to the
Once the issue #10 is resolved. |
Sure! I do have an Uno Wifi Rev2, so iI can help out with the testing this evening. |
Thanks, released. |
Hi!
After you @valeros released the latest
atmelmegaavr
package I started working on the fuses/bootloader script, and it wasn't that much work really. As mentioned earlier, I am NOT a (professional) Python programmer. The scrips work, but they are probably terrible because I'm happy as long as they just do what I want.First, here is the fuses script I've come up with:
Note that many of the functions are empty and only return a constant. This is on purpose so it's easier to extend the functionality later (other megaavr cores etc.).
Here is the bootloader script:
I removed the
board_bootloard.pins
parameter to make the setup procedure more similar to my other cores. You can instead useboard_hardware.uart = uart0 #or uart0_def or uart0_alt
There are some minor issues we need to work out though.
USE_EXTERNAL_OSCILLATOR
somewhere ifboard_hardware.oscillator = external
is present in platformio.ini. I know this could be added to the build flags, but it would be slightly more elegant if it could be hidden just like in the Arduino IDE. This will harmonize with the way my other cores work and behave.board_hardware.uart != no_bootloader
present in platformio.ini). If not, it won't be possible to use the bootloader to upload new programs.upload_protocol = arduino
, PlatformIO forces the USB flag and mutes the provided upload port.I think this can be fixed by adding
arduino
as a programmer here:platform-atmelmegaavr/builder/main.py
Line 200 in 3c2f7d8
However
arduino
does not requireuse_1200bps_touch
orwait_for_upload_port
. Below is the error I'm getting with an umodified main.py file:However, Modifying the main.py file by replacing line 200 - 203 with the following code works:
Note that I've added the -D flag because this is required if you're using the
arduino
protocol. If not, you're getting an erase error.The text was updated successfully, but these errors were encountered: