---
title: "STM32F103RCT6 DEVELOPMENT PAGE - NEXT DEGREE"
url: "https://maker.wiznet.io/teddy/projects/stm32f103rct6-development-page-next-degree/"
markdown_url: "https://maker.wiznet.io/teddy/projects/stm32f103rct6-development-page-next-degree/md"
type: "UCC: User Created Content"
author: "Alexander"
author_url: "https://bitekmindenhol.blog.hu/2019/07/25/stm32f103rct6_fejlesztoi_lap_a_kovetkezo_fokozat"
editor: "WIZnet"
editor_url: "https://maker.wiznet.io/"
original_author: "Alexander"
original_url: "https://bitekmindenhol.blog.hu/2019/07/25/stm32f103rct6_fejlesztoi_lap_a_kovetkezo_fokozat"
published: "2023-08-02"
language: "en"
likes: 0
views: 327
comments: 0
source: "WIZnet Makers (https://maker.wiznet.io/)"
---

# STM32F103RCT6 DEVELOPMENT PAGE - NEXT DEGREE

> STM32F103RCT6 DEVELOPMENT PAGE - NEXT DEGREE

Original author: Alexander (source: https://bitekmindenhol.blog.hu/2019/07/25/stm32f103rct6_fejlesztoi_lap_a_kovetkezo_fokozat)

## Article

As I have said before, a [Maple Mini](https://bitekmindenhol.blog.hu/2019/07/06/maple_mini_stm32f103cbt6_fejlesztoi_lap2) with a promising little tile but scarce 128kB storage space, I'm not completely reconciled ... so let's see the next member of the STM32 F103 family: the sonorous STM32F103**RCT6**which already has 256kB of storage space. (*according to his data sheet, in reality, presumably for production technology reasons, he is transported with 512kB as his larger brother a **RET6**- we can be sure of this with the stm32flash application described below )*

*![rct_0.jpg](https://m.blog.hu/bi/bitekmindenhol/image/rct_0.jpg)*

Aliexpressen can be purchased for around $ 6.7 [STM32F103RCT6 Development Board](https://www.aliexpress.com/item/32785231499.html)* *as.
The community "[Generic Board](https://stm32-base.org/boards/STM32F103RCT6-Generic-Board.html)" sometimes "[Blue Button](https://github.com/mcauser/BLUE_BUTTON_F103RET6)" refers to the insert under an artist name, which hides a 72Mhz power plant with 48kB memory and 256kB storage space with 51 GPIO needles.

The large yellow connector may be of interest to those who have a JTAG programmer but do not have (*nor do I*) they can also easily upload their program with the shorter (*next to the blue button*) through a yellow needle bar is a simple one [CP2102 UART-USB](https://bitekmindenhol.blog.hu/2017/12/17/firmware_flasheles_soros_vonalon) using an adapter. The miniUSB connector could also be used, but unlike the previous MapleMini, this model is shipped "empty", meaning it doesn't have a bootloader on it either, we have to put it ourselves first with a serial programmer, then we can use the miniUSB directly for upload via the Arduino IDE.

![rct_1.jpg](https://m.blog.hu/bi/bitekmindenhol/image/rct_1.jpg)

When you arrive, the 2 2x15 needle rows are not soldered, we are entrusted with the direction in which we want to solder it with our own hands. A 3V CR1220 element can be inserted into the socket at the bottom, but the unit works without it.

Next to the miniUSB, you can program using the spikes above the left in the image above, pressing the blue button turns on the device. You can use the two DIP switches to the right of the miniUSB to switch between start modes.

The names of the legs are as follows:

![rct_pinout.jpg](https://m.blog.hu/bi/bitekmindenhol/image/rct_pinout.jpg)

Although the entire MCU works with 3.3V signal levels, some of the legs are tolerant of the 5V inputs, i.e. we can tie them on, they are marked in the table below, which they are.

| **Foot name** | **GPIO foot serial number ( RC Core )** | **5V tolerant input** | **Analog input** | **PWM output** | **An alternative feature worth mentioning** |
| --- | --- | --- | --- | --- | --- |
| A0 | 0 |  | x | x |  |
| A1 | 1 |  | x | x |  |
| A2 | 2 |  | x | x | UART2 TX |
| A3 | 3 |  | x | x | UART2 RX |
| A4 | 4 |  | x |  | **SPI1 NSS** |
| A5 | 5 |  | x |  | **SPI1 SCK** |
| A6 | 6 |  | x | x | **SPI1 MISO** |
| A7 | 7 |  | x | x | **SPI1 MOSI** |
| A8 | 8 | x |  | x |  |
| A9 | 9 | x |  | x | **UART1 TX** |
| A10 | 10 | x |  | x | **UART1 RX** |
| A11 | 11 | x |  |  | USB DM |
| A12 | 12 | x |  |  | USB DP |
| A13 | 13 | x |  |  | JTMS-SWDIO |
| A14 | 14 | x |  |  | JTCK-SWCLK |
| A15 | 15 | x |  |  | JTDI / SPI3 NSS |
| B0 | 16 |  | x | x |  |
| B1 | 17 |  | x | x |  |
| B2 | 18 | x |  |  | **BOOT1** |
| B3 | 19 | x |  |  | JTDO / SPI3 SCK |
| B4 | 20 | x |  |  | NJTRST / SPI3 MISO |
| B5 | 21 |  |  |  |  |
| B6 | 22 | x |  | x | **I2C1 SCL** |
| B7 | 23 | x |  | x | **I2C1 SDA** |
| B8 | 24 | x |  | x |  |
| B9 | 25 | x |  | x |  |
| B10 | 26 | x |  |  | I2C2 SCL / UART3 TX |
| B11 | 27 | x |  |  | I2C2 SDA / UART3 RX/**Green LED** |
| B12 | 28 | x |  |  | SPI2 NSS |
| B13 | 29 | x |  |  | SPI2 SCK |
| B14 | 30 | x |  |  | SPI2 MISO |
| B15 | 31 | x |  |  | SPI2 MOSI |
| C0 | 32 |  | x |  |  |
| C1 | 33 |  | x |  |  |
| C2 | 34 |  | x |  |  |
| C3 | 35 |  | x |  |  |
| C4 | 36 |  | x |  |  |
| C5 | 37 |  | x |  |  |
| C6 | 38 | x |  | x |  |
| C7 | 39 | x |  | x |  |
| C8 | 40 | x |  | x |  |
| C9 | 41 | x |  |  |  |
| C10 | 42 | x |  |  |  |
| C11 | 43 | x |  |  |  |
| C12 | 44 | x |  |  |  |
| C13 | 45 |  |  |  | TAMPER RTC |
| C14 | 46 |  |  |  | OSC32 IN |
| C15 | 47 |  |  |  | OSC32 OUT |
| D0 | 48 | x |  |  | OSC_IN / CAN_RX |
| D1 | 49 | x |  |  | OSC_OUT / CAN_TX |
| D2 | 50 | x |  |  |  |
| **Foot name** | **GPIO foot serial number ( RC Core )** | **5V tolerant input** | **Analog input** | **PWM output** | **An alternative feature worth mentioning** |

As you can see several legs (*16 pcs*) is also suitable for receiving analog inputs, which is much more than the 1 analog A0 on ESP8266. Thus, we will not need an analog I2C adapter for the STM32 project. I also doubt that with so many available free legs, an IO port expander would be needed... (*detailed comparative table is *[*ArduinoEasy*](https://bitekmindenhol.blog.hu/2019/06/11/arduinoeasy_firmware)*in the article on*)

The available flash storage space allows you to upload ( current ) complete ArduinoEasy with full MQTT support. Of course, access through the LAN still requires one [W5500 LAN module](https://www.ebay.com/sch/i.html?_from=R40&_nkw=w5500+module&_sacat=0&_sop=15)to!

**Translate and upload the program**

You will need the Arduino IDE to compile and upload, and you will also need to install the directories required for STM32. Several different Arduino hardware support layers (*Core*) also exists for STM32, but is currently the only one that supports RCT6 / RET6 types:

- the original "old", which is more mature, but not very recent, is Roger Clark's:
  <https://github.com/rogerclarkmelbourne/arduino_stm32>

I predict that I will not use Windows, and although it can be solved in the same way as below, all steps below have been tested under Ubuntu Linux.

1. Download the Arduino IDE to your machine from here, unpack:
   <https://www.arduino.cc/en/Main/Software>

2. Start the Arduino IDE

3. That **Tools > Motherboard > Motherboard Manager**select and install "**Arduino SAM boards ( Cortex-M3 )**" a motherboard called "

4. Download the <https://github.com/rogerclarkmelbourne/Arduino_STM32/archive/master.zip> the STM32 motherboard

5. Extract the downloaded ZIP file a **~ / Arduino / hardware / Arduino_STM32** folder (*create it if there is no hardware folder here*)

6. Run root right or sudo in this **tools / linux64 / install.sh** script that sets udev rules (*if the file may not be run, chmod a + x install.sh will help, and even if you're already here, most of the files in the tools / linux and tools / linux64 folders should be set to executable.*)

7. After restarting the Arduino IDE, you will already see this new motherboard under the Tools-> Motherboard: (**STM32 F103R series**)
   ![blue_menu_1.jpg](https://m.blog.hu/bi/bitekmindenhol/image/blue_menu_1.jpg)

8. THE **Variant** You can select the type in this submenu, which is STM32F103RC, if you are equipped with a 256kB flash, but if you have a 512kB flash like me, feel free to choose the STM32F103RE type:![blue_menu_2.jpg](https://m.blog.hu/bi/bitekmindenhol/image/blue_menu_2.jpg)

After downloading the Arduino IDE and STM32 Core files, go to a sympathetic directory and download the patch ArduinoEasy source with git:

*git clone https://github.com/enesbcs/ArduinoEasy.git*

or simply download as ZIP:

*wget https://github.com/enesbcs/ArduinoEasy/archive/master.zip*

and compact.

Copy Base64 completely from the lib folder inside the ArduinoEasy folder created by the command *~ / Arduino / libraries/* to find the Arduino IDE when compiling, unless you want to use the part of the Domoticz HTTP protocol that authenticates with a password, because then we would rather modify the contents of the "ArduinoEasy-Globals.h" file with noble simplicity, and the one there **#define FEATURE_BASE64** after **true** condition is rewritten **false** and you will not be looking for the Base64 directory at this time. (*but there will be a few more words about this in a paragraph*)

The Arduino IDE has a - *for me* - an interesting feature that ( must be in a folder with the name*main*) .To an INO file like the filename itself. What to do? Copy the contents of the src folder inside ArduinoEasy to ~ / Arduino / projects to be on hand, and in this form all .ino files are placed directly under the ~ / Arduino / projects / ArduinoEasy folder, also ArduinoEasy.ino, which we can now open within the Arduino IDE and in principle will not squirm...
(*Apparently everyone who didn't know that INO files contained the source code C that could be translated for Arduino, and the definitions can be seen in the .h files.*)

**TRANSLATION AND DIRECT PREPARATIONS**

If we managed to open it after the above is **ArduinoEasy.ino** then look out of the ears of the **Arduino-Globals.h**-t:

![blue_arduino.jpg](https://m.blog.hu/bi/bitekmindenhol/image/blue_arduino.jpg)

There are two main types of #define lines, in one case the point is whether a particular variable is defined or not, in which case we can adjust the setting, to be untied by writing two per sign **// **in this case, this condition ceases to exist or the comment signals are deleted, and the compiler takes into account that we want to use this definition.
The other type, after which there is a logical / number / text value that the compiler evaluates on a translation line and inserts certain parts of the code depending on it.
In this case, almost all DEFINE values can be true in the first section, except for FEATURE_SD, if we don't use an SD card, I don't use it. We don't have to leave a comment before the #define USES_ * lines below. (*unless we really don't need and never need that plugin, or we can't install the libraries needed to compile it*)

As you can see, in all functions (**Sketch menu > Check / Translate**) the total size of the program ( sketch ) is 187316 bytes, if the default TASKS_MAX setting is not compromised, it is already 16 (*This is it *[*ESPEasy*](https://bitekmindenhol.blog.hu/2017/11/27/espeasy_firmware)* in the case of 12!*It will allow you to add a ) device that takes up 12kByte space at the end of the flash storage. That is, as you can see, the 256kB flash fits comfortably and the 512k currently available is a lot.

**UPLOAD**

Let's talk about the specific upload then. As I mentioned, we also have to drop the bootloader charge once, which goes very similarly to [MapleMini](https://bitekmindenhol.blog.hu/2019/07/06/maple_mini_stm32f103cbt6_fejlesztoi_lap2)method described for.

The solution is an external serial-USB interface, such as the one already used successfully in ESP8266s [CP2102](https://bitekmindenhol.blog.hu/2017/12/17/firmware_flasheles_soros_vonalon) can also be linked to the development tab as follows:

![rct_uart_1.jpg](https://m.blog.hu/bi/bitekmindenhol/image/rct_uart_1.jpg)

What do we see?

In addition to crossing the RX-TX legs, we need to connect the power supply as well as the **BOOT0 through HIGH**, and BOOT1 must be set to LOW using the available DIP switches, indicating that we have now entered serial program upload mode.

| **CP2102** | **RCT6** |
| --- | --- |
| RXD | TX |
| TXD | RX |
| GND | GND |
| 3V3 | 3V3 |

If the STM32 Core is unpacked to the location above, you can find the st32flash application in the folder below to perform serial upload:

*~ / Arduino / hardware / Arduino_STM32 / pools / linux64 / stm32flash $*

After connecting to the Linux PC USB after connecting it to the above, we need to see something like the following **dmesg | tail** command:

*usbserial: USB Serial support registered for cp210x*
*cp210x 2-1.5: 1.0: cp210x converter detected*
*usb 2-1.5: cp210x converter now attached to ttyUSB0*

Which means you can communicate with the device at / dev / ttyUSB0, you can use the following command to request Maple parameters:

*./stm32flash / dev / ttyUSB0*

If the connection was correct, the answer should be:

*stm32flash Arduino_STM32_0.9*

*http://github.com/rogerclarkmelbourne/arduino_stm32*

*Interface serial_posix: 57600 8E1*
*Version: 0x21*
*Option 1: 0x00*
*Option 2: 0x00*
*Device ID: 0x0414 ( High-density )*
*- RAM: 64KiB ( 512b reserved by bootloader )*
*- Flash: 512KiB ( sector size: 2x2048 )*
*- Option RAM: 16b*
*- System RAM: 2KiB*

We learned two important things from this: we made the connection 1-way, 2-the device has 512KiB flash storage ( Juhé! ). If no answer is received, we can investigate the cause, if so, continue downloading bootloader2.0:

*wget -c https://github.com/rogerclarkmelbourne/STM32duino-bootloader/blob/master/bootloader_only_binaries/generic_boot20_pc13.bin?raw=true -O generic_boot20_pc13.bin*

If you have downloaded and made sure that you have not been able to download an HTML page or error message, but a 7160 bytes binary file, you can upload it with the following command:

*./stm32flash / dev / ttyUSB0 -w generic_boot20_pc13.bin*

And with that, we managed to supply our RCT6 with bootloader2.0. We need to perform this procedure exactly once, in the future we will be able to upload program code directly on a USB cable as follows! (*the USB serial converter is no longer required, we can tie it up and put it away*) DO NOT forget to reset the BOOT0 switch to LOW, otherwise it will not be recognizable via USB!
THE **dmesg | tail** command shows this if we were successful:

*[ 6746.454682 ] usb 2-1.5: New USB device found, idVendor = 1eaf, idProduct = 0003*
*[ 6746.454686 ] usb 2-1.5: New USB device strings: Mfr = 1, Product = 2, SerialNumber = 3*
*[ 6746.454689 ] usb 2-1.5: Product: Maple 003*
*[ 6746.454691 ] usb 2-1.5: Manufacturer: LeafLabs*
*[ 6746.454693 ] usb 2-1.5: SerialNumber: LLM 003*

You can then use Full Flash Hosting Minus 8KB by uploading via USB via DFU-UTIL or Arduino IDE, selecting the appropriate Bootloader version, then at Port the Maple Mini: (*do not despair if the port may not appear on the first upload, try uploading first without selection.*)

![maple_arduino2.jpg](https://m.blog.hu/bi/bitekmindenhol/image/maple_arduino2.jpg)

Then click the Upload button (*right arrow )* the Arduino IDE attempts to transfer the translated binary to the selected port:

![maple_arduino_upload.jpg](https://m.blog.hu/bi/bitekmindenhol/image/maple_arduino_upload.jpg)

In this case, it usually recompiles everything, and if the insert does not respond for a long time, press the RESET button on it, then it will start flashing, and in addition to messages like the above, Arduino uploads the code to it. If it doesn't go first, don't be sluggish to try again, I don't always succeed at first, you have to time the Reset button well..

The serial connection will no longer be required, so it has been connected for a long time, as we can now update the program via USB, and we can paste the W5500 LAN module according to the following connection:

![rct_lan.jpg](https://m.blog.hu/bi/bitekmindenhol/image/rct_lan.jpg)

| **RCT6** | **W5500** |
| --- | --- |
| 3.3V | 3.3V |
| GND | GND |
| RST | RST |
| A4 | SCS |
| A5 | SCLK |
| A6 | MISO |
| A7 | MOSI |

If we did everything right, after uploading the code above and connecting the LAN connection, we can access our device a Specified in DEFAULT_IP by default 192.168.0.50 IP address from a browser.

![ae_blue_info.jpg](https://m.blog.hu/bi/bitekmindenhol/image/ae_blue_info.jpg)

So much for the basics, an example of its concrete use will be posted on the blog later.

---

Source: https://maker.wiznet.io/teddy/projects/stm32f103rct6-development-page-next-degree/
