How to implement custom Caterina style bootloader

174 views
Skip to first unread message

Tarun Pondicherry

unread,
Sep 30, 2013, 6:23:06 AM9/30/13
to devel...@arduino.cc
Hi,

I'd like to implement a custom bootloader for the 32u4 that essentially runs the caterina bootloader with the 8 MHz internal RC on the 32u4. While I can specify a custom bootloader using the board settings, I cannot trigger the "reset on 1200 bps com port connect" that the caterina does because it is hardcoded in AvrdudeUploader.java to only work for the caterina, caterina-Arduino_Robot, caterina-LilyPadUSB (see my patch for where it is hardcoded). As far as I can tell, there is no way to currently trigger the reset on 1200 bps mechanism that caterina bootloaders use in a custom bootloader.

In order to create custom caterina-like bootloaders that allow for USB programming on the 32u4, there needs to be a flag that causes the uploader to initiate a 1200 bps connection and reset the target board.

I've created a patch that I believe addresses this. This change adds a flag, "upload.reset_on_1200bps_com_port_connect" that allows the board spec to trigger the reset mechanism for custom bootloaders. If there already exists a way to do this that I've overlooked, please let me know. Cristian, I looked at the example you linked me to, and I believe it only shows how to add a custom bootloader, not how to trigger the reset mechanism that caterina bootloaders use.

Thanks,
Tarun

Cristian Maglie

unread,
Sep 30, 2013, 6:45:28 AM9/30/13
to devel...@arduino.cc

In data lunedì 30 settembre 2013 12:23:06, Tarun Pondicherry ha scritto:

> In order to create custom caterina-like bootloaders that allow for USB

> programming on the 32u4, there needs to be a flag that causes the uploader

> to initiate a 1200 bps connection and reset the target board.


> https://github.com/arduino/Arduino/pull/1547


Hi Tarun,


the link I've posted on github was meant to show you a specific line on the boards.txt, but in the meantime the boards.txt changed and the link screwed up. I've posted an updated link now (that should be always valid).


The point is that there is a very similar feature that you can enable with a keyword like this:


leonardo.upload.use_1200bps_touch=true


I basically see no difference with the one you implemented in your pull request. Let me know if there is any other issue that I missed.


C


Tarun Pondicherry

unread,
Sep 30, 2013, 8:04:57 AM9/30/13
to devel...@arduino.cc
Thanks, I believe the option in this link should solve my issue.
Reply all
Reply to author
Forward
0 new messages