hal scope breaking pktuart

More
03 Nov 2021 21:34 #225156 by ExcessiveO
So I have written a .comp file that uses pktuart and runs in its own thread slower than the servo thread. Whenever I open hal scope, a bunch of blank error messages pop up and continue coming even after I close the scope. I tried putting the scope in a different thread, and greatly slowing down the thread but it didn't help. Even just the pktuart setup function by itself makes this happen. Any ideas what could cause this or how I can find out what the errors actually are?

Please Log in or Create an account to join the conversation.

More
04 Nov 2021 22:37 #225289 by andypugh
Replied by andypugh on topic hal scope breaking pktuart
Sorry, no ideas, but this is a strange one.

What happens if you run the pktuart in the normal servo thread?

Please Log in or Create an account to join the conversation.

More
04 Nov 2021 22:51 #225291 by ExcessiveO
It still breaks with pktuart in the servo thread, however I need to slow it down a good bit to get it to run, 250000ns is the minimum pktuart will run without FIFO errors.

Please Log in or Create an account to join the conversation.

More
04 Nov 2021 23:28 #225298 by PCW
Replied by PCW on topic hal scope breaking pktuart
The PktUART should run at any servo thread rate, as long as you don't
overrun the TX or RX FIFOs. You do likely have to alternate read status
and read data on servo thread read functions because you need to read
status to know how much data to read.

Please Log in or Create an account to join the conversation.

More
04 Nov 2021 23:40 #225300 by ExcessiveO
I need to use a slower thread since the tx data is longer than the normal servo period. But the issue with the hal scope doesn't even need an actual tx/rx action, just using the setup function for pktuart causes it, so i'm thinking it isn't caused by thread speed.

Please Log in or Create an account to join the conversation.

More
08 Nov 2021 16:27 #225701 by ExcessiveO
I got the actual error to show up: hm2: Can not find PktUART instance xq|q|".
I'm still not sure what is causing it.

Please Log in or Create an account to join the conversation.

More
09 Nov 2021 10:51 #225801 by andypugh
Replied by andypugh on topic hal scope breaking pktuart
Well, it probably won't find any UART called that :-)

It looks like the pktuart driver is being passed the wrong thing. Can you attach the driver code?

Please Log in or Create an account to join the conversation.

More
09 Nov 2021 16:31 #225854 by ExcessiveO
I figured out the issue. I used the pktuart gyro code to base my code off of. It used "name = prefix". I needed to use the what mesa uart code uses:
name = hal_malloc(strlen(prefix)+1);
strcpy(name, prefix);

you also need to use the mesa uart method if you want multiple instances of pktuart.

Please Log in or Create an account to join the conversation.

More
09 Nov 2021 16:39 #225857 by andypugh
Replied by andypugh on topic hal scope breaking pktuart
It looks like this was my fault, as it is a bug carried over from mesa_uart:

github.com/LinuxCNC/linuxcnc/commit/e39f...393f90baa04cc8a5d842

Please Log in or Create an account to join the conversation.

Time to create page: 0.084 seconds
Powered by Kunena Forum