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

Bootloader for AT32F421 MCU #98

Open
RealTheKad opened this issue Oct 6, 2024 · 2 comments
Open

Bootloader for AT32F421 MCU #98

RealTheKad opened this issue Oct 6, 2024 · 2 comments

Comments

@RealTheKad
Copy link

Hello,
I'm currently working with the AT32F421 MCU and focusing on configuring its bootloader for UART communication. According to the datasheet, PA2 is designated the TX (Transmit) pin by default. To my knowledge, it should be RX to receive the firmware through the pin. I have a few questions:

  • Is it possible to remap or reconfigure PA2 from its default TX function to RX within the bootloader settings?

  • Alternatively, can PA2 support both TX and RX functionalities through pin multiplexing (MUX)? If so, how can this be achieved without conflicting with the bootloader's operations?

  • Are there any specific constraints or considerations within the bootloader that I should know when attempting to modify the PA2 pin configuration for RX functionality?

Can somebody help me out? Thank you in advance.

@frank26080115
Copy link
Collaborator

It's entirely bitbanged, see https://github.com/AlkaMotors/AT32F421_AM32_Bootloader/blob/main/Src/main.c

And I think the F421 UART supports half duplex mode or at least UART pin swapping

@RealTheKad
Copy link
Author

Thank you for your response.

I'm working on implementing Betaflight passthrough on my controller stack, where a single telemetry wire is used for both telemetry data and firmware updates over the same connection. According to the datasheet, PA2 and PA3 should be used for USART2 in the bootloader, but based on your response, I understand that PA2 is currently functioning as both TX and RX.

My questions are:

  • Should the telemetry wire coming from the ESC be connected to the TX or RX pin on the flight controller?

  • Should PA2 (bootloader pin) and PB6 (telemetry pin) be connected together on a single route to the flight controller's pin, considering that PA2 is handling both TX and RX?

Your advice on the correct wiring and configuration would be greatly appreciated.

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