STM32F103C8T6 5V pin description. Ask Question 0 $begingroup$ On the STM32F103C8T6 there is a 5V pin, see at the bottom left of the STM. That is a board with an stm32 processor on it, known as a blue pill, rather than an stm32 as a product. The schematic seems to use VCC3v3 and VCC3V3 interchangeably, and the same with 5v and 5V.
STM32 Blue Pill ARM development board first look: from Arduino to bare metal programmingby snm, December 12th, 2017.Inspired by the, I purchased a STM32 microcontroller. Specifically, the board from Aliexpress for $1.85 (not bad for the full development board).This is actually a different chip than Jay Carlson covered, ST Micro’s product lineup ranges from the low-end STM32F0 featuring an ARM Cortex-M0 up to the STM32F7 with a Cortex-M7F:Next up, the line.
The STM32F0 has a famous big brother — the STM32F4 — that’s one of the most capable Arm Cortex parts ever built. Several versions run up to 180 MHz, with 2 MB of flash and up to 364 KB of RAM (in the case of the STM32F469).But the brand-new STM32F7 — part of the new Cortex-M7 line of parts — goes even further, with 216 MHz maximum operating frequency, 2 MB of flash, and 512 KB of RAM.The STM32F4 seems to be one of the most popular, it even has its own subreddit. Could’ve gotten one of those or the cheapest ‘F0 but the ‘F1 kit was inexpensive and I decided to go for it instead. From Wikipedia, the 103 model (STM32F103) is focused on performance:The STM32 F1-series was the first group of STM32 microcontrollers based on the ARM Cortex-M3 core and considered their mainstream ARM microcontrollers. The F1-series has evolved over time by increasing CPU speed, size of internal memory, variety of peripherals. There are five F1 lines: Connectivity (STM32F105/107), Performance (STM32F103), USB Access (STM32F102), Access (STM32F101), Value (STM32F100).Cool. This is a 72 MHz processor.
The full part number STM32F103C8T6 to C8 = 128 KB flash, 20 KB RAM, 48-pin LQFP:What is the T6 in STM32F103C8T6? Digikey has for STM32F103C8, so T6 appears to indicate the packaging; not important for programming specifications.Datasheet: SoftwareI’d like to run, but it targets the Microchip PIC32 microcontroller (128 KB RAM, 512 KB flash), maybe it can be ported to the STM32F1? There is some discussion on the RetroBSD forums:.How about Arduino? Found this useful page:, which points to described as “Arduino STM32.
Hardware files to support STM32 boards, on Arduino IDE 1.8.x including LeafLabs Maple and other generic STM32F103 boards”. There is an active community and support forum at.The device I ordered looks a lot like the what they call a.
An important caveat from that page:Please note. This board will not be usable when you receive it, as it does not contain a bootloader.stm32duino’s has more information. The Maple mini clones don’t require flashing a bootloader. What do I have? Let’s try just plugging in the micro USB and powering it:The red power LED turns on solid, and the green PC13 LED blinks continuously. No serial port shows up in /dev/.
This is because you must. HeadersSolder on the provided headers. This took longer than expected, due to a n00b mistake of not orienting the header straight and nonetheless soldering all the pins; had to desolder with copious amounts of flux:and clean it up then reorient correctly, but all’s well that ends well:BootloaderFollow the instructions in. When I set boot0 to 1 high and boot1 to 0 low, when powered only the power LED illuminates. Now to connect the serial.
Stm32duino gives instructions for the newer “black pill” board, connecting RX to PA9 and TX to PA10, where are these pins? Gives a hint: they are PA9 and PA10 are labeled A9 and A10 on the board. Let’s do this. Wire up TX, RX, GND, and 3V3 to a USB-to-serial adapter:The instructions for flashing the bootloader are for Windows or Linux, but I’m on macOS, so I found this to try instead:.
It appears to detect the STM32 correctly. Sketch uses 13092 bytes (19%) of program storage space. Maximum is 65536 bytes.Global variables use 2816 bytes (13%) of dynamic memory, leaving 17664 bytes for local variables. Maximum is 20480 bytes.dfu-util 0.8dfu-util: Invalid DFU suffix signatureCopyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!Copyright 2010-2014 Tormod Volden and Stefan SchmidtThis program is Free Software and has ABSOLUTELY NO WARRANTYPlease report bugs to No DFU capable USB device availableAn error occurred while uploading the sketchWhat’s wrong with my capable device? There is an open issue on their tracker:./dfu-util -list finds a device.
$ lsusbBus 020 Device 004: ID 05ac:8296 Apple Inc. Bluetooth USB Host ControllerBus 020 Device 008: ID 05ac:8511 Apple Inc.
FaceTime HD Camera (Built-in )Bus 020 Device 009: ID 1eaf:0004 1eaf MapleBus 000 Device 001: ID 1d6b:ISPT Linux Foundation USB 3.0 BusBus 000 Device 001: ID 1d6b:CIAR Linux Foundation USB 3.1 Busnot 1EAF:0003, but it’s close. What is going on? Shows the product IDs are 0x0004, but the upload USB IDs all end in 0x0003 instead.
Are there two devices? Yes: if I run lsusb in a loop, while plugging in the STM32 board, then it briefly finds the 1eaf:0003 device.
Sketch uses 13004 bytes (11%) of program storage space. Maximum is 110592 bytes.Global variables use 2816 bytes (16%) of dynamic memory, leaving 14592 bytes for local variables. En.stm32cubemx $./SetupSTM32CubeMX-4.23.0.app/Contents/MacOs/SetupSTM32CubeMX-4230macosDec 9, 2017 7:50:47 PM INFO: Logging initialized at level 'INFO'Dec 9, 2017 7:50:47 PM INFO: Commandline arguments:Dec 9, 2017 7:50:47 PM INFO: Detected platform: macosx,version =10.13.2,arch =x86,symbolicName =null,javaVersion =1.8.0131Dec 9, 2017 7:50:49 PM WARNING: Cannot write to '/usr/share/applications'This is already a lot more powerful than Arduino, but I’m powering through. Step through the installation steps, installed to /Applications/STMicroelectronics/STM32CubeMX.app, launch the app and it presents this window:It feels non-native, no menu bar at the top of the screen, and the menus in the window open noticeably slowly. Not as intuitive as Arduino, which opens with a code sample template project.
Bearing with me, I click New Project, then it downloads some files, takes a while. Finally getting somewhere, the app lists the MCU (microcontroller) selector and Board Selector, and my STM32F103C8 is there (the chip in the ):Start project.
I’m presented with a pinout diagram of the microcontroller, looks like you can select what integrated peripherals to activate here. Will need to read up and/or watch videos to see how to continue further, learning this new development environment. It’s for a different microcontroller series, the STM32L (L = low power), but I’ve always enjoyed Dave Jone’s EEVblog videos, he has one here:.
Long story short, the STM32Cube software is for configuring the board initialization, using an easy-to-use GUI instead of obscure register twiddling code buried deep in a data sheet. It’s a code generator, generating initial configuration code for various toolchains. Using this tool isn’t strictly necessary, but initialization code is necessary. It can generate code for multiple toolchains.Which toolchain to use? Project Generate Code Toolchain / IDE gives several options: IDE evaluation. EWARM.
MDK-ARM V4. MDK-ARM V5. TrueSTUDIO. SW4STM32.
Makefile. Other toolchains (GPDSC)EEVblog seems to want GCC but it isn’t listed here. How about just Makefile?
Plain old school Unix, I like it. EEVblog however starts with EWARM, the Embedded Workbench for ARM from IAR, they have on their site.
30-day time-limited, or 32 KB size-limited trials. Ugh, who wants limitations? Full support requires purchasing a license. How is this better than Arduino again?
The YouTube comments suggest using TrueSTUDIO from, a free download which has GCC, but it only had Windows and Linux installers, no Mac. How about IDEs for the STM32F103C8? Check the, scroll down to “Software Development Tools”, there are more options:. GreenHills integrated development and debug environment for embedded applications using C and C(ARM IDE development is quite a competitive space. Some seem to be obscure, commercial-only, or non-cross-platform. Eliminated these choices: CooCox (Windows), Cosmic, Emprog (30-day trial), winIDEA (Windows), mikroe ($299), Raisonance (their download link is broken), Altium Tasking (trial), Atollic TrueSTUDIO (Windows or Linux only), leaving at least:.: free download for macOS.
ARM Keil MDK-ARM: enter information to download - but it’s Windows (MDK524A.EXE). Green Hills Software MULTI: enter information to download. (SW4STM32): free registration to downloadDownloaded and installed CrossWorks, there is a Mac download link right on their front page. The release notes say they use LLVM/Clang 5.0.0 and fixed a few macOS bugs, active development. Sweet, this is looking promising.
How have I never heard of them? Fired up CrossStudio for ARM 4.0.app, looks friendly enough:CrossWorks wasn’t listed as a supported toolchain for STM32CubeMX, but it may support importing other projects it supports: File Import IAR EWARM / Keil MDK GPDSC Project. I went back to STM32CubeMX, generated an EWARM project, then imported it into CrossWorks. Not sure where to go from here. Keil EWARM seems better supported, but it is Windows-only. Is it worth running Windows (or Linux) in a VM just for these tools?
Seems clunky, maybe CrossWorks is worth learning. Or the other alternatives. I registered for OpenSTM32, after stumbling through their captchas, but didn’t receive the confirmation email and it is required for downloading. I went to bed and the next day, I was confirmed. Logged in and clicked the link to the. Bare Metal Edition, I like the sound of that.
It has Windows, Mac OS/X, and Linux downloads. Download the installsw4stm32macos64bits-v2.3.run installer, released October 25, 2017. Or at least I started to, but the download is very slow.There has to be a better way. How does the developer do it? GCC ARM and OpenOCDThen I found this post by David Rojas:.
Seems to be almost exactly what I was looking for:Since ST doesn’t provide a development environment like TI and NXP do, and the commercial packages available are expensive and windows only, I’ve decided to put up a step-by-step tutorial on how to setup an opensource environment for Mac OS X based on eclipse, GCC ARM and openOCD.Although targeting the F3 instead of F1, hopefully similar enough. Follow the steps, but there are some changes:.: download gcc-arm-none-eabi-54-2016q3-20160926-mac.tar.bz2.: for C/C Developers.
CDT Optional Features slightly changed, I selected:. C/C Autotools support. C/C C99 LR Parser. C/C GDB Hardware Debugging. C/C Memory View Enhancements.
C/C Multicore Visualizer. C/C Unit Testing SupportInstalled the GNU ARM plugin (clicked through the unsigned code warning), but installing the Zylin Embedded CDT (necessary to debug and flash) from failed with.
Source find target/stm32f1x.cfgAs for the interface do I really need an ST-Link v2? $ make clean$ make$ brew uninstall openocd$ sudo make install$ openocd -f./stm32f1.cfgOpen On-Chip Debugger 0.10.0+dev-00219-geb26a884-dirty (2017-12-10-17:51)Licensed under GNU GPL v2For bug reports, readThe specified debug interface was not found (buspirate)The following debug interfaces are available:1: ftdi2: usbblaster3: presto4: usbprog5: openjtag6: jlink7: vsllink8: rlink9: ulink10: arm-jtag-ew11: hla12: osbdm13: opendous14: aice15: cmsis-dap16: kitprogoops, Bus Pirate (nor ST-Link) interfaces were compiled in. Run./configure -help to see what we missed. Reconfigure and rebuild, but it fails with an error.
$./configure -enable-stlink -enable-buspirate $ makesrc/jtag/drivers/buspirate.c:1205:47: error: implicit conversion from 'int' to 'char' changes value from 138 to -118 -Werror,-Wconstant-conversiontmp0 = CMDRAWCONFIG CMDRAWCONFIG3V3 CMDRAWCONFIGLSB; ^1 error generated.The constant CMDRAWCONFIG is 0x80, but tmp is a char array, so it becomes negative. Some other projects have as a workaround/fix. All of the warnings are documented in the. Would rather fix it.
Testing an isolated test case. $ openocd -f./stm32f1.cfgOpen On-Chip Debugger 0.10.0+dev-00219-geb26a884-dirty (2017-12-10-17:58 )Licensed under GNU GPL v2For bug reports, read: auto-selecting first available session transport 'jtag'. To override use 'transport select '.adapter speed: 1000 kHzadapternsrstdelay: 100jtagntrstdelay: 100none separatecortexm resetconfig sysresetreqsrstonly separate srstnogate srstopendrain connectdeassertsrst^CError: Error reading dataError: Buspirate error. Is binary/OpenOCD support enabled?I suppose I need to update the Bus Pirate firmware? (from “Firmware v5.10 (r559) Bootloader v4.4” to 6.0RC or later).
Links directly to a file uploaded to the forums, it seems to be this post::by robots » Tue Feb 08, 2011 12:21 pm Hi, attached is fw built from svn with Openocd support enabled.I’m hesistant to install some random firmware on a forum post from 2011, but it’s newer than what I have installed and reportedly works with OpenOCD, and is easier than compiling Bus Pirate firmware myself from scratch, so what do I have to lose? Unzip the attached busPirate.production.zip, it contains a single file busPirate.production.hex. Use the tools at. Actually, on that same page, there is a newer firmware at, links to:.
Firmware version 7.0, updated a year ago. Meh, try the earlier firmware first. Flash using,. $./ds30client/ds30clientmacosx -dev =/dev/tty.usbserial-.hex =busPirate.production.hex DS30Loader client for Buspirate v2/v3 Parsing HEX file busPirate.production.hexChecksum does not match, line 4Could not load HEX file, result = -1That’s not good. Said:This is because the compiled HEX file is lowercase. I fixed the issue by converting it in uppercase.Sigh, okay. I converted the hex to uppercase using vim.
Then it flashes. $ openocd -f./stm32f1.cfgOpen On-Chip Debugger 0.10.0+dev-00219-geb26a884-dirty (2017-12-10-17:58)Licensed under GNU GPL v2For bug reports, read: auto-selecting first available session transport 'jtag'. $ python flashSTM32.pyTraceback (most recent call last):File 'flashSTM32.py', line 41, in mainFile 'flashSTM32.py', line 18, in mainbusPirate = PirateSWD('/dev/tty.usbserial')File 'pirate-swd/PirateSWD.py', line 8, in initself.resetBPFile 'pirate-swd/PirateSWD.py', line 22, in resetBPraise SWDInitError('error initializing bus pirate')SWDErrors.SWDInitError: error initializing bus pirateand gets the Bus Pirate into a state where it doesn’t respond in screen, requiring a hard reset. Failing here. Class PirateSWD: def init ( self, f = '/dev/buspirate' ): self.
Port = serial. Serial ( port = f, baudrate = 115200, timeout = 0.01 ) self. ResetBP self. SendBytes ( 0xFF. 8 ) self.
SendBytes ( 0x79, 0xE7 ) self. ResyncSWD def resetBP ( self ): self. Expected = 9999 self. Clear self. Write ( bytearray ( 0x0F )) while self. Read ( 5 )!= 'BBIO1': self. Clear ( 9999 ) self.
Write ( bytearray ( 0x00 )) self. Write ( bytearray ( 0x05 )) if self. Read ( 4 )!= 'RAW1': raise SWDInitError ( 'error initializing bus pirate' ) self. Write ( bytearray ( 0x63, 0x88 )) self. Clear ( 9999 )Adding logging, replacing calls to self.port.read with self.read.
$./sparkfunspi.py -port /dev/tty.usbserial-.Trying port: /dev/tty.usbserial-. at baudrate: 115200Ready!Entering binary mode.Bus Pirate v3bFirmware v6.0RC (r572 ) Bootloader v4.4DEVID:0x0447 REVID:0x3046 (24FJ64GA002 B8 )entering binary mode, its supposed to enter a mode.
The Sparkfun example enters SPI1 using 0x01 (commented out with triple-quotes), pirate-swd PirateSWD.py tries to enter RAW1 using 0x05. Binary SPI1 mode works (commenting out RESET and uncommenting SPI1).
So does RAW1 if I write this. $ diff -ur /tmp/100k /tmp/200k- /tmp/100k2017-12-10 19:00000 -0800 /tmp/200k2017-12-10 19:00000 -0800@@ -3,6 +3,6 @@0000020 9a 69 42 f0 14 02 9a 61 0a 4b 11 22 5a 60 09 4c0000030 09 48 63 69 43 f4 80 73 63 61 ff f7 e9 ff 40 05 48 43 f4 80 73 23 61 ff f7 e2 ff ef e7 00 bf-0000050 00 10 02 40 00 10 01 40 a0 86 01 00 00 20 050 00 10 02 40 00 10 01 40 40 0d 03 00 00 00060 70 00064This is the example commit:Included a few precompiled firmwares for the STM32VLDISCOVERY board, just so people can test it. They should work with the other STM32 chips too, since they just toggle PC8 at different rates.Problem: PC8 isn’t the LED on my board, PC13 is. Code changes will be needed. Thankfully, we can compile with the gcc-arm-none-eabi-54-2016q3 ARM GCC compiler downloaded earlier from.