CW305-DesignStart : how the serial protocol works

Hello,
I’m trying to communicate via UART with the Arm-DesignStart.
I’m using as interface a USB-UART converter (the FT232R).

The Arm firmware that I’m running simply print the character 0 print('0'), so I expect to get the 8-bit ASCII decode of that character (00110000)

But in Python, when I try to read from the UART, I get 16 bits instead of the only 8 bits expected.
image

Is it supposed to receive 16 bits? Isn’t it an 8-bit encoding?
Or is there something wrong with the setting I’m using?

Thanks in advance

Those appear to be the proper settings. I would guess that you have the wrong baudrate (or target clock rate, since those are tied). Are you clocking the DesignStart core at 20 MHz?

Yes, I have set the pll output frequency to 20 MHz.

Here is the setting of the synthezied UART interface

I’m not sure then; could be an issue with your FT232R? Hard for me to diagnose.

If it helps, this is the serial link when I send a "i\n" command like you; my target firmware responds with DesignStart Cortex M3, compiled Jun 12 2020, 14:04:20\nz00\n.

If you had a CW scope, you would do this with:

target.simpleserial_write('i', b'')
target.read()

Hi, sorry for the late reply.
Anyway, I found the problem when analyzing the waves.
I don’t know why, but the actual baud rate used is 19200.
Can’t understand why as I had synthesized the uart module to work at 38400 baud.

When you configure the UART block, you specify both the baud rate and the clock frequency:

In this case, the clock is specified at 20 MHz. If you run at say 10 MHz instead, then the baudrate will actually be 19200; maybe this is what happened?