cancel
Showing results for 
Search instead for 
Did you mean: 

Hanging of STM8s

hardip
Associate II
Posted on January 08, 2015 at 06:15

Hi...

I am using STM8S family controller.

I am also using SPI Bus to communicate with Peripheral.(As per my requirement SPI need to run properly.)  

During Run time, initially STM8S work properly but after some time it will hang...

I check this pin of STM8S...

SPI CLOCK = STOP (no clock)

Any one face this type of problem of Hang in past, then please help me.....

What is reason behind this type of issue of ''Hanging of STM8'' ?

How to solve this problem ?

Thanks & Regards,

Hardip Limbasiya

4 REPLIES 4
Ian Legg
Senior
Posted on January 08, 2015 at 10:12

Hi Hardip,

I presume the SPI communication is to run indefinitely and is only one way? Is the peripheral working as expected?

When you say the SPI hangs does that mean the STM8 has reset or still doing something?

Ian

hardip
Associate II
Posted on January 08, 2015 at 11:29

Hi Ian,

In SPI Bus, I am sending & receiving 10 bytes Packet. 

SPI Use => Two Way (At a time only one way(send/receive) using interrupt).

SPI clock => No signal

But when I configured clock to CLK_CCO pin in MCU. it will show clock is running.

then why SPI clock is not working ?

Initially proper working then it will hang.

Externally(wires) When I connect Reset to GND ==> ( Reset = LOW) , 

When I

dis

connect Reset to GND ==> ( Reset =

HIGH

) , 

It will not reset circuit. SPI Clock still not working.

After Power reset...initially work then again  hang.  

Thanks

Hardip

Ian Legg
Senior
Posted on January 08, 2015 at 11:47

Hi Hardip,

Thanks for the information.

The effect of the reset pin will depend on if you have it configured as an I/O or reset pin and then what happens by a reset of this nature compared to a power on reset.

The CLK_CCO pin will output the chosen clock but it won't indicate what the mcu is doing, just that the clock is running ok.

I suspect you need some extra debugging in your SPI code either via the debugger or perhaps via RS232 output. Maybe you need to output/view the current byte/packet sent/received or use an incrementing variable in your SPI code to count the packets etc. etc.

Hope this helps.

Ian

hardip
Associate II
Posted on January 09, 2015 at 07:44

Hi Ian,

Thanks for the quick help.

I am trying with few more debugging steps and let you know.

Thanks,

Hardip