cancel
Showing results for 
Search instead for 
Did you mean: 

Issues with Getting started with the STM32L152D-EVAL

spveer
Associate II
Posted on October 13, 2014 at 06:12

Dear all,

I started to work on a STM32L152D-EVAL board.

While I started to play around, I tried the demonstration firmware from the following link:

http://www.st.com/web/en/catalog/tools/PF257910

I am using the IAR Compiler with I-Jet debugger.

I am able to flash the board with new firmware, however nothing is showing up on the lcd, neither something happens when i press the joy stick as demonstrated.

I thought the demonstration firmware should run out of the box. Am I missing something here?

 

In particular I need examples related to the SPI interface for this board. Can someone please point me to the right samples for SPI on this board, which may work out of the box, so that I can then further customize the samples based on my needs?

Thanks a lot.

Regards,

Pradeep

#stm32l152d-eval-demonstratio-spi
14 REPLIES 14
Posted on October 15, 2014 at 14:22

As I indicated I don't have this board, so I'm only doing limited analysis.

The Master SPI should not be dependent on any Slave attachment. You might want to focus on the chip select mechanism, and if that is blocking clocks/signals.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
spveer
Associate II
Posted on October 15, 2014 at 16:38

Hi Clive,

After some analysis, I can say that chip select is not blocking signals.

Further I can see that when I write data into SPIx->DR, the TXE flag of the SPIx-SR register is set, but this continues to be set.

This is obvious as I cannot see any toggling on the SPI_CLK pin.

I still do not understand why I am not able to get any SPI_CLK, even after writing data to the SPIx->DR register.

I will be grateful if you can particularly look at my SPI_CLK configuration in the above code. Seems all my issues will be solved as soon as I get the SPI_CLK functional.

Thanks a lot!

Posted on October 15, 2014 at 17:13

After some analysis, I can say that chip select is not blocking signals. 

Yeah, I'm not so sure, I think you need to decide if it's a GPIO or AF pin, and then how it's state is handled by the peripheral.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
spveer
Associate II
Posted on October 16, 2014 at 13:10

Hallo Clive,

By setting the

GPIO_InitStructure.GPIO_Mode of the NSS to GPIO_Mode_Out

and not as AF Pin, I could get the Chip Select signal on scope and then I could also see SCLK , MOSI. Thanks for your feedback.

However according to datasheet, SP1_NSS is available as Alternate function on the PA4. See below. Or is my understanding wrong about the table below:

0690X00000605YrQAI.png

Regards.

Posted on October 16, 2014 at 19:22

By setting the GPIO_InitStructure.GPIO_Mode of the NSS to GPIO_Mode_Out and not as AF Pin, I could get the Chip Select signal on scope and then I could also see SCLK , MOSI. Thanks for your feedback.

 

 

However according to datasheet, SP1_NSS is available as Alternate function on the PA4. See below. Or is my understanding wrong about the table below:

 

The misunderstanding probably relates to the SPI peripherals configuration with respect to SPI_InitStructure.SPI_NSS, ie hard, soft, mushy, etc. and what than means related to GPIO/AF

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..