cancel
Showing results for 
Search instead for 
Did you mean: 

DMA1 CCR register is NOT updated (NOT Written)

Micha Valach
Associate III

Hello and Happy New Year 2022,

I'm using STM32L072,

I set SPI1 to be in "Transmit Only Master" mode, and DMA1 as SPI1_TX (DMA1 Channel 3)

I use CubeMX to Auto generate my code

The relevant SPI1+DMA1 line is:

HAL_SPI_Transmit_DMA(&hspi1, (uint8_t *)aBuffer, TX_BUFFER_SIZE);

While checking whats wrong, I realized that during HAL_DMA_Init() routine, the DMA Channel CR register is not updated

as you can see in the attached snapshot:

tmp = 0x2090 and in hal_dma.c line#183 there is an assignment to CR register:

hdma->Instance->CCR = tmp;

you can see that after execution of line #183 The hdma->Instance->CCR remain 0x00 !!!

Any Idea what might cause this phenomena ?

BTW - later on in my code if I manually add the line:

*(volatile uint32_t *)0x40020030 = 0x00002090; // write to DMA1_CCR3

All work fine !!

Thanks In Advance,

Micha

2 REPLIES 2
Micha Valach
Associate III

Hey Jan

Thank you very much !

I follow your attached link and able to fixed the problem 🙂

Wish You a Happy New Year 🙂

Best Regards,

Micha