Help for work by ST32f103ret(i'm beginner)? - Page 1
Forum section: electronics / general

author: rozeh
author_rank: Regular Contributor
timestamp: August 14, 2013, 05:34:39 pm
content: Hi guys,i bought this MCU and downloaded the standard peripheral library of this site:STM32F10x standard peripheral libraryNow, 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.

author: andersm
author_rank: Super Contributor
timestamp: August 14, 2013, 09:03:40 pm
content: 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.

author: ChrisMH
author_rank: Contributor
timestamp: August 15, 2013, 01:11:53 pm
content: 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

author: HackedFridgeMagnet
author_rank: Super Contributor
timestamp: August 15, 2013, 03:25:55 pm
content: 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.

author: andersm
author_rank: Super Contributor
timestamp: August 15, 2013, 03:40:00 pm
content: Quote from: HackedFridgeMagnet on August 15, 2013, 03:25:55 pmThe early versions were not very good and very slow as well, but I believe they've been largely rewritten since then.

author: rozeh
author_rank: Regular Contributor
timestamp: August 15, 2013, 05:47:01 pm
content: @andersmThank you@ChrisMHThank youi use of Keil, now.@HackedFridgeMagnetThank youYes, but my board is simple.

author: rozeh
author_rank: Regular Contributor
timestamp: August 17, 2013, 09:50:35 am
content: Hi again,i have other three question:1- What's difference betweenGeneral purpose outputandAlternate 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 ofBackup register?sorry for simple. i'm begginer and a non-electronic engineer.

author: ChrisMH
author_rank: Contributor
timestamp: August 17, 2013, 03:16:53 pm
content: 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

author: rozeh
author_rank: Regular Contributor
timestamp: August 17, 2013, 05:19:04 pm
content: Thank you Chris,but i already was a AVR user. now, i want to learn this MCU.but, some thing is new for me.

author: Stonent
author_rank: Super Contributor
timestamp: August 17, 2013, 06:00:59 pm
content: 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.aspxThere'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/

author: Unknown
author_rank: Unknown
timestamp: August 17, 2013, 06:14:04 pm
content: Quote from: rozeh on August 17, 2013, 09:50:35 amAlternate 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.Quote from: rozeh on August 17, 2013, 09:50:35 amInput 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.Quote from: rozeh on August 17, 2013, 09:50:35 amAs 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 inthis 1000 page document. Quite a bit larger than your average AVR datasheet.This introductory bookmay 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.

author: rozeh
author_rank: Regular Contributor
timestamp: August 19, 2013, 05:34:14 pm
content: Great alm,Thank you

author: HackedFridgeMagnet
author_rank: Super Contributor
timestamp: August 19, 2013, 10:58:16 pm
content: 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.pdfAlso 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.

author: rozeh
author_rank: Regular Contributor
timestamp: August 20, 2013, 04:02:52 am
content: 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?

author: Unknown
author_rank: Unknown
timestamp: August 20, 2013, 09:44:44 am
content: At the risk of repeating both myself and HFM: yes.

author: rozeh
author_rank: Regular Contributor
timestamp: September 10, 2013, 11:26:18 am
content: Hi guysi 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?

author: HackedFridgeMagnet
author_rank: Super Contributor
timestamp: September 10, 2013, 11:32:35 am
content: 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.

author: rozeh
author_rank: Regular Contributor
timestamp: September 10, 2013, 11:48:29 am
content: Quote from: HackedFridgeMagnet on September 10, 2013, 11:32:35 amReally?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.

author: GeoffS
author_rank: Unknown
timestamp: September 10, 2013, 12:08:39 pm
content: 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

author: rozeh
author_rank: Regular Contributor
timestamp: September 10, 2013, 12:12:57 pm
content: GeoffS,i think the imageupload.co.uk has virus, not pictures.

author: GeoffS
author_rank: Unknown
timestamp: September 10, 2013, 12:21:51 pm
content: Quote from: rozeh on September 10, 2013, 12:12:57 pmSo, do you get any indication of a virus and if so, what do you see ?

author: rozeh
author_rank: Regular Contributor
timestamp: September 10, 2013, 12:33:20 pm
content: Quote from: GeoffS on September 10, 2013, 12:21:51 pmwell, 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?

author: HackedFridgeMagnet
author_rank: Super Contributor
timestamp: September 10, 2013, 01:01:25 pm
content: thats the warning i get. on page 2 of this thread only.

author: Kjelt
author_rank: Super Contributor
timestamp: September 10, 2013, 04:53:12 pm
content: 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.

author: rozeh
author_rank: Regular Contributor
timestamp: September 10, 2013, 05:20:12 pm
content: Quote from: Kjelt on September 10, 2013, 04:53:12 pmThanks for reply,i changed it to the Erase Full Chip but, it's not work.yeah, i connected it correctly. look:

author: Kjelt
author_rank: Super Contributor
timestamp: September 10, 2013, 06:56:30 pm
content: I myself have no experience with this J-link device or the 103, only with the STlink2 and Ulink2 devices and LPC1769.Your settings seem to look ok. Last guess is disabling all breakpoints. But the screenshots suggest that the programming goes wrong. I only have this sometimes when the target micro is running code and my solution is to hard reset it (hardware reset) just before programming.

author: rozeh
author_rank: Regular Contributor
timestamp: September 11, 2013, 12:13:59 pm
content: interesting!i can to erase my MCU but can't to download my program!, i use SW(not J-TAG, i changed to SW) for download and erase. in your opinion, what's mean this warning?

author: Kjelt
author_rank: Super Contributor
timestamp: September 11, 2013, 02:11:29 pm
content: I always use JTAG.If you can't download your program this could have multiple reasons but most should be fine since you selected the right CPU as target.What could go wrong otherwise is wrong address offset for the data/program, for instance if your ROM starts at @8000000 and you set this wrong at for instance @7900000 then you could get this error but in this case it looks OK. So the only thing I can think of at the moment is that the CPU won't go into reset so the handshake to reset the CPU in download mode and program it get's disturbed or doesn't work as should. What the exact cause is, I can't tell you unfortunately but I suspect it is the reset.So try some of the other options under Debug Target Driver Setup and the box Reset, which now is in "normal". Otherwise check the reset pin with a scope to see if it goes low/high.

author: rozeh
author_rank: Regular Contributor
timestamp: September 11, 2013, 04:57:56 pm
content: Oh! Geart dear Kjelt!Thanks, my problem solved!

author: Kjelt
author_rank: Super Contributor
timestamp: September 11, 2013, 05:32:47 pm
content: It works? Terrific, what was the final solution?

author: rozeh
author_rank: Regular Contributor
timestamp: September 11, 2013, 05:41:24 pm
content: Quote from: Kjelt on September 11, 2013, 05:32:47 pmi was wrong!i had not installed the SEGGER(a program for use J-Link). it was my problem.

author: Kjelt
author_rank: Super Contributor
timestamp: September 11, 2013, 05:45:25 pm
content: Anyway glad that it works, good luck!