Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue with uart devpath in tag 2.0.0 #954

Open
vsivanagulu opened this issue Feb 22, 2019 · 4 comments
Open

issue with uart devpath in tag 2.0.0 #954

vsivanagulu opened this issue Feb 22, 2019 · 4 comments
Labels

Comments

@vsivanagulu
Copy link

vsivanagulu commented Feb 22, 2019

I ma trying to add uart to my custom am335x based board . I have issues with devpath in uart initialization

mraa_result_t mraa_cosmic_uart_init_pre(int index) { char devpath[MAX_SIZE]; snprintf(devpath,MAX_SIZE,"/dev/ttyO%u",index); if (!mraa_file_exist(devpath)) { syslog(LOG_ERR, "uart: Device not initialized"); }else { plat->uart_dev[index].device_path = devpath; return MRAA_SUCCESS; } return MRAA_ERROR_INVALID_PARAMETER; }
In above I have printed devpath values

else {
printf("path=%s",devpath);
plat->uart_dev[index].device_path = devpath;
printf("devpathaftre=%s",plat->uart_dev[index].device_path);
return MRAA_SUCCESS;
}
output:
path=/dev/ttyO1
Failed to initialize UART
devpathafter=/dev/ttyO1

if I add like below then UART is working fine
'plat->uart_dev[index].device_path = "/dev/ttyO1";'

Why devpath is not working even the string is correct. Kindly guide me to resolve the issue. I have taken phyboard-wega reference. same code for wega board is working.

@Propanu
Copy link
Contributor

Propanu commented Feb 22, 2019

Maybe check formatting/string termination on your written devpath? Just like you pointed out, this works with a constant literal so I doubt it's a mraa issue.

@alext-mkrs
Copy link
Contributor

alext-mkrs commented Feb 23, 2019

@vsivanagulu, please post syslog contents around the time of your program run. The error message you post is not from the code you posted, but from UART example code, right? Posting full code you've changed may be helpful as well, but we can start with syslog.

@alext-mkrs
Copy link
Contributor

@vsivanagulu, is this still actual?

@vsivanagulu
Copy link
Author

@alext-mkrs ,i have stoped this currently for some other important work. i will do it soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants