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

drivers: uart: atmel_sam: Added reset after error check #59818

Merged

Conversation

IVandeVeire
Copy link
Contributor

Following the sam4s datasheet, the OVRE, PARE and FRAME flags should be cleared after a uart error occured. This is done writing a 1 to the RSTSTA bit in the UART_CR.

Following the sam4s datasheet, the OVRE, PARE and FRAME flags should be
cleared after a uart error occured. This is done writing a 1 to the
RSTSTA bit in the UART_CR.

Signed-off-by: Ibe Van de Veire <[email protected]>
@zephyrbot zephyrbot added platform: Microchip SAM Microchip SAM Platform (formerly Atmel SAM) area: UART Universal Asynchronous Receiver-Transmitter labels Jun 28, 2023
Copy link
Collaborator

@pdgendt pdgendt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on SAM4S custom board, @nandojve any objections?

@nandojve
Copy link
Member

I need check all SoC before accept. If there is no regression it is fine for me.

@pdgendt
Copy link
Collaborator

pdgendt commented Jun 29, 2023

I need check all SoC before accept. If there is no regression it is fine for me.

@nandojve I've checked datasheets for sam3x/sam4e/sam4s/same70 that they all have this flag, as these include the driver in the device tree.

Also the uart_sam_configure function already sets the bit, so I guess it should be fine?

uart->UART_CR = UART_CR_RSTRX | UART_CR_RSTTX
| UART_CR_RXDIS | UART_CR_TXDIS
| UART_CR_RSTSTA;

@nandojve
Copy link
Member

I need check all SoC before accept. If there is no regression it is fine for me.

@nandojve I've checked datasheets for sam3x/sam4e/sam4s/same70 that they all have this flag, as these include the driver in the device tree.

Also the uart_sam_configure function already sets the bit, so I guess it should be fine?

It is missing sam4l on your list.

@pdgendt
Copy link
Collaborator

pdgendt commented Jun 29, 2023

It is missing sam4l on your list.

It does not have a compatible = "atmel,sam-uart";

https://github.com/zephyrproject-rtos/zephyr/blob/5876cc53d45201b0f7f185ae9f16c1e992422166/dts/arm/atmel/sam4l.dtsi

@carlescufi carlescufi merged commit 007dc6d into zephyrproject-rtos:main Jun 29, 2023
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: UART Universal Asynchronous Receiver-Transmitter platform: Microchip SAM Microchip SAM Platform (formerly Atmel SAM)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants