# UART1 issues

**URL:** <https://forum.legato.io/t/uart1-issues/1982>\
**Category:** Legato Linux distribution (Yocto project)\
**Created:** [May 20, 2014, 3:37pm UTC](https://forum.legato.io/t/uart1-issues/1982 "2014-05-20T15:37:12Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![arnaudlanger](https://avatars.discourse-cdn.com/v4/letter/a/8491ac/32.png) [@arnaudlanger](https://forum.legato.io/u/arnaudlanger)\
**Post date:** [May 26, 2014, 1:59pm UTC](https://forum.legato.io/t/uart1-issues/1982/6 "2014-05-26T13:59:21Z")

</div>

Hiya,

So there is the content of the project:

[ul]  
[li]Here is the .c file:

`COMPONENT_INIT
{
    // Open the serial port.
    int fd1 = open("/dev/ttyHSL1", O_RDWR|O_NONBLOCK);
    LE_ERROR_IF(fd1 == -1, "HSL1 open failed with errno %d (%m)", errno);
}`[/li]  
[li]And here is the .adef file:

`executables:
    rs232 ( "rs232.c" )
import:
	[rw] "/dev/ttyHSL1" "/dev/"
processes:
    envVars:
        LE_LOG_LEVEL = DEBUG
    run: (rs232)`[/li]  
[li]And here is the output when I start the app

[quote]  
13:55:33 INFO | supervisor[835]/supervisor T=main | proc.c StartProc() 849 | Starting process rs232 with pid 2539  
13:55:33 INFO | supervisor[2539]/supervisor T=main | proc.c StartProc() 823 | Execing ‘rs232’  
13:55:33 INFO | serviceDirectory[840]/serviceDirectory T=main | serviceDirectory.c DispatchClientToServer() 540 | Client (pid 2539) connected to server 844 for service (LogControlProtocol:LogClient).  
13:55:33 DBUG | rs232[2539]/default T=main | \_main.c main() 33 | == Log sessions registered. ==  
13:55:33 DBUG | rs232[2539]/default T=main | \_main.c main() 42 | == Starting Event Processing Loop ==  
13:55:33 =ERR= | rs232[2539]/default T=main | rs232.c \_default\_Init\_Function() 433 | HSL1 open failed with errno 13 (Permission denied)[/quote][/li][/ul]

The file ttyHSL1 is imported into the sandbox correctly

> [@](#):
>
> 13:55:33 INFO | supervisor[835]/supervisor T=main | sandbox.c ImportFile() 415 | Imported ‘/dev/ttyHSL1’ into sandbox ‘/tmp/legato/sandboxes/RS232/dev/ttyHSL1’.

Here it is

[quote]root@swi-mdm9x15:/var/volatile/tmp/legato/sandboxes/RS232/dev# ls -al  
drwx—r-x 2 root root 100 May 26 13:55 .  
drwx-----x 7 root root 140 May 26 13:55 …  
srw-rw-rw- 1 root root 0 Jan 1 1970 log  
crw-rw-rw- 1 root root 1, 3 Jan 1 1970 null  
crw-rw---- 1 root dialout 249, 1 Jan 1 1970 ttyHSL1[/quote]

Thanks for the help,

Regards

---

_[View the full topic](https://forum.legato.io/t/uart1-issues/1982)._
