0

I am trying to create a communication between an STM32 and a laptop.

I am trying to receive data from the serial, sent thanks to an STM32. Actual code that I am sending is 0x08 0x09 0x0A 0x0B

I checked on the oscilloscope and I am indeed sending the correct values in the correct order.

What I receive is actually :

b'\n\x0b\x08\t'

I assume that Python is not reading an input that is greater than a 3 bit size, but can not figure out why

Please find my code below :

import serial
ser = serial.Serial('COM3', 115200, bytesize=8)
while 1 :
    if(ser.inWaiting() != 0) :
        print(ser.read(4))

If someone could help, it would be nice ! :)

Shunya
  • 2,191
  • 2
  • 15
  • 27

0 Answers0