Attempting to read ...
 
Notifications
Clear all

Attempting to read UART over the Communication header


Mackenzie_Savoy
(@mackenzie_savoy)
Active Member
Joined: 3 months ago
Posts: 7
Topic starter  

I have been attempting to follow the Arduino tutorial for reading back the baud rate over UART. I have a stlink acting as a com port, transmitting the message:

[0xFF,0xFF,0xFF,0xB3,0x00,0x00,0x00,0x00,0x00,0xFE]

I have confirmed via a logic analyzer that the message is being transmitted to the rx header of the solo, but when I try to receive the message on my com port, I get a time out. I probed the Solo's Tx header with a LA and the pin continues to be held high.

At first, I thought the baud rate on my stlink was wrong, so I connected to the solo over USB and ran the same code to transmit the message. I was able to set the baud rate and read back over USB, but still no luck over UART.

Is there something I am missing? 

Mackenzie Savoy, BSE.EE, CPE-O
MSE.EE Candidate System-Level Model Development Engineering Lab
University of New Brunswick, Fredericton NB, Canada
He/Him/His/IL

Forum 1


SOLO Team liked
Quote
SOLO Team
(@milad)
Chief Member Moderator
Joined: 2 years ago
Posts: 229
 

Hi @mackenzie_savoy

Did you change the Address of your SOLO to "0xFF"? ( I recommend not to use this address as it's used only for broadcasting of all nodes)
By default, the address of each SOLO upon delivery is "0x00", so you should use the packet "[0xFF,0xFF,0x00,0xB3,0x00,0x00,0x00,0x00,0x00,0xFE]".

Posted by: @mackenzie_savoy

At first, I thought the baud rate on my stlink was wrong, so I connected to the solo over USB and ran the same code to transmit the message. I was able to set the baud rate and read back over USB, but still no luck over UART.

Yes, because for USB on SOLO the baud-rate notion doesn't exist, USB unlike UART has a different interpretation of data transmission rate and it's based on USB-2 protocol, so in nutshell, the USB on SOLO works with any baud-rate (the baud rate you set to open a VCP or virtual com port is not the real USB data rate, it's just there to follow the COM port convention).

To find out the real baud-rate of UART on your SOLO, pls connect SOLO to your PC, go to Motion terminal, get connected to SOLO there, and see what is the baud rate there (Read it), it should be either at 937500 or 115200, there you can change the baud rate of UART too.

-Remember, once you change the baud rate, you must recycle the power of SOLO ( Turn OFF, wait for 5s, Turn ON), so the new baud rate will take effect, of course for the UART line to work properly the baud rate must be equal on both ends, so make sure your ST link can reach up to 937500bits/s if it can't you can reduce the baud rate on SOLO ( not recommended for high-performance use).

I will remain available.

Regards

Milad

 

 

If you found the answers helpful and you could solve your problems, please kindly verify here to help others in the future.


ReplyQuote
Mackenzie_Savoy
(@mackenzie_savoy)
Active Member
Joined: 3 months ago
Posts: 7
Topic starter  

Hi @milad, thank you for the quick response,

I decided to broadcast to all nodes because I only have one device connected to the UART.
I was able to send the command to read back the baud rate over USB, and read back the data 1, indicating a baud rate of 115200. This was after I sent the command over USB to set the baud rate to 115200. The code I used to both set and read is the same that I used for the stlink VCP, with a change in the com port I am accessing. 

I did power cycle the solo after changing the baud rate, yet still no success 

Thank you

Mackenzie Savoy, BSE.EE, CPE-O
MSE.EE Candidate System-Level Model Development Engineering Lab
University of New Brunswick, Fredericton NB, Canada
He/Him/His/IL

Forum 1


ReplyQuote
SOLO Team
(@milad)
Chief Member Moderator
Joined: 2 years ago
Posts: 229
 
Posted by: @mackenzie_savoy

I decided to broadcast to all nodes because I only have one device connected to the UART.

pls check the packet with 0x00 as the address of the SOLO and see what happens.

Are you sure you are connecting the RX and TX of your ST link correctly?

if you are using "CAN bus/UART pinout" shown in section 13 here, which is the 6 PINs male pin header, as can be seen in table below, you should connect the TX of your ST link ( the transmission line of it) to the UART_RX input of SOLO and the RX of your ST link (Receiving end on ST-LINK) to UART_TX of SOLO, you need also to make sure the GND of SOLO is connected with GND of your ST link at least at one point.

it will be great if you share here a wiring diagram of the connection between your ST Link and SOLO's UART port.

Forum 3

Regards

If you found the answers helpful and you could solve your problems, please kindly verify here to help others in the future.


ReplyQuote
Mackenzie_Savoy
(@mackenzie_savoy)
Active Member
Joined: 3 months ago
Posts: 7
Topic starter  

Hello again @milad,

I doubled check the pinout and changed the packet to send to the default address. Still no luck.

I have uploaded my connections and Logic analyzer output Here 

Mackenzie Savoy, BSE.EE, CPE-O
MSE.EE Candidate System-Level Model Development Engineering Lab
University of New Brunswick, Fredericton NB, Canada
He/Him/His/IL

Forum 1


ReplyQuote
SOLO Team
(@milad)
Chief Member Moderator
Joined: 2 years ago
Posts: 229
 

Hi again @mackenzie_savoy,

Ok, this seems strange, can you share with me the Firmware Version of your SOLO?

You can read it in Motion Terminal, in the Firmware Version section.

Regards
Milad

 

If you found the answers helpful and you could solve your problems, please kindly verify here to help others in the future.


ReplyQuote
Mackenzie_Savoy
(@mackenzie_savoy)
Active Member
Joined: 3 months ago
Posts: 7
Topic starter  

@milad 

Checking the motion terminal, the baud rate is set to 115200 and the firmware version is 0000B007

Mackenzie Savoy, BSE.EE, CPE-O
MSE.EE Candidate System-Level Model Development Engineering Lab
University of New Brunswick, Fredericton NB, Canada
He/Him/His/IL

Forum 1


ReplyQuote
SOLO Team
(@milad)
Chief Member Moderator
Joined: 2 years ago
Posts: 229
 
Posted by: @mackenzie_savoy

Checking the motion terminal, the baud rate is set to 115200 and the firmware version is 0000B007

Ok Great, the "000B007" version had an issue with UART in some cases and we fixed it in the next firmware release "000B008" which was released later almost a month ago ( sorry for that ).

so did you receive the email before to update your board? we send the updater tool to the emails who purchase SOLO, so if you didn't recieve the email pls send us an email to support[at]solomotorcontrollers.com and I will include you in the list, and we will forward you the latest firmware updater tool.

If you go to the latest firmware the UART will work flawlessly.

again sorry for the inconvenience.

I'll be waiting for your email.

Regards

Milad

 

If you found the answers helpful and you could solve your problems, please kindly verify here to help others in the future.


ReplyQuote
Mackenzie_Savoy
(@mackenzie_savoy)
Active Member
Joined: 3 months ago
Posts: 7
Topic starter  

Good day again, @milad!

So I have updated the firmware, but I have still yet to have success. I checked the communications with the solo over USB and was able to get data back, however, probing the uart tx pin on the header, I get nothing. I remember I tried this a week ago and even when operating over USB, uart tx would still transmit the packet. Maybe this changed with the new firmware, but the option still exists that at some point the tx and rx pins were swapped during my wiring and could have blown a pin on the TMS320. Is there any way to confirm this?

Mackenzie Savoy, BSE.EE, CPE-O
MSE.EE Candidate System-Level Model Development Engineering Lab
University of New Brunswick, Fredericton NB, Canada
He/Him/His/IL

Forum 1


ReplyQuote
SOLO Team
(@milad)
Chief Member Moderator
Joined: 2 years ago
Posts: 229
 

Hi @mackenzie_savoy,

Posted by: @mackenzie_savoy

I remember I tried this a week ago and even when operating over USB, uart tx would still transmit the packet. Maybe this changed with the new firmware,

Yes, in the new firmware only the line that receives a packet will respond back, so it's normal that you don't see the UART packet coming out while using USB.

But before everything:

- Do you confirm that now in Motion Terminal you see "000B008" as the firmware version now?

Now to do a new test, pls do the following:

  1. Get connected to Motion Terminal and do a Reset Factory
  2. Turn Off SOLO
  3. Disconnect the USB cable totally and don't connect it back
  4. Turn Back SOLO ON after 5seconds
  5. Try to send this packet "FFFF00860000000000FE" which gives you back the BUS voltage through UART ( the value of feedback doesn't matter)
  6. see if you receive anything through UART ( don't use UART and USB at the same time in this test).
Posted by: @mackenzie_savoy

wapped during my wiring and could have blown a pin on the TMS320. Is there any way to confirm this?

This is very hard to do, but of course, there is always a chance to hurt the RX, TX pins especially if you apply high voltages over their limit, or shorting them to the ground during transmission or similar issues.

-Another point, do you trigger your logic analyzer on a specific voltage level? because the voltage level of the TX of the UART on SOLO is 3.3V so if you trigger it for 5V you can miss the signal.

I'll remain available.

Regards

Milad

 

If you found the answers helpful and you could solve your problems, please kindly verify here to help others in the future.


ReplyQuote
SOLO Team
(@milad)
Chief Member Moderator
Joined: 2 years ago
Posts: 229
 

I forgot to mention that after Reset Factory, the Baudrate of UART will go back on 937500 bits/s, so pls consider this.

 

If you found the answers helpful and you could solve your problems, please kindly verify here to help others in the future.


ReplyQuote
Mackenzie_Savoy
(@mackenzie_savoy)
Active Member
Joined: 3 months ago
Posts: 7
Topic starter  

@milad 

my LA is set to trigger at 1.8V - 3.6V.

I reset the solo to factory settings, changed the baud rate to 115200, and was able to get the voltage over USB.

I then tried the UART and still no success and nothing on my LA.

This is the code that ran (in matlab) that worked for USB but not uart

clear 
clc
s = serialport("COM5",115200);
readbackvolt = [0xFF,0xFF,0x00,0x86,0x00,0x00,0x00,0x00,0x00,0xFE] %UART Command
for i = 0:0.001:1 %run for some time
write(s,readbackvolt,'uint8') %tx the message to the solo
dat = read(s,10,'uint8') %rx the message from the solo
end

Mackenzie Savoy, BSE.EE, CPE-O
MSE.EE Candidate System-Level Model Development Engineering Lab
University of New Brunswick, Fredericton NB, Canada
He/Him/His/IL

Forum 1


ReplyQuote
SOLO Team
(@milad)
Chief Member Moderator
Joined: 2 years ago
Posts: 229
 

@mackenzie_savoy 

Posted by: @milad

- Do you confirm that now in Motion Terminal you see "000B008" as the firmware version now?

so this is confirmed?

Posted by: @mackenzie_savoy

This is the code that ran (in matlab) that worked for USB but not uart

yes, because the USB on SOLO is totally independent of the UART, the USB on SOLO is a native USB-2 and it goes directly to the DSP, so we can't reach any conclusion for the fact that USB functionality somehow effecting the UART.

So, there is one issue here as I see:

As far as I understood, you are using the ST-link like a bridge to convert the USB-data flow from Matlab to the UART and then to SOLO, the problem here is the ST microcontroller is in the path and connected to TX and RX!, so that can cause an issue by pulling the TX line high or low and avoiding the UART_TX on SOLO to operate, in UART, especially the TX line should be always connected to 1 node all the time, otherwise the data transmission will be corrupted.

I think for better testing you should use an independent USB to UART convertor explicitly connected to SOLO's UART line like models below to eliminate the effect of ST microcontroller in the path:

1- https://www.mouser.it/ProductDetail/FTDI/TTL-232R-3V3?qs=Xb8IjHhkxj627GFcejHp0Q==

2- https://www.mouser.it/ProductDetail/895-FT2232HMINIMOD

3- https://www.mouser.it/ProductDetail/895-LC231X

with these, we can be sure that the problem is solely related to UART or not without any external variable like the ST microcontroller. 

I will remain available.

Regards

Milad

 

If you found the answers helpful and you could solve your problems, please kindly verify here to help others in the future.


ReplyQuote
Mackenzie_Savoy
(@mackenzie_savoy)
Active Member
Joined: 3 months ago
Posts: 7
Topic starter  

@milad 

Yes, I did confirm that it was running the 000B008 firmware

I do not believe that it is an issue with the Stlink, I disconnected the micro from the Nucleo board so it functions just as an stlink.

I confirmed its functionality with a logic analyzer and then tied the tx and rx of the stlink together, opened up putty and it was receiving perfectly fine

Mackenzie Savoy, BSE.EE, CPE-O
MSE.EE Candidate System-Level Model Development Engineering Lab
University of New Brunswick, Fredericton NB, Canada
He/Him/His/IL

Forum 1


ReplyQuote
SOLO Team
(@milad)
Chief Member Moderator
Joined: 2 years ago
Posts: 229
 

Hi @mackenzie_savoy, 

So I had to put time and go deeper on the Development board you are using, and there are a couple of things to consider:

1- based on the schematic of your Nucleo board (attached here), to detach the TX and RX from the Microcontroller, you need to disconnect "SB14" and "SB13" on the PCB, it seems they are jumpers physically soldered on the board, so did you do that?
Forum 9

2- the "STM32F103CBT6" mounted for managing the ST-LINK protocols seems to convert the USB to USART and not UART, and as you know, USART can have different settings and data-management compared to UART ( depending on the settings), so again, this part is not clear.

So the definitive way to test the real UART, IMHO, is to test SOLO with one of the FTDI convertors from USB to UART as mentioned above as we tested a lot of their models with SOLO with no issue, if your SOLO fails to communicated with FTDI modules, then we can make sure the TX line of UART is damaged.

I will remain available.

Regards

Milad

 

If you found the answers helpful and you could solve your problems, please kindly verify here to help others in the future.


ReplyQuote
Share: