- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I searched before post but I didn't find anything so I hope nobody asked this before. I try to use several (three on my final application) UART on the same NIOS and connected each others (uart0 <=> uart1). I want to send a character with uart0 to uart1. To do this, I want to use open, read, and write function in non blocking mode (reduced_device_driver option disable). But when I try to open the second uart, i have an error (errno 24 => EMFILE /* Too many open files */). I tried to disable uart1 when I send the character with uart0 and enable it after and it's working but for my application it's not really applicable... SO my question is: Is it possible to open more than one uart device at the same time? Thank you in advance! :)Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Go into the BSP editor, and under the "Advanced" section, increase the value of hal.max_file_descriptors.
Also, it is not strictly necessary to use reduced drivers if you just want non-blocking access. If you're using the full HAL layer, you can also use fcntl() to set O_NONBLOCK on the device. (This does not appear to work on the standard streams - stdin, stdout, stderr - but it should work on a device you have opened with open().) Keep in mind that this will make the device non-blocking for both reads and writes; i.e. check the return value of write() -- don't just assume the character was sent.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page