8000 Add support for Arduino boards jump to bootloader via CDC. by iabdalkader · Pull Request #8574 · micropython/micropython · GitHub
[go: up one dir, main page]

Skip to content

Add support for Arduino boards jump to bootloader via CDC. #8574

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

Closed
wants to merge 5 commits into from

Conversation

iabdalkader
Copy link
Contributor
@iabdalkader iabdalkader commented Apr 21, 2022

This patch adds support for an Arduino IDE feature that resets a board into bootloader mode by opening the serial port with baudrate set 1200bps and then closing the port (aka 1200bps touch). This allows users to seamlessly upload sketches to Arduino boards running Micropython.

NOTE: The NRF changes are mostly code-formatting.

This should be resolved first:

@iabdalkader iabdalkader changed the title Add support Arduino boards jump to bootloader via CDC. Add support for Arduino boards jump to bootloader via CDC. Apr 21, 2022
@dpgeorge
Copy link
Member
dpgeorge commented Jun 3, 2022

resets a board into bootloader mode by opening the serial port with baudrate set 1200bps and then closing the port

Is it specified that it must close the port for it to enter the bootloader? In other words, it won't enter the bootloader unlit the USB port is closed (and was at 1200 baud when closed)?

@iabdalkader
Copy link
Contributor Author

Is it specified that it must close the port for it to enter the bootloader?

The only requirement is jumping to bootloader when a port is opened at 1200bps, the IDE typically closed the port right away.

@dpgeorge
Copy link
Member
dpgeorge commented Jun 3, 2022

The only requirement is jumping to bootloader when a port is opened at 1200bps, the IDE typically closed the port right away.

OK. But see my other comment above, about responding to the USB request to change baud rate. I think it would be good to have a clean disconnect.

@iabdalkader iabdalkader force-pushed the arduino_1200bps branch 3 times, most recently from 42ae5b7 to 3e79bad Compare June 7, 2022 10:42
@iabdalkader
Copy link
Contributor Author

@dpgeorge I think this should be resolved first #8590 and then will rebase this PR.

@dpgeorge
Copy link
Member

This can be rebased now that #8590 is merged.

@iabdalkader iabdalkader force-pushed the arduino_1200bps branch 2 times, most recently from 41c5337 to 817d7a3 Compare June 17, 2022 10:38
@iabdalkader
Copy link
Contributor Author

Rebased and retested stm32, rp2 and nrf ports.

@iabdalkader iabdalkader force-pushed the arduino_1200bps branch 4 times, most recently from 627fff4 to d2fb2d7 Compare June 17, 2022 13:49
@dpgeorge
Copy link
Member

The 1200 touch commits have been merged in 6c1495b through 425d8fc

I did not merge the nrf formatting commit because it's just fixing one file but there are many others that still need reformatting, and also tools/codeformat.py needs to include these files so they stay properly formatted. That work would be best done in a separate PR, just to reformat the nrf port.

@iabdalkader
Copy link
Contributor Author

I did not merge the nrf formatting commit because it's just fixing one file but there are many others that still need reformatting, and also tools/codeformat.py needs to include these files so they stay properly formatted. That work would be best done in a separate PR, just to reformat the nrf port.

That's okay, might be able to get around to that later.

@iabdalkader iabdalkader deleted the arduino_1200bps branch June 23, 2022 19:36
tannewt added a commit to tannewt/circuitpython that referenced this pull request Nov 13, 2023
Original code used uint32_t* so `/ sizeof(size_t)` was needed. It
is a uint8_t* now so that division makes it 4x smaller. Whoops!

Fixes micropython#8574
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0