Skip to main content
Graduate II
January 10, 2024
Solved

STM32MP135 - BAREMETAL - UART - DMA

  • January 10, 2024
  • 1 reply
  • 2939 views

Hello,

 

I am currently using bare-metal MP13 solution in CubeIDE. I want to integrate uart with DMA. After configuring DMA settings for uart4, a following fragment of DMA init code has been generated:

jschneider_1-1704878867812.png

NVIC is not available for Cortex-A, but still its functions are being generated. 

My question is, how can I properly adjust MX_DMA_Init for uart interrupts without NVIC and code generation?

Do you have any ideas?

 

Thank you,

Jacek S.

 

    This topic has been closed for replies.
    Best answer by jschneider

    Hi @Erwan SZYMANSKI 

    Code genereted from IOC will be definitely incorrect, so I wouldn't trust it.

    I'm attaching my main.c with most of the necessary changes to make dma-uart work.

    1 reply

    Graduate II
    January 11, 2024

    For anyone encountering the same problem here is the solution:

     

    Enable ETZPC and add init function to the main (It won't be generated)

    Make sure DMA Init runs before UART Init.

    jschneider_0-1704986376941.png

    If your compiler doesn't see an assert in a scope, comment it out

    jschneider_1-1704986619914.png

    Adjust MX_ETZPC_Init:

    jschneider_2-1704986671339.png

    In the end, correct generated MX_DMA_Init accordingly to your own settings.

    jschneider_4-1704986787489.png

     

    Best,

     

    Technical Moderator
    January 11, 2024

    Hello @jschneider ,
    First, thank you for having shared your solution on the forum, it can help a lot other users.

    Can you share us your IOC file in order to replicate on our side, and correct possible issues ? 

    Kind regards,
    Erwan.

    jschneiderAuthorAnswer
    Graduate II
    January 12, 2024

    Hi @Erwan SZYMANSKI 

    Code genereted from IOC will be definitely incorrect, so I wouldn't trust it.

    I'm attaching my main.c with most of the necessary changes to make dma-uart work.