Author Topic: Help for work by ST32f103ret(i'm beginner)?  (Read 8730 times)

0 Members and 2 Guests are viewing this topic.

Offline rozehTopic starter

  • Regular Contributor
  • *
  • Posts: 130
  • Country: 00
Help for work by ST32f103ret(i'm beginner)?
« on: August 14, 2013, 05:34:39 pm »
Hi guys, :)
i bought this MCU and downloaded the standard peripheral library of this site:
STM32F10x standard peripheral library
Now, i don't know how to use of this Lib and function of the Lib. i can't find any user manual for this lib or get started documents for starting with this MCU.
Mark Twain — 'The two most important days in your life are the day you are born and the day you find out why.'
 

Offline andersm

  • Super Contributor
  • ***
  • Posts: 1198
  • Country: fi
Re: Help for work by ST32f103ret(i'm beginner)?
« Reply #1 on: August 14, 2013, 09:03:40 pm »
The user manual is right in the root directory of the archive, in CHM format. There's also lots of example projects included to get you started. The documentation for your particular chip is found on its product page, under design support.

Offline ChrisMH

  • Contributor
  • Posts: 18
  • Country: us
Help for work by ST32f103ret(i'm beginner)?
« Reply #2 on: August 15, 2013, 01:11:53 pm »
Take a look at CoIDE.  It is a free IDE and makes it quite easy to get started by providing GUI tools for incorporating the peripheral library.

www.coocox.com

 

Offline HackedFridgeMagnet

  • Super Contributor
  • ***
  • Posts: 2039
  • Country: au
Re: Help for work by ST32f103ret(i'm beginner)?
« Reply #3 on: August 15, 2013, 03:25:55 pm »
Is your MCU on a board?
The manufacturer of the board probably has example apps and IDEs that work out of the box.

I recently started on the STM32f103 and I was initially using Atollic which was really easy, but I have since moved to Eclipse and Yagarto to get around the firmware codesize constraints.
If you really dont have a devel board then get a discovery board for $12 and get used to the IDEs and Libs, it will save time to have something working at the start. There isn't a discovery board for the 103 but get one of the others. Once you get the hang of it you can port code back and forth.
I'm not sure but the 103 may be an older chip. I think the VL series might be the more up to date choice. Correct me if I am wrong.

It's a journey but well worth the effort.
as an aside: I dont find the STMicro libraries buggy nor as badly written as some people make out.
 

Offline andersm

  • Super Contributor
  • ***
  • Posts: 1198
  • Country: fi
Re: Help for work by ST32f103ret(i'm beginner)?
« Reply #4 on: August 15, 2013, 03:40:00 pm »
as an aside: I dont find the STMicro libraries buggy nor as badly written as some people make out.
The early versions were not very good and very slow as well, but I believe they've been largely rewritten since then.

Offline rozehTopic starter

  • Regular Contributor
  • *
  • Posts: 130
  • Country: 00
Re: Help for work by ST32f103ret(i'm beginner)?
« Reply #5 on: August 15, 2013, 05:47:01 pm »
@andersm
Thank you
@ChrisMH
Thank you
i use of Keil, now.
@HackedFridgeMagnet
Thank you
Yes, but my board is simple.
Mark Twain — 'The two most important days in your life are the day you are born and the day you find out why.'
 

Offline rozehTopic starter

  • Regular Contributor
  • *
  • Posts: 130
  • Country: 00
Re: Help for work by ST32f103ret(i'm beginner)?
« Reply #6 on: August 17, 2013, 09:50:35 am »
Hi again,
i have other three question:
1- What's difference between General purpose output and Alternate Function output(in other word, when should i use of GPIO and when should i use of AF output)?

2-
A) what's mean the Input Floating and the Input Pull-Down and the Output Push-Pull and the Output Open-Drain?

B) What's the usage of these and when should i use of these?

3- As you know, almost all of the ARM based MCUs haven't any eeprom for emergency situation. should i use of Backup register?

sorry for simple. i'm begginer and a non-electronic engineer.
« Last Edit: August 17, 2013, 05:45:27 pm by rozeh »
Mark Twain — 'The two most important days in your life are the day you are born and the day you find out why.'
 

Offline ChrisMH

  • Contributor
  • Posts: 18
  • Country: us
Help for work by ST32f103ret(i'm beginner)?
« Reply #7 on: August 17, 2013, 03:16:53 pm »
This is not meant as an insult, but perhaps you should pick a simpler and/or more hobby-friendly MCU to learn the basics before jumping into the STM32.  The STM32 and similar are great, but you will not typically find the level of community support you are looking for.

There are large helpful communities around Arduino and other Atmel chips, as well as some of the PIC processors.  You might start there.

Chris
 

Offline rozehTopic starter

  • Regular Contributor
  • *
  • Posts: 130
  • Country: 00
Re: Help for work by ST32f103ret(i'm beginner)?
« Reply #8 on: August 17, 2013, 05:19:04 pm »
Thank you Chris,
but i already was a AVR user. now, i want to learn this MCU.
but, some thing is new for me.
« Last Edit: August 17, 2013, 05:21:34 pm by rozeh »
Mark Twain — 'The two most important days in your life are the day you are born and the day you find out why.'
 

Offline Stonent

  • Super Contributor
  • ***
  • Posts: 3824
  • Country: us
Re: Help for work by ST32f103ret(i'm beginner)?
« Reply #9 on: August 17, 2013, 06:00:59 pm »
Just an FYI, TI has their Stellaris Launchpad ARM kit on sale now for $7.99 with free shipping.
Might be worth it to have both so you can learn some more stuff and see which one you like more.

https://estore.ti.com/Stellaris-LaunchPad.aspx

There's a community around the MSP430 but also has other products they work with. I'm reasonably sure the Stellaris Launchpad works with Energia which is a port of the Arduino IDE to TI Products.

http://forum.43oh.com/

Also this site:

http://forum.stellarisiti.com/
« Last Edit: August 17, 2013, 06:03:03 pm by Stonent »
The larger the government, the smaller the citizen.
 

alm

  • Guest
Re: Help for work by ST32f103ret(i'm beginner)?
« Reply #10 on: August 17, 2013, 06:14:04 pm »
1- What's difference between General purpose output and Alternate Function output(in other word, when should i use of GPIO and when should i use of AF output)?
Alternate function: if you want to use any of the other peripherals connected to that pin, for example USART. I.e. use use alternate function if you don't want to use it as GPIO, but for something else.

2-
A) what's mean the Input Floating and the Input Pull-Down and the Output Push-Pull and the Output Open-Drain?

B) What's the usage of these and when should i use of these?
Input pull up/down: enable internal pull up or pull down resistors, so the port gets pulled up/down if nothing is connected to it. One example would be a push button connected to ground: you connect the button from the input to ground and enable the internal pull-up. If you press the button the input is pulled low through the button, if you release the button then the pull-up pulls it high. Input floating disables both the internal pull up and down resistors. Useful if the input if the other side is push-pull, since the pull up/down resistors would just be wasting power.

Push pull means that the pin is either driven high or driven low (the driver sources or sinks current), open drain means that it will pull down the output (sink current) if set to low, but will tri-state the bus (become high impedance, no current will flow in/out) when set high. This is used in I2C, for example, where multiple drivers can pull the bus low, and the bus is pulled high through the pull-up resistor if all devices are high. This prevents multiple drivers from fighting each other.

This is all very similar to how the AVR works, by the way, except that the AVR lacks pull-down resistors.

3- As you know, almost all of the ARM based MCUs haven't any eeprom for emergency situation. should i use of Backup register?
As you can find in the datasheet, the contents of the backup registers are preserved as the STM32 goes into a low power standby mode, they will not survive if it completely loses power.

The answers to all of your questions are in this 1000 page document. Quite a bit larger than your average AVR datasheet. This introductory book may also be useful. In general terms like push-pull, open drain, and pull up/down won't be discussed in documents about the STM32 since these are general electronics terms. A general digital electronics resource or Wikipedia may be helpful for those.
« Last Edit: August 19, 2013, 05:48:59 pm by alm »
 

Offline rozehTopic starter

  • Regular Contributor
  • *
  • Posts: 130
  • Country: 00
Re: Help for work by ST32f103ret(i'm beginner)?
« Reply #11 on: August 19, 2013, 05:34:14 pm »
Great alm,
Thank you :-+
Mark Twain — 'The two most important days in your life are the day you are born and the day you find out why.'
 

Offline HackedFridgeMagnet

  • Super Contributor
  • ***
  • Posts: 2039
  • Country: au
Re: Help for work by ST32f103ret(i'm beginner)?
« Reply #12 on: August 19, 2013, 10:58:16 pm »
I am getting quite familiar with that document now, but you have to read it alongside the 100 page document specific that is more specific to the chip.
for example. Medium density:-
http://www.st.com/st-web-ui/static/active/jp/resource/technical/document/datasheet/CD00161566.pdf

Also olimex and others have made some devel boards with these chips, the schematics are worth a look.
https://www.olimex.com/Products/ARM/ST/STM32-P103/

As to the libraries, the only one I am having trouble with is the USB.

At the risk of repeating Alm, all the hardware you need to preserve the backup registers and rtc is a coin cell attached to Vbat.
 

Offline rozehTopic starter

  • Regular Contributor
  • *
  • Posts: 130
  • Country: 00
Re: Help for work by ST32f103ret(i'm beginner)?
« Reply #13 on: August 20, 2013, 04:02:52 am »
i think the backup registers can't be a good replacement instead eeprom. i think if i unplug the Vbat of MCU, the all information in the backup registers will clear. is it correct?
Mark Twain — 'The two most important days in your life are the day you are born and the day you find out why.'
 

alm

  • Guest
Re: Help for work by ST32f103ret(i'm beginner)?
« Reply #14 on: August 20, 2013, 09:44:44 am »
At the risk of repeating both myself and HFM: yes.
 

Offline rozehTopic starter

  • Regular Contributor
  • *
  • Posts: 130
  • Country: 00
Problem!
« Reply #15 on: September 10, 2013, 11:26:18 am »
Hi guys
i have a problem for download my program to ST32f103ret. i compiled my project and now i want to download it to MCU but, the keil give me this error:



the report of massage bar:



the configurations:















and this is the J-link's information:



How can i solve this problem?
Mark Twain — 'The two most important days in your life are the day you are born and the day you find out why.'
 

Offline HackedFridgeMagnet

  • Super Contributor
  • ***
  • Posts: 2039
  • Country: au
Re: Help for work by ST32f103ret(i'm beginner)?
« Reply #16 on: September 10, 2013, 11:32:35 am »
VIRUS WARNING!

Just letting people know i got a virus blocked message from this page.
it is in a link to a image from imageupload.co.uk, that I think rozeh has posted.
 

Offline rozehTopic starter

  • Regular Contributor
  • *
  • Posts: 130
  • Country: 00
Re: Help for work by ST32f103ret(i'm beginner)?
« Reply #17 on: September 10, 2013, 11:48:29 am »
VIRUS WARNING!

Just letting people know i got a virus blocked message from this page.
it is in a link to a image from imageupload.co.uk, that I think rozeh has posted.

Really?
but i have a NOD32 in my computer that i update it at each day.
also i had already saw this virus. i think this web-site has a trojan.
Mark Twain — 'The two most important days in your life are the day you are born and the day you find out why.'
 

Offline GeoffS

  • Supporter
  • ****
  • Posts: 1272
  • Country: au
Re: Help for work by ST32f103ret(i'm beginner)?
« Reply #18 on: September 10, 2013, 12:08:39 pm »
I ran all the attachments through the virus scanner under Windows 7  (AVG I think) and XP (MS antivirus) and got no indication of a virus.
If anyone can provide further details of what their virus scanner reports, it will be appreciated
« Last Edit: September 10, 2013, 12:11:30 pm by GeoffS »
 

Offline rozehTopic starter

  • Regular Contributor
  • *
  • Posts: 130
  • Country: 00
Re: Help for work by ST32f103ret(i'm beginner)?
« Reply #19 on: September 10, 2013, 12:12:57 pm »
GeoffS,
i think the imageupload.co.uk has virus, not pictures.
Mark Twain — 'The two most important days in your life are the day you are born and the day you find out why.'
 

Offline GeoffS

  • Supporter
  • ****
  • Posts: 1272
  • Country: au
Re: Help for work by ST32f103ret(i'm beginner)?
« Reply #20 on: September 10, 2013, 12:21:51 pm »
GeoffS,
i think the imageupload.co.uk has virus, not pictures.
So, do you get any indication of a virus and if so, what do you see ?
 

Offline rozehTopic starter

  • Regular Contributor
  • *
  • Posts: 130
  • Country: 00
Re: Help for work by ST32f103ret(i'm beginner)?
« Reply #21 on: September 10, 2013, 12:33:20 pm »
So, do you get any indication of a virus and if so, what do you see ?
well, when i would go to this web-site, my anti-virus(ESET NOD32) give me a message. it said to me the name of trojan but, i can't remember it, sh*t!. i don't know why some programer write these bullshit!
oh, Geoffs,
is it necessary that i upload my pictures again on another uploader?
Mark Twain — 'The two most important days in your life are the day you are born and the day you find out why.'
 

Offline HackedFridgeMagnet

  • Super Contributor
  • ***
  • Posts: 2039
  • Country: au
Re: Help for work by ST32f103ret(i'm beginner)?
« Reply #22 on: September 10, 2013, 01:01:25 pm »
thats the warning i get. on page 2 of this thread only.
 

Offline Kjelt

  • Super Contributor
  • ***
  • Posts: 6663
  • Country: nl
Re: Help for work by ST32f103ret(i'm beginner)?
« Reply #23 on: September 10, 2013, 04:53:12 pm »
As an start of the possible answer to your question, I always use Erase Full Chip option not only sectors.
Then make absolutely sure the programmer is connected correctly.
 

Offline rozehTopic starter

  • Regular Contributor
  • *
  • Posts: 130
  • Country: 00
Re: Help for work by ST32f103ret(i'm beginner)?
« Reply #24 on: September 10, 2013, 05:20:12 pm »
As an start of the possible answer to your question, I always use Erase Full Chip option not only sectors.
Then make absolutely sure the programmer is connected correctly.
Thanks for reply,
i changed it to the Erase Full Chip but, it's not work. :(
yeah, i connected it correctly. look:



Mark Twain — 'The two most important days in your life are the day you are born and the day you find out why.'
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf