cancel
Showing results for 
Search instead for 
Did you mean: 

STM8S105C6T6 Discovery (MB867A), cannot boot from flash on power on

sudhirkedilaya
Associate II
Posted on February 24, 2014 at 18:00

Hi!

I have been working with this discovery board for several weeks now and almost close to finalizing my design for a first prototype. But I always need to manually reset the MCU for my code to run from flash, I give 5V directly to Pin 2 of JP1. I ignored this problem all this while thinking it may be OK after I remove the SB1 and SB2. But then today I see that even with those removed, the MCU does not boot and I need to reset manually by shorting pins 3 and 4 of CN7. Also, as per STM8 manual only a 0.1uF is required externally as this MCU has internal POR and pull-up. But the discovery board has a 10nF only, I tried changing this to 0.1uF, still no use. Anyone faced such issue, please help. I fear the internal POR is not working well.

Thanks & Regards

#spi:use-spi_nss_soft-if-nss-open #discovery-can't-boot #por-issue
2 REPLIES 2
sudhirkedilaya
Associate II
Posted on February 25, 2014 at 07:42

Hi

            I found that the MCU is actually booting with the standard discovery schematics, because my PIO interrupts are still working. But seems some of the peripherals (on chip or on board) are hung up and causing main() to hang. I am suspecting the UART block, bcos I cannot receive any data in this condition.

Sudhir

sudhirkedilaya
Associate II
Posted on February 25, 2014 at 11:16

Hi

I figured out it was SPI giving me trouble. The MODF error was occurring which causes SPI to go into slave mode and to disable the SPI block. Just changed SPI init params fromSPI_NSS_HARD toSPI_NSS_SOFT and it does not happen anymore and boot from flash works fine.Attached note from the STM8 reference manual helped me figure it out.

Still don't know why this problem only happens on power-on-reset and not when I used manual reset.

Sudhir

________________

Attachments :

MODF_NSS_Pin.png : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HzNf&d=%2Fa%2F0X0000000bKm%2FS._HjTWkpp9mENfshE0x1qSziJx.ZBD9iOStvjl4Sgg&asPdf=false