2024-08-28 03:37 PM
I'm using STM32CubeIDE to configure UCPD1 on STM32G0B1KET6N. My firmware package is FW_G0 V1.6.2
I enable DMA: UCPD1_RX = DMA2 Channel 1, UCPD1_TX = DMA2 Channel 2
The generated code in MX_UCPD1_Init can't compile because the DMA init code is bad. The section labelled /* UCPD1_RX Init */ should start with this:
LL_DMA_SetPeriphRequest(DMA2, LL_DMA_CHANNEL_1, LL_DMAMUX_REQ_UCPD1_RX);
... but it actually starts with this:
LL_DMA_SetPeriphRequest(DMA2_Channel1, DMA2_Channel1, LL_DMAMUX_REQ_UCPD1_RX);
Compare the first two parameters. Luckily, the compiler chokes on this and it's obvious how to fix it. There are 8 lines with this bug for the RX DMA, and 8 lines for the TX DMA.
I don't know if my other UCPD settings influence the bug:
UCPD mode = sink
Dead battery enabled
USB/UCPD1 interrupt enabled
DMA1 4-7 / DMA2 1-5 / DMAMUX1 interrupt enabled
Pins PB15, PA8, PA9, PA10 are all configured for their UCPD1 functions.
2024-08-29 04:48 AM
Hi @GrahamAU
Could you let me know which version of CubeMX you are using? I attempted to reproduce the issue on my end, and the code generation worked correctly. Attached my IOC file for reference.
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2024-08-29 07:00 AM
On MacOS:
STM32CubeIDE
Version: 1.16.0
Build: 21983_20240628_1741 (UTC)
I tried your .ioc and it works fine. But then I changed the DMA channels to DMA2 (not DMA1) and I get my bug. Give it a try.
2024-08-29 08:04 AM
Thank you for your feedback @GrahamAU
A new ticket is reported to MX team. Internal ticket number is 189793
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.