cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F407ZGT7 reset when write to SPI1 DR

Wangxiaojun
Associate

When i debug SPI1 on STM32F407, program will jump to 0x00 when write DR register, MCU reset and loop continuely. when i measure the SCLK signal using oscillator, SCLK is always high after SPI1 is enabled  

  1. When i write to DR of SPI1, the code jump to main
  2. I check the SCLK keep high after SPI1 enabled

I searched on the net, and this is suggest that SPI1 SCLK shared same pin with JTAG-TDO, Jtag should be disabled, but for 407, there is no the JTAG disable instruction in HAL. 

Is there anyone can help me on this or give me some hints? Thanks 

1 ACCEPTED SOLUTION

Accepted Solutions
AScha.3
Chief

Why dont you use PA5 for SPI1 sck ? Then no conflict with JTAG/debug .

+

You have to set debug/trace in Cube, then the associated pins are used for this; 

and you cannot use them at same time for debug...logically.

+

There is only a clk on SPI , when transmitting data. (So 16 clks , when sending 16 bits, otherwise line is "quiet".)

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

1 REPLY 1
AScha.3
Chief

Why dont you use PA5 for SPI1 sck ? Then no conflict with JTAG/debug .

+

You have to set debug/trace in Cube, then the associated pins are used for this; 

and you cannot use them at same time for debug...logically.

+

There is only a clk on SPI , when transmitting data. (So 16 clks , when sending 16 bits, otherwise line is "quiet".)

If you feel a post has answered your question, please click "Accept as Solution".