The default serial port on the Pi is presented on the GPIO pins BCM 14 and 15 not over usb.
To create a serial port over USB you have to:
Set up the Pi operating system first on the SD card
When booted enable serial gadget mode on the Pi
Reboot the Pi
To enable gadget mode issue the following from the Pi command line:
echo dtoverlay=dwc2 | sudo tee -a /...
"The output I receive is serial test start ...
What am I doing wrong?"
You should use /dev/serial0
There seems to be nothing wrong with the program, it is probably doing what you instructed it to do
i.e. Send a line; then read input and resend the characters over serial, presumably producing an infinite loop.
What do you expect it to do?
This has all the symptoms of a faulty SD Card (assuming it isn't counterfeit).
If you use the SD Association formatter you may be able to use the card (I have had some success this way) but ultimately problems will recur because the underlying NAND is failing.
I found the issue is around the 5v. You can use the 5V from the board to power the LED however the PI still runs at 3.3V logic levels which can lead to odd things happening.
I think this explained it well. https://learn.adafruit.com/neopixel-levelshifter
Some microcontrollers, such as the Arduino Uno and Adafruit Metro
32u4, run at 5V logic levels, and so ...