STM32 Nucleo board - Page 1
Forum section: electronics / general

author: alank2
author_rank: Super Contributor
timestamp: June 13, 2017, 06:29:51 pm
content: I'll have to get my hands on the definitive guide.Some more questions (not necessarily related to freeRTOS, but STM32 and Atollic TrueStudio in general):Q#1 - To program the Nucleo board I have selected "debug" and it then programs it and starts it. I can then disconnect and it is programmed/will execute. My question is does True Studio have a programming dialog like I am used to seeing in AVR studio? Where you can choose an ELF file and tell it to program the IC? Or erase it, etc? If not, is there another tool with this functionality for STLINK?Q#2 - Does the STM32 have fuses like I am familiar with on AVR's?Q#3 - I created a new project for the STMF103 board. It created quite a few files such as startup_stm32f10x_md.s, stm32f10x_conf.h, stm32f1xx_it, system_stm32f10x.c. Are these all necessary for a new nearly empty project that blinks a few leds?Q#4 - Where is the main source of documentation for peripheral libraries that are available? Are there different libraries avaiable?Q#5 - I noticed in one of the Nucleo boards that it talks about a SWD header that is 6x1 100 mil header. I think it mentioned that that could be used to program the STM32 used for programming, but I could be wrong. I've seen 20 pin headers, 10 pin headers, and now this 6 pin header. Why so many? Can you program with the 6, but not debug? Do you need the 10/20 for debugging?Q#6 - Do ARM's have a built in clock? Is it better than AVR clocks - can it be used for reliable UART? Is it a PLL that locks on to a slower speed clock? I noticed that ARM at Digikey have different clock speeds specified and I'm assuming that is their highest speed. Can you run them at slower speeds if you don't need the performance? Does it have built in prescalers to select a slower speed?

author: mrm2007
author_rank: Contributor
timestamp: June 13, 2017, 07:27:41 pm
content: Hi,Just to answer some your questions briefly :1) i'm not familiar with Atollic, but there is STLINK utility from ST, you can use it to program ST ARM MCUs.2) Instead of fuses, they have Option Bytes. Check the datasheet & Ref. Manual.3) usually yes. They have different roles. One is for register definitions, another one is for startup routines,.. Etc, but you can setup a project without using them , but it's more time consuming IMO.4) yes, there are different Peripheral Libs both from ST and also 3rd parties.For example for F103 chip, st has STD Peripheral Lib, and HAL. You can download the lib packages zip file from St.com. In the package there is a chm help file which has all the documentation. Beaware this file is a doxygen created document, which means that if you open c or h files in the lib package you can see the comments which doxygen used to create that chm help file. BTW, usually in any IDE, you can use Find implementation & find definition to goto respective c or h file.5) if you open the special jumpers on your nucleo board ( on my nucleo is CN2) you can use the swd connector (on my nucleo is CN4) to program and debug ST chips via swd interface. Those 20 pin connector are for compatibility reason with jtag connector( if I remember correctly) and only use a few pins. This goes for 10 pins too( i also see a 8 pin connector)Check your Nucleo user manual and schematics.6) usually yes. They have at least one 8MHz or 16MHz internal clock, if not more. Depends on chip. You have to check the chip datasheet. As for reliable UART, you have to check the datasheet again.(my own experience with stm32l151 was ok).Those clocks you see at Digikey, are maximum values. Usually each chip has an internal PLL, which you can use to configure the clock. You can use the chip at lower clock. For example for a project, i used STM32L151 @ 2.1MHz (if I remember correctly), this chip maximum clock is 32MHz, i could lower the clock more, for example using it's internal 40KHz clock.Sent from my E2333 using Tapatalk

