rogerclarkmelbourne / STM32duino-bootloader

Bootloader for STM32F103 boards, for use with the Arduino_STM32 repo and the Arduino IDE
977 stars 496 forks source link

STM32 (f103c8t6) blue pill char length larger then 255 won't work #105

Closed Danilo277 closed 3 years ago

Danilo277 commented 3 years ago

Hello everyone, please help. The problem is this: a char array cannot be larger than 255, why? Here is an example: .... if (Serial.available() > 0) { char incoming[400]; Serial.readBytes(incoming,400); Serial.println(incoming); } .... So, when I send ower serial text that is, for example, 350 characters long, serial read only 255. if I make: .... if (Serial.available() > 0) { char incoming[400]; String string=Serial.readString(); Serial.println(string);

string.toCharArray(incoming,400); Serial.println(incoming); } ....

now String works perfect but char is limited to 255. Thanks in advance.

stevstrong commented 3 years ago

Which IDE do you use for compiling your sketch? Which OS are you using on host? How do you send the data to bluepill? Which serial monitor?