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

Add support for LPC USART TX IDLE IRQ + TX IDLE status flag #128

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

laurensmiers
Copy link

This adds support for the LPC USART TX IDLE IRQ and TX IDLE status flag which enables the support for the USART non-blocking API which is part of the standard LPC SDK.

More info is available in the raised github issue:
renode/renode#761

Reproduction using the renode-template

It is based on the lpcxpresso55s16 board which is running some zephyr examples using renode:
https://designer.antmicro.com/hardware/devices/lpcxpresso55s16?software=zephyr|lpcxpresso55s16|
the repo has a binary compiled from the LPC SDK for the usart_interrupt_transfer driver example.
It's basically a echo-example using the non-blocking usart API. Whatever we write to the uart, should be printed back to us.

Failing

A failing example with the current LPC_USART C# peripheral can be found here:
https://github.com/laurensmiers/renode-issue-reproduction-template/tree/761-lpc-usart-txidle-irq-not-firing

Passing

The passing example uses the updated LPC_USART driver of this PR (copied into the other repo and dynamically included):
https://github.com/laurensmiers/renode-issue-reproduction-template/tree/761-lpc-usart-txidle-irq

If more info or changes are required, let me know.

Store the TXIDLE interrupt status and check if we need to generate an
interrupt in UpdateInterrupts().

We generate an interrupt if both conditions are true:
- The TXIDLE interrupt is enabled
- AND the TX queue is empty

This is part 1/2 of enabling the non-blocking API in the standard LPC
SDK fsl_usart.c driver.
Next we need to implement the TXIDLE status flag.

Signed-off-by: Laurens Miers <[email protected]>
The TXIDLE register-flag is a status flag indicating if the USART TX
is idle/done.
This means whenever the queue is empty, we should report idle.

This is part 2/2 of enabling the non-blocking API in the standard LPC
SDK fsl_usart.c driver.

Signed-off-by: Laurens Miers <[email protected]>
@CLAassistant
Copy link

CLAassistant commented Mar 2, 2025

CLA assistant check
All committers have signed the CLA.

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