Greetings / Fingerprint scanner with STM32F103C8T6

Post Reply
Mo_1477
Posts: 2
Joined: Sat Oct 14, 2017 9:00 pm

Greetings / Fingerprint scanner with STM32F103C8T6

Post by Mo_1477 » Sat Oct 14, 2017 9:50 pm

Hi guys,

I am a college student working on senior project with Arduino and STM32F103C8T6 and I have some questions.

The fingerprint scanner module I pick is GT-511C1R. With the Demo code (programmed for Arduino), the scanner could work perfectly. However, the code does not work after I upload the code to STM32F103C8T6 using Arduino IDE.

Here is the demo code downloaded from https://github.com/sparkfun/Fingerprint_Scanner-TTL
This is a simple blink program.

Code: Select all

#include "FPS_GT511C3.h"
#include "SoftwareSerial.h"

// set up software serial pins for Arduino's w/ Atmega328P's
// FPS (TX) is connected to pin 4 (Arduino's Software RX)
// FPS (RX) is connected through a converter to pin 5 (Arduino's Software TX)
FPS_GT511C3 fps(4, 5); // (Arduino SS_RX = pin 4, Arduino SS_TX = pin 5)

/*If using another Arduino microcontroller, try commenting out line 57 and
uncommenting line 66 due to the limitations listed in the
library's note => https://www.arduino.cc/en/Reference/softwareSerial . Do
not forget to rewire the connection to the Arduino*/

// FPS (TX) is connected to pin 10 (Arduino's Software RX)
// FPS (RX) is connected through a converter to pin 11 (Arduino's Software TX)
//FPS_GT511C3 fps(10, 11); // (Arduino SS_RX = pin 10, Arduino SS_TX = pin 11)

void setup()
{
	Serial.begin(9600); //set up Arduino's hardware serial UART
	fps.UseSerialDebug = true; // so you can see the messages in the serial debug screen
	fps.Open(); //send serial command to initialize fps
}

void loop()
{
	// FPS Blink LED Test
	fps.SetLED(true); // turn on the LED inside the fps
	delay(1000);
	fps.SetLED(false);// turn off the LED inside the fps
	delay(1000);
}
For my project, I changed the 7th line to "FPS_GT511C3 fps(PB11, PB10)" since I want to use the USART3 of the STM32.

I also downloaded the SoftwareSerial library from viewtopic.php?f=13&t=6 to pass the "SoftwareSerial.h No such file or directory" error.

I am able to upload the code to STM32 with Arduino IDE via a USB UART serial board.
The message returned by IDE showed something like

libraries\SoftwareSerial\SoftwareSerial.cpp.o: In function `SoftwareSerial::listen()':
...\libraries\SoftwareSerial/SoftwareSerial.cpp:62: warning: undefined reference to `SoftwareSerial::active_object'

and
.....
Starting execution at address 0x08000000... done.

I think the code is uploaded to the STM32 correctly. However, the scanner will not blink when I set up the circuit (correct hopefully).

I am new to Arduino and STM32 so I just don't understand which part I did wrong.
Appreciate any advice or suggestions. Thank you all in advance.

User avatar
RogerClark
Posts: 7183
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Greetings / Fingerprint scanner with STM32F103C8T6

Post by RogerClark » Sun Oct 15, 2017 7:18 am

Just out of curiosity, why are you using software serial.

The STM32 has loads of hardware serial ports, so unless you have already designed a PCB etc and connected the Serial to Non Serial pins, you should just use Serial1 or Serial2 etc, (assuming you are also using the bootloader version which turns on Serial USB in the sketch)

BTW

I had a cursory look at the fingerprint library, and as it just uses serial, I could not see much wrong with it, except potentially that it was doing 32 bit value to 8 bit array conversion, and may not be correct for the Endian'ness of the STM32

Mo_1477
Posts: 2
Joined: Sat Oct 14, 2017 9:00 pm

Re: Greetings / Fingerprint scanner with STM32F103C8T6

Post by Mo_1477 » Mon Oct 16, 2017 6:13 pm

@RogerClark
Hey thanks for replying.

I mean, I was testing those codes and scanners on arduino and my friend told me that the code can be uploaded to STM32 via arduino IDE directly so I just use a STM32 and a USB UART board to do the serial upload without changing any code. At first the compiler return a “SoftwareSerial.h No such file or directory” error so I googled this error and found this post viewtopic.php?f=13&t=6. I downloaded the library in the link and the error was gone.

Do you mean that I just need to change the code to solve this? By changing SoftwareSerial to HardwareSerial or something like that? I am a bit confused. There is too much to learn.

Post Reply