SPI not working.
Posted: Mon Jun 01, 2015 8:09 am
[update: It works a bit better if you use the right AF ]
I don't understand: I used to have it working, but now it no longer works...
Anyway, when I send something over SPI using
(MYSPI is defined to SPID2 here), it does spiStartSendI(spip, n, txbuf); and then suspends. It is waiting for the DMA transfer to finish, but I never see the wakeup happening.
I'm now doing the SPI from a second thread, so that I can use my own embedded debugging code to debug things:
This is the SPI2 peripheral. The third word seems to indicate: TXE. So the SPI module is waiting for DMA to fill the TX buffer. Correct?
So examining the DMA module:
the interrupts for DMA5 are enabled.
Here everything looks good, except for the count: it is zero.
Further suggestions?
P.S. SYSCFG->CFGR1 is zero.
I don't understand: I used to have it working, but now it no longer works...
Anyway, when I send something over SPI using
Code: Select all
spiSend (&MYSPI, 1, &ch);I'm now doing the SPI from a second thread, so that I can use my own embedded debugging code to debug things:
Code: Select all
> dumpm 40003800
40003800 00000374 00001707 00000002 00000000
So examining the DMA module:
Code: Select all
> dumpm 40020000
40020000 00070000 00000000 00000000 00000000
Code: Select all
> dumpm 40020058
40020058 00001099 00000000 4000380c 20001515
Further suggestions?
P.S. SYSCFG->CFGR1 is zero.