cancel
Showing results for 
Search instead for 
Did you mean: 

SPI TX DMA not work after mcu power on

ExtSol
Associate II

Hi All,

I use STM32f103C8T6 mcu to control a 5" TFT (480x272) display in direct mode.

TIM1 PWM is the 9Mhz pixel clock,

TIM2 is the column counter,

TIM3 is the row counter

and TIM2 channel 2 in compare mode, start SPI DMA transmit once in line

so, the SPI TX DMA not work after power up. (see my oscilloscope and dont show a picture) but, reset the mcu or reprogram its work perfectly.

test hardware the "blue pill" :)

i use my function libraryes.

i uploaded my full project.

Any Idea?

1 ACCEPTED SOLUTION

Accepted Solutions
ExtSol
Associate II

I found the problem, i not set SSM and SSI bits in CR1.

Why setting up? I not use NSS output.

View solution in original post

2 REPLIES 2
ExtSol
Associate II

I tested the SPE bit. It is low state after power on and the led is not lighting.

now i press the reset button on the pcb and led is on, and its working.

SET_BIT(SPI1->CR1, SPI_CR1_SPE); //SPI be

 spi_is_enabled();

void spi_is_enabled()

{

 if(READ_BIT(SPI1->CR1, SPI_CR1_SPE))

 {

  SET_BIT(GPIOC->BSRR, 1 << 29);

 }

 else

 {

  SET_BIT(GPIOC->BSRR, 1 << 13);

 }

}

ExtSol
Associate II

I found the problem, i not set SSM and SSI bits in CR1.

Why setting up? I not use NSS output.