-
Notifications
You must be signed in to change notification settings - Fork 0
Add a UART bootloader #58
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d63e845
to
f1cba30
Compare
a092087
to
ffba39d
Compare
…it to the bootloader
* Add simavr simulator * Remove some redundant headers * Move avr object into main * Remove vcd * Use fuse values for bootloader * Extract predicate * Use getopts to parse arguments Break out argument parsing into a function * Ignore flash image run output * Add debug configuration for running with vscode * Rename the simulator * Create Github action for building * Move UART usages closer to each other * Break out function for filling flash with main program * Break out function for adding flash dump hook * Exit simulator when bootloader finishes * Draw the status LEDs using OpenGL * Fix: Make simulator dump flash at finish * Only draw the pins connected to LEDs * Use a single interrupt for the whole PORT C * Break out GLUT init function * WIP: Implement state machine for receiving programmer data * Break out graphics functions into their own file * Remove unhelpful comments * Add more debug info * WIP: Update vector table before bootloader * Use own fork of simavr that has interrupt table patch * Deinit millis interrupts to make sure we don't get bootloader interrupt when moving to the application * Convert to assembly function This makes sure they work regardless of optimization level in the compiler * Bump simavr
f62fb3d
to
72e52f9
Compare
It's too slow to do in the middle
This way we remove the dependency on millis in the bootloader
This way we can compile the state machine even on non-AVR.
2021dad
to
1e89304
Compare
This improves the speed of the protocol significantly since we don't have to wait until the read command times out. Benchmark before: - time between packets: 400-450 ms - total time to flash millis: 3.1 s Benchmark after: - time between packets: 20-30 ms (~17x speedup) - total time to flash millis: 630 ms (~5x speedup)
I improved the bootloader efficiency quite a bit in 6cfe3d9 This improves the speed of the protocol significantly since we don't BeforeBenchmark before:
AfterBenchmark after:
|
The order of the arguments was switched up
Otherwise we don't get the required performance
nperozzi
approved these changes
Jun 17, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
How to use it:
Flash the bootloader
# Upload the bootloader and set the required fuses pio run -e bootloader -t upload
Use the bootloader
TODO