author: Gustav
author_rank: Newbie
timestamp: June 13, 2017, 07:48:48 pm
content: 1. I don't know if true studio contains any programming interface bu u can download the ST link utility that you can program chips through.http://www.st.com/en/embedded-software/stsw-link004.html2. No normally everything is configured through registers by the user code.3. It is only the startup file that is needed to initialize the system(it probably uses defines form the other files) but you want all the other files to give you proper names for the registers and make configuration easier.4. I generally don't use vendor libraries so i can't help you here.5. I think the header you are talking about is to use the ST link on the nucleo to program chips on other boards. as for programming headers every manufacture seems to have their own standard and then ARM have a couple of different recommended connectors. for the one you have mentioned the ST SWD connector is STs own and only supports SWD, the 10 pin i am guessing is ARM 10 pin cortex connector that supports SWD and JTAG and the 20 pin is ARM 20 pin cortex connector that supports SWD, JTAG and trace. remember the ARM connectors are 0.05 inch pin pitch.6. This is chip dependent but generally they have both a low speed and high speed internal RC oscillator and the precision of these varies from chip to chip. most ARMs also includes a PLL as the clock speeds they can run are not really practical to run a crystal at.Yes the speed listed at digikey is the max speed it is rated for and you can normally run them as slow as you want but make sure to check the datasheet if you want to run some absurd low clock speed, as to generate lower clock speeds it is again chip dependent how this is implemented so check the datasheet, also if you want to do low power design ARM systems are normally optimized for a sprint and sleep tactic where the MCU spends most of its time in a sleep state.(damm to late)

author: alank2
author_rank: Super Contributor
timestamp: June 14, 2017, 12:23:35 am
content: I appreciate you both posting!!!I found the ST-LINK tool and it works pretty well.I've got two nucleo boards STM32F103 and STM32F429.Q#7 - The F103 oddly only has the options "disabled" and "enabled" for read out protection. Does this mean it does not have Level 2?Q#8 - On the F429 is has Level 1 and Level 2 - I believe Level 2 is permanent, but Level 1 can be undone, right?Q#9 - I would think the peripheral library are functions to help use peripherals. What does a HAL do? provide a set of functions that work similarly across different hardware/STM32's ?Q#10 - With AVR's there is an AVR042 which is like a best practices document covering how to deploy a microcontroller on its own board. It details a reset circuit, which pins are required for programming, etc. Does ST have something similar for STM32?Q#11 - In my efforts to answer Q#7, I downloaded RM0008 manual, but I couldn't find anything about why there is no level 2 read out protection, or anything on it. I even searched for what I saw was the register name for it, but didn't find anything. Is there another more generic manual that also covers this microcontroller? I think the xmega avrs have a family datasheet and a uc specific datasheet, something like that?Q#12 - Is there a forum specific to STM32's or ARM's that I should be searching before asking all these questions!!!

author: westfw
author_rank: Super Contributor
timestamp: June 14, 2017, 01:02:15 am
content: Quotehttps://community.st.com/community/stm32-communityhttps://community.arm.com/LinkedIn, Element14, Yahoo and Google presumably have groups as well. There's an STMArduino group.YMMV; vendors seem somewhat worse at running/organizing forums than they are at writing code libraries :-(For example, that "stm-community" apparently has a single combined forum for ALL of the STM32F processors.If you were hoping for something with the quality of AVRFreaks, you probably won't find it. :-(BTW, getting back to the original question "does FreeRTOS use interrupts?":An RTOS will typically use a small number of interrupts for its internal timer (Systick) and preemption, and maybe "Syscall" type "interrupts" for system calls. The various other peripherals are more likely to be organized as "drivers" that interface to the RTOS, and can use interrupts (or not) as they see fit. Some drivers may be included in the support for a particular chip. A good RTOS provides for easy and flexible addition of drivers, and a driver would usually interface to services provided by the RTOS.For example, a UART peripheral driver would service UART hardware and put/get bytes from an RTOS FIFO, or it could run a state machine in the ISR, decode SLIP packets, and put them on an RTOS QUEUE when reception was complete.

author: Jeroen3
author_rank: Super Contributor
timestamp: June 14, 2017, 05:50:22 am
content: Quote from: alank2 on June 14, 2017, 12:23:35 am7) The F103 is an older variant and not as complicated and refined as newer st chips. It has read protections enabled or disabled.8 ) Level 2 is permanent. It also disables debug.9) HAL is anattemptat creating a uniform peripheral api over all st chips. It works, mostly. It can be used, or only as reference material. It does provide some helpful marco's though. There are several topics about the HAL, and how it is awful or fantastic on this forum. Let's not10) ST has tons of application notes and documents. The minimum documents youmust storein your project repository are:- Datasheet: this covers everything you need to know electrically. GPIO, Specs, dimensions.- Reference manual: this covers everything inside, except the flash and the core.- Flash programming manual: how to write to flash.- Programming manual: about the arm core.- Errata: known problems with the chip.Read this before board design.- ARM Technical Reference Manual. Detailed manual about the arm core and instructions. (find ithere)- AN3364: Migration and compatibility guidelines for STM32 microcontroller applications.11) See 10, hint:Flash programming manual.12) Yes.https://community.st.com/community/stm32-community/stm32-forum

