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

How to upload code to atmega32u4 with nanoBoot? #17

Open
gitboy555 opened this issue Oct 10, 2022 · 1 comment
Open

How to upload code to atmega32u4 with nanoBoot? #17

gitboy555 opened this issue Oct 10, 2022 · 1 comment

Comments

@gitboy555
Copy link

Hi!

I found this 512 byte bootloader called nanoBoot and successfully flashed it on an atmega32u4 board. It goes to bootloader mode when I do the HW reset so that means it's working fine. My issue now is I don't know how to upload code to it. Can I use AVRDUDE to upload or flash code to it?

@sigprof
Copy link
Collaborator

sigprof commented May 12, 2024

You can use the hid_bootloader_cli tool, which is a modification of teensy_loader_cli (the USB protocol is actually the same, but the USB IDs need to be different from the PJRC-owned ones, and the Teensy tool does not support third-party USB IDs, so it needed to be forked). Unfortunately, you may need to compile the tool from source yourself, because at the moment the only place which has that tool packaged is MSYS2 (at least Repology does not know anything else).

There is also a Python implementation of the flashing tool, which might be easier to get running (but it also needs the hidapi and intelhex Python packages, and at least hidapi depends on a native library).

Also apparently there is a way to use the teensy programmer support in recent versions of avrdude, but that requires supplying a custom avrdude.conf (it seems to be the only way to override the usbvid and usbpid parameters), and using -F (to ignore the HID usage mismatch) and -V (disable verification, because the bootloader does not support reading — although that issue applies to the original Halfkay bootloader too), and still produces some warnings about inability to read the flash to get the pad bytes for the last incomplete page. And avrdude must be built with the hidapi support enabled, which might not be the case in all distros (e.g., in Nixpkgs that option had been enabled around 2024-04-15, and apparently uses libhidapi-libusb instead of libhidapi-hidraw, which causes some problems).

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

2 participants