0
\$\begingroup\$

Well I am starting a course on embedded systems on udemy and it seems I need an M3 or M4 ARM cortex MCU so I can follow on the projects. The course itself recommend the Discovery board, but I was aiming for the stm32f103c8t6 Datasheet

It seems that there's no much information about the board in terms of programming on the stm32 IDE as everyone is using it with the Arduino IDE .

I was wondering If I will need additional hardware beside it like an st link v2 ( which I don't know it's purpose yet ,but that's what I got after some searching ). in order to be able to program and debug nicely along the course

The first part of the course is in the following link in case someone needed more details The Course

\$\endgroup\$
20
  • \$\begingroup\$ Which 'stm32f103c8t6' board are you looking at? \$\endgroup\$ Commented Jan 11, 2021 at 0:15
  • 3
    \$\begingroup\$ I think you will find that debugging with the STlink is vastly better than just using the Arduino IDE. You should get the board that is recommended for the course. \$\endgroup\$ Commented Jan 11, 2021 at 0:25
  • 1
    \$\begingroup\$ you do not need any additional hardware to program the board ... it is programmed through the USB port ... i do not know what you need for debugging \$\endgroup\$
    – jsotola
    Commented Jan 11, 2021 at 2:12
  • 1
    \$\begingroup\$ @jsotola that's only enabled by a 3rd party bootloader. Many of the later STM32's with USB have support for it in the ROM bootloader, but the 'F103 is an early one, and does not. \$\endgroup\$ Commented Jan 11, 2021 at 5:25
  • 2
    \$\begingroup\$ It's quite unlikely that you can use "any" M3 or M4 MCU for the course unless you have a very high degree of experience; in reality the core matters very little, 90% of the effort goes into dealing with peripherals and they can be extremely different even within a vendor's offerings. The M3 STM32F100's for example have quite a bit different peripherals schemes than most of ST's newer chips. \$\endgroup\$ Commented Jan 11, 2021 at 5:26

2 Answers 2

3
\$\begingroup\$

why does the Stm32f103c8t6 Board need an ST-Link V2?

You do not "need" it but you "need" a way to write your program to the flash on the part.

Well I am starting a course on embedded systems on udemy and it seems I need an M3 or M4 ARM cortex MCU so I can follow on the projects. The course itself recommend the Discovery board, but I was aiming for the stm32f103c8t6 Datasheet

I watched most of the (first) class so far. It is almost all about the C language in general but does walk you through the chip document to show you registers and bits, as well as how to write code to access them.

The part on the stm32f4 and the part on the stm32 blue pill are not the same and are not compatible. The cortex-m3/4 is not relevant with respect to addressing and using the peripherals. So the concepts and tools will all work the same, the exact addresses and bits will not.

It seems that there's no much information about the board in terms of programming on the stm32 IDE as everyone is using it with the Arduino IDE.

I would have to disagree with this in a few ways, I would say percentage wise nobody is using the Arduino IDE. The truth is somewhere between everyone and no one. The cost of the blue pill makes it easy for people to use with all of the various solutions, not limited in any way to the Arduino. Most folks are not using Arduino.

st and arm have plenty of information along with countless examples across the internet about how to program these mcus. And as a result these stm32f4discovery boards as well as countless examples that are specifically for these blue pill boards.

The class uses the ST IDE and the stm32f103 is still an available product so I cant see that one of their tool choices supports this part. The blue pill is just a breakout board with a crystal, so while they may or may not support the board (knowledge of where the led is??) there should be support for the part.

I was wondering If I will need additional hardware beside it like an st link v2 ( which I don't know it's purpose yet ,but that's what I got after some searching ). in order to be able to program and debug nicely along the course

The (authentic) stm32f4 discovery has an stlink on the board, so you do not need to buy one separately.

The blue pill does not have debugger hardware on it, you have to buy that separately. The stlink of any flavor is just one possible solution, it is not the only solution, so therefore not "required".

When you read the documentation about the stm32 chip and the arm cores (go to the arm website) you find that there is an swd (single wire debug) interface to the arm core which the stm32 parts will expose. Stlink is essentially a usb protocol that you use to talk to a debugger (in this case external hardware between your development computer and the target mcu). The stlink solution is a path essentially to the swd protocol so that with software that speaks the stlink protocol you can talk to the arm core. With access to the arm core you can do, among other things, write your program to flash so that it can be run when reset or powered on.

There are other paths, usb protocols if you will to hardware (boards) that then speaks swd for you. Most notably but not limited to jlink and ftdi based boards in particular those with MPSSE.

The stm32f103 part also includes a bootloader (software) from st, not an arm thing. This provides access through that interface to write your program into the flash. (also documented on st's website) And there are too many to even mention solutions here, costing from around a dollar to maybe 15.

The blue pill may come pre programmed with an application that works as a bootloader that speaks a well known usb protocol that the Arduino IDE also supports. But this is the same application flash area where your programs will live so if you mess this up then you cannot use this interface anymore you have to use one of the ones above, with external hardware, to reprogram this bootloader into the application flash so that you can to back and try again using the Arduino IDE. The stm32f4 discovery does not have this problem there is a separate debugger and target mcu the debugger hardware can reprogram the target mcu independent of bugs in your code (those that do not destroy the hardware).

So back to the title question:

why does the Stm32f103c8t6 Board need an ST-Link V2?

You do not "need" it but you "need" a way to write your program to the flash on the part and that might desire an SWD solution of which the stlink is one (but not the only one).

The stlink version should not matter.

SWD is not your only path in, and stlink is not the only swd solution. There are lower cost solutions to program the blue pill (that may or may not be compatible directly with the arduino ide).

The class or this first one is at least mostly C language stuff not using the board but using your computer. When it does use the card it does rely on the stlink interface. Where the lecturer will click a button on the GUI and a second or seconds later the board is programmed and the led is blinking or whatever. That few seconds might take you a few weeks to get working for you depending on ability to find the right info and experiment, it might take me an afternoon for example. But I hope, but not necessarily expect the IDE to "just work". You might get lucky.

This class moved on quickly into adding another piece of hardware that perhaps you want to buy to add to the stm32f4discovery. One thing I often struggle with is sticking to someones sandbox, I eventually build my own. Although the board is expensive relative to perfectly valid alternatives for the same goal, for the class I would recommend you buy the hardware used by the class. At the same time IMO you can watch this class without any MCU boards and then make your own decision. You can take that knowledge and attempt to use the Arduino IDE if you wish and the blue pill, or search for folks using the ST IDE and the blue pill.

IMO the blue pill boards are low quality I have ordered many and had a number of them arrive non-functional. Likewise there is an stm32f4 discovery clone that is low cost, it does support dfu-util, but like the blue pill might just work, but no surprise if it does not. And I have had a percentage of those be bad or marginal. So while trying to learn you may also be struggling with hardware issues. The nucleo boards are so far pretty good and you do not need additional hardware to make the mcu work and one would expect there to be direct support in one of the st IDEs. Same goes for similar boards from the other vendors (ti, atmel/microchip, nxp, etc).

\$\endgroup\$
4
  • \$\begingroup\$ The thing is I don't where to start or even what to search for to start learn any of that So I searched for a course a bit where I can put myself on the road and I got this recommended I have no idea if it will be good or bad yet but nope I didn't pay for it yet I was just asking some specialist about which to take this one or the one on edx from UTAustinx if you have any recommendation that will be appreciated \$\endgroup\$ Commented Jan 11, 2021 at 3:33
  • \$\begingroup\$ Lots of errors and false claims sprinkled through the above, but it's far too rambling to address specifically \$\endgroup\$ Commented Jan 11, 2021 at 5:22
  • \$\begingroup\$ I re-wrote the answer. \$\endgroup\$
    – old_timer
    Commented Jan 12, 2021 at 2:36
  • \$\begingroup\$ I am just going to clean this up, have spent too much time on it \$\endgroup\$
    – old_timer
    Commented Jan 20, 2021 at 16:46
1
\$\begingroup\$

If you want to use those generic boards, I think you should get an ST-LINK V2 or clone (the latter is inexpensive from China and the originals are not too expensive either) and a USB<->TTL serial module.

STM32CubeIDE supports ST-LINK and Segger J-Link and I would not recommend the latter unless you have a big budget.

I believe you could also use another ST board with the debugger built-in and jumper it over.

All in all, if your main experience is with Arduino type systems, it might be easier to use the recommended board, as the software is fairly complex.

\$\endgroup\$
2
  • \$\begingroup\$ You mean If I got the blue pill with the st programmer and the serial Module you mentioned. there will be additional software needed in order to completely simulate the recommended board ? \$\endgroup\$ Commented Jan 11, 2021 at 1:22
  • \$\begingroup\$ STM32CubeIDE is the IDE that is recommended in the course. It is fairly complex. \$\endgroup\$ Commented Jan 11, 2021 at 2:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.