Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions drivers/platform/stm32/stm32_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -672,16 +672,18 @@ int32_t stm32_spi_transfer_dma(struct no_os_spi_desc* desc,
sdesc->stm32_spi_dma_done = false;
stm32_config_dma_and_start(desc, msgs, len, stm32_spi_dma_callback, desc);
timeout = msgs->bytes_number;
while (timeout--) {
while (timeout > 0) {
no_os_mdelay(1);
if (sdesc->stm32_spi_dma_done)
break;
timeout--;
};

/* need some cleanup here? */
if (timeout == 0)
/* Fix: Check the actual completion flag instead of the counter */
Comment thread
morleman1 marked this conversation as resolved.
Outdated
if (!sdesc->stm32_spi_dma_done) {
/* Optional: Add HAL_DMA_Abort_IT() or similar cleanup here */
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

remove this comment as well

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

i reverted to the original comment /* need some cleanup here? */, as a cleanup still should be implemented similar to the xspi implementation. here it is more complex, because of seperate handles for rx and txdma_ch

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You are right, just squash the commits for now into a single commit and leave the original question there. We can deal with that separately in another PR and merge this one.

return -ETIME;

}
return 0;
}

Expand Down
Loading