Skip to content

STM32F103RCT6 DEVELOPMENT PAGE - NEXT DEGREE

STM32F103RCT6 DEVELOPMENT PAGE - NEXT DEGREE

teddy

Published August 02, 2023

Original author: Alexander · HungaryOriginal source (new tab)

STM32F103RCT6 DEVELOPMENT PAGE - NEXT DEGREE

Project description

As I have said before, a Maple Mini 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 STM32F103RCT6which 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

Aliexpressen can be purchased for around $ 6.7 STM32F103RCT6 Development Board as.
The community "Generic Board" sometimes "Blue Button" 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 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

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

 

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 nameGPIO foot serial number ( RC Core )5V tolerant inputAnalog inputPWM outputAn alternative feature worth mentioning
A00 xx 
A11 xx 
A22 xxUART2 TX
A33 xxUART2 RX
A44 x SPI1 NSS
A55 x SPI1 SCK
A66 xxSPI1 MISO
A77 xxSPI1 MOSI
A88x x 
A99x xUART1 TX
A1010x xUART1 RX
A1111x  USB DM
A1212x  USB DP
A1313x  JTMS-SWDIO
A1414x  JTCK-SWCLK
A1515x  JTDI / SPI3 NSS
B016 xx 
B117 xx 
B218x  BOOT1
B319x  JTDO / SPI3 SCK
B420x  NJTRST / SPI3 MISO
B521    
B622x xI2C1 SCL
B723x xI2C1 SDA
B824x x 
B925x x 
B1026x  I2C2 SCL / UART3 TX
B1127x  I2C2 SDA / UART3 RX/Green LED
B1228x  SPI2 NSS
B1329x  SPI2 SCK
B1430x  SPI2 MISO
B1531x  SPI2 MOSI
C032 x  
C133 x  
C234 x  
C335 x  
C436 x  
C537 x  
C638x x 
C739x x 
C840x x 
C941x   
C1042x   
C1143x   
C1244x   
C1345   TAMPER RTC
C1446   OSC32 IN
C1547   OSC32 OUT
D048x  OSC_IN / CAN_RX
D149x  OSC_OUT / CAN_TX
D250x   
Foot nameGPIO foot serial number ( RC Core )5V tolerant inputAnalog inputPWM outputAn 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 ArduinoEasyin 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 moduleto!

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:

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 Managerselect 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
  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

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 namemain) .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

 

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 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 MapleMinimethod described for.

The solution is an external serial-USB interface, such as the one already used successfully in ESP8266s CP2102 can also be linked to the development tab as follows:

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.

CP2102RCT6
RXDTX
TXDRX
GNDGND
3V33V3

 

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

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

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
 
RCT6W5500
3.3V3.3V
GNDGND
RSTRST
A4SCS
A5SCLK
A6MISO
A7MOSI

 

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

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

Comments

Comments