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

In uart_reva.c, MXC_UART_RevA_Init does not initialize unused UARTs states #998

Open
aniktash opened this issue Apr 22, 2024 · 0 comments · May be fixed by #1004
Open

In uart_reva.c, MXC_UART_RevA_Init does not initialize unused UARTs states #998

aniktash opened this issue Apr 22, 2024 · 0 comments · May be fixed by #1004
Assignees

Comments

@aniktash
Copy link
Contributor

MXC_UART_RevA_Init only initializes the selected state's structure:
// Initialize state struct
unsigned int i = MXC_UART_GET_IDX((mxc_uart_regs_t *)uart);
states[i].channelRx = -1;
states[i].channelTx = -1;
states[i].tx_req = NULL;
states[i].rx_req = NULL;
states[i].auto_dma_handlers = false;
Unused UART state's structures are not initiated. The problem happens in MXC_UART_RevA_DMACallback when checking the channelTx:
for (int i = 0; i < MXC_UART_INSTANCES; i++) {
if (states[i].channelTx == ch) {
If it is not initialized, it thinks it is a valid state of a used UART and proceeds with checking the callback, which is also not initialized, and breaks from the loop, without iterating to the next UART instance. This results in not receiving the callbacks if UART1 is used (tested on MAX32665).

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 a pull request may close this issue.

2 participants