[Bug Report] HAL_UART_Transmit_DMA doesn't transmit a character.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-12-07 05:42 AM
I have inserted this simple code to the main() of the CubeIDE generated code.
/* USER CODE BEGIN 2 */
HAL_StatusTypeDef status = HAL_UART_Transmit_DMA(
& huart3,
buf,
sizeof(buf));
/* USER CODE END 2 */
It should transmit a short message through the STlink console, and then, cause interrupt. But none of these occurred.
I have checked on Nucleo F733ZE and Nucleo G431RB( 64pin ).
The demonstration program of this problem is attached as zipped. file. To see the demo of the problem.
- Start the tty program for the STLINK console.
- Include two project ( for Nucleo F722ZE and G431RB ).
- Build them
- Set break point to the interrupt handler of the DMA and UART ( stm32f7xx_it.c and stm32g4xx_it.c)
- Run the test program.
If the program run correctly, you will see the message on the terminal program on host, and program stop at break point on interrupt handler. I could not see these behavior.
The environment is :
- Ubuntu 16.04 LTS
- Cube IDE 1.1.0
- STM32Cube FW_F7 v1.15.0
- STM32Cube FW_G4 v1.1.0
- Nucleo F722
- Nucleo G431 (46pin)
Please kindly check.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-12-07 05:49 AM
The generated code is sometimes wrong, see
- https://community.st.com/s/question/0D50X0000Bh6PntSQE/bug-mxdmainit-wrongly-placed-by-code-generator-haluarttransmitdma-does-not-work
- https://community.st.com/s/question/0D50X0000Bmob3uSQA/dma-not-working-in-cubemx-generated-code-order-of-initialization
hth
KnarfB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-12-07 06:27 AM
> The generated code is sometimes wrong
I would say that there are some parts of HAL/CubeMX code, that are not flawed, but absolutely all that code is bloated and inflexible.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-12-10 04:12 PM
Thanks KnarfB
I've checked linked paged and understood what happen.
The workaround by KnarfB works fine.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-12-10 04:13 PM
Thanks Piranha.
Hope ST releases the updated CubeIDE soon.