can anyone please help me
i am using Arduino IDE
my code is as under
int led = PC13;
void setup() {
pinMode(led, OUTPUT);
Serial.begin(9600);
}
void loop() {
digitalWrite(led, HIGH);
Serial.println("HIGH");
delay(1000);
digitalWrite(led, LOW);
Serial.println("LOW");
delay(1000);
}
Which Core? Which board?
Which kind of garbage? I assume you set the terminal at 9600 ? ![]()
Serial can be USB serial or the hardware Serial
But I assume if you think you are getting data, you have configured things so that Serial is actually the hardware serial port ??
Even a simple code as
Serial.print(“Hello world”);
Is showing just garbage i am using ftdi to moitor serial connected at A9 and A10 pins respectively i uploaded the code from same port
My board has STM32f103c8t6
my baud rate at terminal is same as my code i did double check it
this what i get when i upload the code
http://stm32flash.googlecode.com/
Using Parser : Raw BINARY
Interface serial_w32: 115200 8E1
Version : 0x22
Option 1 : 0x00
Option 2 : 0x00
Device ID : 0x0410 (Medium-density)
- RAM : 20KiB (512b reserved by bootloader)
- Flash : 128KiB (sector size: 4x1024)
- Option RAM : 16b
- System RAM : 2KiB
Write to memory
Erasing memory
Wrote address 0x08000100 (3.32%)
Wrote address 0x08000200 (6.65%)
Wrote address 0x08000300 (9.97%)
Wrote address 0x08000400 (13.30%)
Wrote address 0x08000500 (16.62%)
Wrote address 0x08000600 (19.95%)
Wrote address 0x08000700 (23.27%)
Wrote address 0x08000800 (26.60%)
Wrote address 0x08000900 (29.92%)
Wrote address 0x08000a00 (33.25%)
Wrote address 0x08000b00 (36.57%)
Wrote address 0x08000c00 (39.90%)
Wrote address 0x08000d00 (43.22%)
Wrote address 0x08000e00 (46.55%)
Wrote address 0x08000f00 (49.87%)
Wrote address 0x08001000 (53.19%)
Wrote address 0x08001100 (56.52%)
Wrote address 0x08001200 (59.84%)
Wrote address 0x08001300 (63.17%)
Wrote address 0x08001400 (66.49%)
Wrote address 0x08001500 (69.82%)
Wrote address 0x08001600 (73.14%)
Wrote address 0x08001700 (76.47%)
Wrote address 0x08001800 (79.79%)
Wrote address 0x08001900 (83.12%)
Wrote address 0x08001a00 (86.44%)
Wrote address 0x08001b00 (89.77%)
Wrote address 0x08001c00 (93.09%)
Wrote address 0x08001d00 (96.42%)
Wrote address 0x08001e00 (99.74%)
Wrote address 0x08001e14 (100.00%) Done.
Starting execution at address 0x08000000... done.
When you ran the blink sktech, did it blink at the correct rate (1s ON + 1s OFF)?
[edogaldo – Fri Apr 20, 2018 2:55 pm] –
Looks like a clock problem..
When you ran the blink sktech, did it blink at the correct rate (1s ON + 1s OFF)?
yes it runs fine at same rate i did get an arduino with it to test they both blink at same rate
E.g. when you send 1 character how many are received ?
Actually.. send 10 chars and see how many you get, less or more
Also what about parity, start bits stop bits etc, did you try changing those on the FTDI adapter side ?
Does the FTDI works “standalone” or with other devices?
This garbage output seems like the “brick firmware update” for counterfeit FTDI devices. (just google for it).
On such devices the output is permanent (please step trough the baudrates within the monitor) even without device (blue pill) connected and something like “you are using a counterfeit ….”
[RogerClark – Fri Apr 20, 2018 9:14 pm] –
Did you try other baud rates ?E.g. when you send 1 character how many are received ?
Actually.. send 10 chars and see how many you get, less or more
Also what about parity, start bits stop bits etc, did you try changing those on the FTDI adapter side ?
Tried that all changed baud rates changed parity changed stop bits used other serial monitors tried sending single character but i only get garbage ![]()
[madias – Fri Apr 20, 2018 10:23 pm] –
…really odd possibility:
Does the FTDI works “standalone” or with other devices?
This garbage output seems like the “brick firmware update” for counterfeit FTDI devices. (just google for it).
On such devices the output is permanent (please step trough the baudrates within the monitor) even without device (blue pill) connected and something like “you are using a counterfeit ….”
Well the ftdi is working perfect with my arduino mega i will give a try to your suggestion
[electrobling – Fri Apr 20, 2018 11:03 pm] –
Also it wouldn’t hurt to power the Blue Pill from the FTDI 3.3V supply instead of its own USB connector. Maybe you are getting some strange ground loop in the USB connections.
Well i happened to break the connector of blue pill in frustration and i am powering it through the ftdi power pins ![]()
[RogerClark – Fri Apr 20, 2018 9:14 pm] –Actually.. send 10 chars and see how many you get, less or more
My packet size does remain the same ![]()
Possibly parity or start or stop bit issues
Possibly even voltage level issues
[RogerClark – Sat Apr 21, 2018 5:18 am] –
Not a baud rate issue if the number of chars you receive is the same as the number you send.Possibly parity or start or stop bit issues
Possibly even voltage level issues
I did try with 5v and 3.3v also did changed parity and stop bits as well but i am getting nothing.
I am guessinh there is some thing wrong with my stm board ![]()
[jamshaid – Sat Apr 21, 2018 6:16 am] – I did try with 5v
You applied 5V to VCC? ![]()
[electrobling – Sat Apr 21, 2018 11:32 am] –[jamshaid – Sat Apr 21, 2018 6:16 am] – I did try with 5vYou applied 5V to VCC?
![]()
I applied 5v to 5v pin on the board not the 3.3v pins
[stevestrong – Sat Apr 21, 2018 6:54 am] –
Why don’t you try the USB serial? You only need a USB cable to a micro-USB slot.
I broke the connector in frustration
[electrobling – Sun Apr 22, 2018 12:56 am] –
The USB pins are duplicated right next to the serial pins you’re using. Double check to see that your connections are not offset by one pin. Also you haven’t acknowledged the difference between Serial and Serial1.
i will check the connections
In arduino default is serial but i do see Serial1 as default serial but if i print to serial1 it tends to stop working on that pin and shifts to serial 2 but the data outputs remains same
So the oscilator at pins3 &4 has a resistor of 10k in series with it at one pin
The second oscilator at pin 5&6 has a value of 12.00000 and has a resistor in series at one pin ok 220. Ohms. is it normal?
I have never seen a resistor in series with an oscilator pin and the diagram shows that oscilator 2 should be of 8 Mhz
Is this a custom board?
The Blink sketch would flash on and off, faster than 1 second period
Also USB won’t work.
I recall someone else with a 12MHz board. So you could search to see what they did
Basically you need a custom Variant and change the PLL multiplier to x 6 rather than x 9
What Roger means:
–>
https://github.com/rogerclarkmelbourne/ … _setup.cpp
Line #54: change
#define BOARD_RCC_PLLMUL RCC_PLLMUL_9[RogerClark – Mon Apr 23, 2018 11:55 am] –
So the information about the blink rate was incorrectThe Blink sketch would flash on and off, faster than 1 second period
Also USB won’t work.
I recall someone else with a 12MHz board. So you could search to see what they did
Basically you need a custom Variant and change the PLL multiplier to x 6 rather than x 9
Thanks for the help sorry but the blink code was fine i tested it in comparision with my uno
I could have hooked my board to oscilloscope and shoud have seen the delay but my bad and I apologise and i do remember the usb wasnot working.
After the fix the serial is working ok thank you everyone for the help
[madias – Mon Apr 23, 2018 12:28 pm] –
Ok, this was a hard nut!
What Roger means:
–>
https://github.com/rogerclarkmelbourne/ … _setup.cpp
Line #54: change
#define BOARD_RCC_PLLMUL RCC_PLLMUL_9
Next time please give actual and correct information.
[stevestrong – Mon Apr 23, 2018 5:34 pm] –
Your figures posted here viewtopic.php?f=3&t=3520#p44229 were misleading, I thought that you are using a blue pill, but you are instead using a custom board, right?Next time please give actual and correct information.
Next time we should all cry:
“REAL photo or it didn’t happen!”

