I managed to reproduce the problem with this sketch
Code: Select all
#include <Arduino.h>
void setup() {
Serial.begin();
pinMode(LED_BUILTIN, OUTPUT);
}
void loop() {
Serial.println("hello world");
if(Serial.available()) {
int c = Serial.read();
Serial.println((char) c);
}
digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));
delay(1000);
}
sample output as follows:
Code: Select all
hello world
hello world
hello world
hello world
hello world
hello world
hello world
hello world
hello world
hello world
hello world
hello world
hello world
hello world
hello world
hello hello world
hhello world
ehello world
lhello world
lhello world
ohello world
hello world
whello world
ohello world
rhello world
lhello world
dhello world
hello world
hello world
hello world
hello world
hello world
hello world
hello world
hello world
for the above board is STM32F103C8 blue pill using the generic_stm32f103c variant.
I'm using 'roger's bootloader' maple DFU bootloader
https://github.com/rogerclarkmelbourne/ ... bootloader
using specifially [generic_boot20_pc13.bin](
https://github.com/rogerclarkmelbourne/ ... 0_pc13.bin)
below reproduced on maple mini clone STM32F103CB using the maple_mini variant.
Code: Select all
hello world
hello world
hello world
hello world
hello world
hello world
hello world
hello world
hello world
hello world
hello world
hello world
hello world
hello world
h
hello world
e
hello world
l
hello world
l
hello world
o
hello world
hello world
w
hello world
o
hello world
r
hello world
l
hello world
d
hello world
hello world
hello world
hello world
hello world
the serial monitor is Putty
https://www.chiark.greenend.org.uk/~sgt ... atest.html
and note that the OS environment is Linux
In addition, to reproduce the issue, connect the board e.g. maple mini or blue pill let it run for the 1st few seconds, then run the terminal monitor and connect. That 'few seconds' is normally after connecting, then it takes that little while to search for the app, launch it, selecting the menus and connect (no need to rush with this).
Note however that I'm using a makefile
viewtopic.php?t=37
there is a bunch of flags I'm using and it is mostly in the makeffile
and it isn't arduino IDE that builds the bin file.
gcc is old:
gcc-arm-none-eabi-8-2018-q4-major
the bulid output summary using the makefile looks like this
Code: Select all
text data bss dec hex filename
12088 1176 1032 14296 37d8 bin/maple_mini.elf
-rwxr-xr-x 1 andrew users 13264 Jul 12 23:18 bin/maple_mini.bin
bin/maple_mini.elf: file format elf32-littlearm
Sections:
Idx Name Size VMA LMA File off Algn
0 .text 00002ba4 08002000 08002000 00002000 2**4
CONTENTS, ALLOC, LOAD, READONLY, CODE
1 .text.align 00000004 08004ba4 08004ba4 00004ba4 2**0
ALLOC, CODE
2 .ARM.exidx 00000008 08004ba8 08004ba8 00004ba8 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
3 .data 00000498 20000000 08004bb0 00010000 2**2
CONTENTS, ALLOC, LOAD, DATA
4 .rodata 00000388 08005048 08005048 00015048 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
5 .bss 00000408 20000498 20000498 00020498 2**2
ALLOC
6 .debug_aranges 00001208 00000000 00000000 000153d0 2**3
CONTENTS, READONLY, DEBUGGING
7 .debug_info 00005602 00000000 00000000 000165d8 2**0
CONTENTS, READONLY, DEBUGGING
8 .debug_abbrev 00002267 00000000 00000000 0001bbda 2**0
CONTENTS, READONLY, DEBUGGING
9 .debug_line 00007932 00000000 00000000 0001de41 2**0
CONTENTS, READONLY, DEBUGGING
10 .debug_frame 00002994 00000000 00000000 00025774 2**2
CONTENTS, READONLY, DEBUGGING
11 .debug_str 0000390e 00000000 00000000 00028108 2**0
CONTENTS, READONLY, DEBUGGING
12 .ARM.attributes 0000002b 00000000 00000000 0002ba16 2**0
CONTENTS, READONLY
13 .debug_ranges 00001d80 00000000 00000000 0002ba41 2**0
CONTENTS, READONLY, DEBUGGING
14 .comment 00000075 00000000 00000000 0002d7c1 2**0
CONTENTS, READONLY
Source dirs
src
./STM32F1/cores/maple
./STM32F1/variants/maple_mini
src/
src/rtc/
src/spi/
src/spiflash/
./STM32F1/cores/maple/
./STM32F1/cores/maple/avr/
./STM32F1/cores/maple/libmaple/
./STM32F1/cores/maple/libmaple/stm32f1/performance/
./STM32F1/cores/maple/libmaple/usb/stm32f1/
./STM32F1/cores/maple/libmaple/usb/usb_lib/
./STM32F1/cores/maple/stm32f1/
./STM32F1/variants/maple_mini/
./STM32F1/variants/maple_mini/wirish/
Includes
-ISTM32F1/cores/maple/
-ISTM32F1/system/libmaple/
-ISTM32F1/system/libmaple/include/
-ISTM32F1/system/libmaple/stm32f1/include
-ISTM32F1/system/libmaple/stm32f1/include/series/
-ISTM32F1/system/libmaple/usb/stm32f1/
-ISTM32F1/system/libmaple/usb/usb_lib/
-ISTM32F1/variants/maple_mini/
-Isrc/rtc/
-Isrc/spi/
-Isrc/spiflash/
Defines
-DMCU_STM32F103CB
-D__STM32F1__
-DVECT_TAB_ADDR=0x8002000
-DCONFIG_MAPLE_MINI_NO_DISABLE_DEBUG
-DDEBUG_LEVEL=DEBUG_NONE
-DF_CPU=72000000L
-DSERIAL_USB
-DUSB_VID=0x1EAF
-DUSB_PID=0x0004
-DUSB_MANUFACTURER="Unknown"
-DSPI_HAS_TRANSACTION
the codes for STM32F1 folder is from a recent clone from github on 5 July 2023.