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

Uart receiving data via dma and selecting speed and UART for logging output #3078

Closed
wants to merge 26 commits into from

Conversation

Skorpionm
Copy link
Member

@Skorpionm Skorpionm commented Sep 14, 2023

What's new

  • furi_hal: add selecting speed and USART for logging output
  • furi_hal: add USART1 receiving data via dma
  • furi_hal: add LPUART1 receiving data via dma

Verification

  • launch USB-UART Bridge. and check the reception of sending large uploads at high speeds

Checklist (For Reviewer)

  • PR has description of feature/bug or link to Confluence/Jira task
  • Description contains actions to verify feature/bugfix
  • I've built this code, uploaded it to the device and verified feature/bugfix

@github-actions
Copy link

github-actions bot commented Sep 16, 2023

PVS-Studio report for commit 83927af8:

@Skorpionm Skorpionm changed the title furi_hal: add selecting speed and USART for logging output Uart receiving data via dma and selecting speed and UART for logging output Sep 21, 2023
@Skorpionm Skorpionm marked this pull request as ready for review September 21, 2023 13:15
@github-actions
Copy link

github-actions bot commented Sep 21, 2023

Compiled f7 firmware for commit a706d21c:

@Skorpionm Skorpionm marked this pull request as draft September 22, 2023 16:09
@Skorpionm Skorpionm marked this pull request as ready for review September 24, 2023 15:10
furi_thread_flags_set(furi_thread_get_id(usb_uart->thread), WorkerEvtRxDone);
}
UNUSED(ev);
uint8_t data[data_len];
Copy link
Member

Choose a reason for hiding this comment

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

don't allocate data on stack with variable passed from outside

Copy link
Member Author

@Skorpionm Skorpionm Oct 7, 2023

Choose a reason for hiding this comment

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

fix

UNUSED(ev);
uint8_t data[data_len];
furi_hal_uart_dma_rx(id_uart, data, data_len);
furi_stream_buffer_send(usb_uart->rx_stream, data, data_len, 100);
Copy link
Member

Choose a reason for hiding this comment

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

no timeouts in interrupts

Copy link
Member Author

Choose a reason for hiding this comment

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

fix

} else if(LL_USART_IsActiveFlag_ORE(USART1)) {
LL_USART_ClearFlag_ORE(USART1);
size_t furi_hal_uart_dma_rx(FuriHalUartId ch, uint8_t* data, size_t len) {
furi_assert(uart[ch] != NULL && uart[ch]->buffer_rx_ptr != NULL);
Copy link
Member

Choose a reason for hiding this comment

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

FURI_IS_IRQ_MODE check

Copy link
Member Author

Choose a reason for hiding this comment

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

fix

}
irq_cb[ch] = cb;
irq_ctx[ch] = ctx;
size_t furi_hal_uart_dma_bytes_available(FuriHalUartId ch) {
Copy link
Member

Choose a reason for hiding this comment

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

private

Copy link
Member Author

Choose a reason for hiding this comment

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

fix

@hedger hedger added New Feature Contains an IMPLEMENTATION of a new feature Core+Services HAL, furi & core system services labels Oct 13, 2023
@skotopes skotopes marked this pull request as draft January 15, 2024 11:55
@skotopes skotopes closed this Feb 17, 2024
@skotopes skotopes deleted the skorp/furi_hal_usart_console branch February 17, 2024 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core+Services HAL, furi & core system services New Feature Contains an IMPLEMENTATION of a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants