Hi! Is it really matters? I think the issue is more about file descriptors, file pointers and so on. CAN is configured with extended ID. Yes, I did use CAN app from examples, it works. Implementation in my own app also works fine if I use file descriptor when opened /dev/can0. In different threads of one task group - no problems.
Now I want to also send messages from another thread from different task group, but file descriptors cannot be used by different tasks. So I'm trying to use internal OS interface from https://www.nuttx.org/doku.php?id=wiki:nxinternal:detachedfds But file_read on file pointer doesn't work in the same way as read on file descriptor, even if it is in the same thread - right after file_open! чт, 16 янв. 2020 г. в 00:11, Disruptive Solutions < disruptivesolution...@gmail.com>: > Oleg: do you use an extended ID or standard ID? And do you use the CAN app > from examples? > > Verstuurd vanaf mijn iPhone > > > Op 15 jan. 2020 om 22:02 heeft Oleg Evseev <ev.m...@gmail.com> het > volgende geschreven: > > > > Hi! > > > > When I use usual file descriptor for can device: > > file_open(&CANmodule->file, "/dev/can0", O_RDWR); > > everything works, thread blocks if further read() and, when can message > > receive, returns correct nbytes. > > > > When I open can0 with > > file_open(&file, "/dev/can0", O_RDWR); > > > > it opens correctly and file_ioctl seems to work. But file_read from &file > > do not block and return immediately same nbytes as requested with some > > garbage in data. But there is no data on CAN bus. Polling (of course with > > POLLFILE mask) also do not get blocked and return POLLIN event > immediately. > > > > Doing file_detach() as describe in > > https://www.nuttx.org/doku.php?id=wiki:nxinternal:detachedfds leads to > the > > same result. > > > > Any thoughts? > > > > Thanks. > > > > -- > > With regards, > > Oleg Evseev >