author: newbrain
author_rank: Super Contributor
timestamp: June 14, 2017, 08:24:56 am
content: Quote from: alank2 on June 13, 2017, 06:29:51 pmI think you got very good answers to these and the other questions, I will just add some minor point.Q1: TrueStudio is Eclipse based, so it's not very user friendly (IMVHO). There are dialogues to define the "Run" configurations, essentially similar to the one for debug, where you can create your own action that will then show in the Run menu. Or you can define an external tool...all in all, using the ST-Link util to program a binary of your choice is easier.Q5: The header can be used to program other boards, once you remove the jumpers on the 4 pin one. If you want to program the ST-link MCU, it's possible, look for the right solder bridges under the board (been there, done that).

author: Sal Ammoniac
author_rank: Super Contributor
timestamp: June 14, 2017, 09:37:58 pm
content: Quote from: tggzzz on June 06, 2017, 07:54:31 amThe Parallax Propeller also doesn't use interrupts, but relies on polling as entire cores (there are eight total) are dedicated to I/O operations. There's no FreeRTOS support, however.

author: TinkeringSteve
author_rank: Frequent Contributor
timestamp: June 15, 2017, 09:21:03 am
content: QuoteThis needed more emphasis ;-)Perhaps something likelibopencm3is more mature. 3rd party, probably some open source license that's nasty for commercial dev (but check that, I haven't).Or ChibiOS.From the perspective of using HAL on one of the ST nucleo bords, the HAL is similar to the "std periph" lib. The latter being older and phased out.But HAL is a lot more convoluted, infamously called "ST's summer intern project" in some places (for the code quality and detectable level of coding experience / wisdom of the author(s)).It sometimes can get you started trying something out quicker than doing things only with CMSIS (setting all register bits yourself).But it also can take extra time to work around the "interesting" ways it works...It more or less "imposes" a somewhat braindead structure onto your project, too, if you use the examples or CubeMX generated code anyway.I use it solely to quickly get a project running with a devboard and some new component I want to try out.And that's only because I haven't used libopencm3 so far, but it's high up on the TODO list. It looked good from some glimpses I had. Lean and functional, no funny stuff, *and* seems to achieve what HAL was aiming at: the same library spanning across several ARM Cortex M (not just ST ones, btw).

author: Jeroen3
author_rank: Super Contributor
timestamp: June 15, 2017, 09:23:37 am
content: Quote from: Jeroen3 on June 14, 2017, 05:50:22 amhttps://www.eevblog.com/forum/microcontrollers/st's-(stm32cube)-software-ecosystem-is-terrible-how-can-we-fix-it/

author: TinkeringSteve
author_rank: Frequent Contributor
timestamp: June 15, 2017, 10:11:44 am
content: Quote from: Jeroen3 on June 14, 2017, 05:50:22 amAre you sure it's dead? I thought I clearly saw it twitch!Seriously, though. The OP wanted some answers. Perhaps pointing to a kilometer long thread is one. If reading for hours is not what he likes, I at least mentioned a 3rd party alternative to HAL which actually does have a generally good reputation

author: Jeroen3
author_rank: Super Contributor
timestamp: June 15, 2017, 11:34:01 am
content: Yes, but then someone else from that topic comes around the corner and recommends yet another third party hal. Aaaand we're copying the kilometer long thread.

author: alank2
author_rank: Super Contributor
timestamp: June 15, 2017, 12:04:55 pm
content: I appreciate the excellent replies everyone!

author: stj
author_rank: Super Contributor
timestamp: June 15, 2017, 02:16:47 pm
content: if you only want to program a chip, st-link2.1 (the one on nucleo boards) emulates a usb memory stick.you just drag or past the file into it on your desktop and it programs the chip.