cancel
Showing results for 
Search instead for 
Did you mean: 

SPI slave with DMA

juan
Associate II
Posted on May 06, 2013 at 16:42

The original post was too long to process during our migration. Please click on the attachment to read the original post.
6 REPLIES 6
Posted on May 06, 2013 at 17:24

Might want to check how you've got the JTAG remapped.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
juan
Associate II
Posted on May 06, 2013 at 17:27

Hi clive1,

Thanks for your response. Actually I have not remapped the JTAG. I am using a SMT32VLDiscovery board for debugging, so the SWD link. Do I need to reamp the JTAG in any case?

Thanks again,

Juan

Posted on May 06, 2013 at 18:45

The fact the VLDiscovery uses SWD has very little to do with the configuration of the chip itself.

I'd disable the non-SWD portion, per RM0008 ''Flexible SWJ-DP pin assignment''

GPIO_PinRemapConfig(GPIO_Remap_SWJ_JTAGDisable, ENABLE);

This may, or may not, be your issue here.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
juan
Associate II
Posted on May 07, 2013 at 17:37

Hello, and thanks again.

I know the debugger I am using does not affect the way the chp is configured, but I thought that remapping the SPI would directly assign it ''over'' the other possible functions, like the JTAG, but this does not occur.

So, I have remapped the JTAG, and checking with the scope I can see the master transmits properly the information. I have also made the transmissions easier, with just one word of 16bits, so the slave only performs the receiving part without DMA. I noticed on the forums there were some issues with the hardware NSS, so I changed it to software management:

    When the slave is selected (NSS is used as input GPIO), an interrupt is triggered and the software NSS is enabled. This part works good.

    The problem is that, even though the data and the clock come properly in the right pins, the slave does not get the data, so the RXNE flag is never set. I think it is possible that I am still missing something in the initiazlization and configuration of the SPI.

Thanks again, and best regards,

Juan

juan
Associate II
Posted on May 10, 2013 at 09:10

Hello,

I found my problem. I was setting the GPIO configuration to the pins on the SPI, and remapping the SPI later. Apparently, it has to be done in the opposite order, i.e. remapping the peripheral first and setting the GPIO configuration afterwards.

I have not found ST documentation/information explicitly mentioning this, so I think it can be useful for more people.

Have a nice day!!

kj_shocker
Associate
Posted on May 24, 2013 at 12:51

Hey Juan,

Could you please share the modifications you made to the program. I am working on a STM32F4 discovery and i cannot make the slave to respond to the chip select. It responds every time the clock is active.

Thank you,

Horatiu