I’m new to STM32 and stm32duino and was trying to port one of my projects from Atmega2560 to a STM32F103ZET board.
I’ve got this one from aliexpress:
https://www.aliexpress.com/item/NEW-ARR … 0.0.qfqFRr
so far I’ve managed to flash the STM32duino bootloader and upload a blink example, that’s something we can build on, I guess.
The board has got one of the fake PL2303 serial ICs on it so I had to use an old driver which doesn’t do a genuinity check or something.
My actual questions now are:
1) in my project I’m using printf_P to read strings from progmem and write them to serial. I’ve redirected printf to UART using fdevopen(&my_putc, 0); which is an AVR function and not available on STM32 core.
now there is a printf function but it doesn’t output anything on the serial monitor and visual studio (I’m using it with visual micro arduino plugin) even says that printf doesn’t accept any arguments.
is there a way to use printf and/or printf_P on STM32duino to write to the serial monitor? I read somewhere that debugging is done a bit differently on STM32 than on Arduino (more like you do it on PIC i guess) but I’d really like to make a universal version of my project (using ifdef to check the microcontroller i’m compiling on) and I’d really prefer not to add a Serial.print for STM32 compatibility to every printf in my software.
2) when I upload the simple blink example everything works, the STM32 onboard LED starts to blink as expected but when I disconnect the USB cable and plug it back in (connected to the leaf port, not the rs232 PL2303 port) the program doesn’t start, the LED doesn’t blink. i didn’t find a way to make it run, I have to reflash it from visual studio or the arduino IDE to make it blink again, as if the program was stored only in the RAM or as if the STM32 board needs some special jumpers or PIN high/lows to boot the programmed software.
Any idea on this?
Thanks for your help!
Have you put the jumper BOOT1 back to oroginal position?
BTW you will get better search results on this site using google than with the built in search at the top of this page.
Use a google search string like the following example …
site:stm32duino.com printf
1) i’m already using the stm32duino boot loader. both boot jumpers are in the original position (tied to groud).
2) i did already find that thread but i am not sure whether that means that printf isn’t implemented in stm32duino out of the box and i have to add it using the code provided in the linked thread or if there is an implementation included which i’m simply too stupid to use.
thanks!
1) i’m already using the stm32duino boot loader. both boot jumpers are in the original position (tied to groud).
http://www.stm32duino.com/viewtopic.php … ini_#p4760
there’s a whole host of these boards, all have switch on/off, intolerant of 12v as its a 5v in, vet6 or zet6 versions, then it’s +/-sdcard, +/-tft connector, male/female tft connector
+/- == with/without
stephen
#include <stdarg.h>
void prtf(char *fmt, ... ){
char buf[128]; // resulting string limited to 128 chars
va_list args;
va_start (args, fmt );
vsnprintf(buf, 128, fmt, args);
va_end (args);
Serial.print(buf);
}
1) i’m already using the stm32duino boot loader. both boot jumpers are in the original position (tied to groud).
2) i did already find that thread but i am not sure whether that means that printf isn’t implemented in stm32duino out of the box and i have to add it using the code provided in the linked thread or if there is an implementation included which i’m simply too stupid to use.
thanks!
also i got the stm32 to boot correctly, i had flashed the wrong bootloader previously.
however i’ve kind of discarded the idea of using stm32duino for something serious as it seems that the core is far away from completed and the documentation on stm32duino seems horrobly incomplete and outdated.
thats very sad because stm32 are cool and cheap hardware…
also i got the stm32 to boot correctly, i had flashed the wrong bootloader previously.
however i’ve kind of discarded the idea of using stm32duino for something serious as it seems that the core is far away from completed and the documentation on stm32duino seems horrobly incomplete and outdated.
thats very sad because stm32 are cool and cheap hardware…


