Mesa UART doesnt work after update to linuxcnc2.8

More
03 Sep 2019 21:54 #144092 by andypugh
Which firmware are you using? I suspect I will need that to test with.

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

More
04 Sep 2019 03:04 - 04 Sep 2019 03:54 #144116 by thang
Here is my firmware that i'm using. it's include: vhd and bit file

File Attachment:

File Name: firmware.t...-03-3.gz
File Size:85 KB
Attachments:
Last edit: 04 Sep 2019 03:54 by thang.

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

More
19 Sep 2019 21:43 #145631 by andypugh
I don't seem to be able to make mesa_uart work even in the 2.7 branch.

Can you do a quick test, download the attached testing HAL file, then
halrun
source test.hal
start

And report what happens?
Attachments:

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

More
19 Sep 2019 22:37 #145635 by andypugh
Don't bother with that, I think I have figured out the problem. (And a very stupid one it is too)

mesa_uart.comp contains these lines:
variable char *name; // UART name
...
name = prefix;

This was meant to keep a local copy in each uart instance of the uart that it belongs to.

Anyone with any competence in C, however, will notice that this actually simply sets the pointer address of "name" to the current pointer address of "prefix" and there is no guarantee that the contents of that will remain as the desired characters.

What it should be is something like:
    name = hal_malloc(strlen(prefix)+1);
    strcpy(name, prefix);

Can you try this modified version of mesa_uart.comp ? You will need to
sudo halcompile --install mesa_uart.comp
Attachments:
The following user(s) said Thank You: thang

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

More
30 Sep 2019 07:16 #146686 by thang
Sorry for being late to response. i was so busy at last week.
Bug is fixed now, thank you very much :laugh:

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

Moderators: PCWjmelson
Time to create page: 0.068 seconds
Powered by Kunena Forum