Skip to main content
arunmadhavraj
Associate
April 16, 2015
Question

STM8S003F3U programming

  • April 16, 2015
  • 3 replies
  • 1758 views
Posted on April 16, 2015 at 14:04

I'm totally new to STM8 microcontroller series. I'm planning to do a project using STM8S003F3U controller in which ADC and timer module will be used. 

It would be useful if i could find some sample codes for ADC,timers,etc. Is there any sample codes available?

I have already downloaded the ST toolset which includes ST visual develop and ST visual programmer. I'm using cosmic c compiler. ST link/V2 emulator is used for debugging purpose. Am i going in the right track? Any help(even from the basics) would be appreciated....

#stm8s003f3 #stm8 #st-visual-develop
    This topic has been closed for replies.

    3 replies

    Ian Legg
    Visitor II
    April 23, 2015
    Posted on April 23, 2015 at 12:42

    Hello,

    Download the STM8S standard peripheral library from the list (and any others you think might be relevant).

    http://www.st.com/stonline/stappl/productcatalog/app?page=partNumberSearchPage&levelid=SS1010&parentid=1754&resourcetype=SW

    The standard peripheral library gives some examples for each STM8 peripheral using ST's API's. Of course there is no reason why you wouldn't prefer to use direct register accesses, which brings you closer to the hardware and reading the register descriptions is a good start to knowing what one wants to set them to :)

    Hope that helps.

    Thanks,

    Ian

    arunmadhavraj
    Associate
    April 30, 2015
    Posted on April 30, 2015 at 08:11

    Hi Ian,

    Thanks for your reply. 

    Im using IAR instead of stvd. I could create my sample project and successfully debugged it. It was working fine for few days. But today debug session terminated in the middle of debugging(an error shown saying location cant be accessed). After that, an error is shown whenever i try to download the code. The shown error is ''Failed to set configuration with MCU name STM8S003F3: SWIM error[30004]: comm timeout''

    Whats the solution to correct it?

    Thanks...

    Ian Legg
    Visitor II
    May 1, 2015
    Posted on May 01, 2015 at 12:20

    Hello,

    I'm not familiar with IAR but is the error coming from IAR or the ST/Link driver etc? Do you have another STM8 of the same or different type that works fine? I've never seen this message but I'm wondering if the flash has become locked/secured!?!? Can you get any access to the chip? Can you erase the chip etc?

    Thanks,

    Ian