Skip to content

Conversation

@dakejahl
Copy link
Contributor

@dakejahl dakejahl commented Aug 9, 2025

By default the serial line is configured in TX mode as push-pull. This prevents sharing the serial line with other ESCs if the ESC has not received a telemetry request before. This fixes the issue by ensuring the serial line is initialized as RX.

This should be added to all of the targets. Opening now as a draft to get review, and then I can add to all of the targets if we agree this is the right solution.

scope shot of one uninitialized ESC pulling the signal
am32_uninitialized_serial

By default the serial line is configured in TX mode as push-pull. This prevents sharing the serial line with other ESCs if the ESC has not received a telemetry request before. This fixes the issue by ensuring the serial line is intialized as RX
@dakejahl dakejahl marked this pull request as ready for review August 26, 2025 23:19
@dakejahl
Copy link
Contributor Author

@AlkaMotors thoughts?

@AlkaMotors
Copy link
Collaborator

This works for me, I can't see any issues it would cause.

@dakejahl
Copy link
Contributor Author

Want me to update the other targets as well? I don't have the means of testing them

@AlkaMotors
Copy link
Collaborator

yes please. if you have time.

@dakejahl
Copy link
Contributor Author

I'm not confident I can make the changes to the other targets without breaking them, since I can't test them. The reason I am not confident is because of how send_telem_DMA() looks:

void send_telem_DMA(uint8_t bytes)
{ // set data length and enable channel to start transfer
    LL_USART_SetTransferDirection(USART1, LL_USART_DIRECTION_TX);
    LL_DMA_DisableChannel(DMA1, LL_DMA_CHANNEL_2);
    LL_DMA_SetDataLength(DMA1, LL_DMA_CHANNEL_2, bytes);
    LL_DMA_EnableChannel(DMA1, LL_DMA_CHANNEL_2);
    LL_USART_SetTransferDirection(USART1, LL_USART_DIRECTION_RX);
}

It sets the transfer direction to RX immediately after passing the bytes and enabling DMA. According to this logic the transfer shouldn't work at all because the USART transmitter is immediately disabled after enabling DMA.

That being said, not all of the other targets do this. Some of them enable the transmitter in init() and never disable it.

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

Successfully merging this pull request may close these issues.

2 participants