am32-firmware / AM32

GNU General Public License v3.0
268 stars 94 forks source link

Bootloader for AT32F421 MCU #98

Open RealTheKad opened 1 week ago

RealTheKad commented 1 week ago

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:

Can somebody help me out? Thank you in advance.

frank26080115 commented 1 week ago

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 commented 1 week ago

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:

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