On 2025-06-05 15:36:09, Elias Hawa wrote:
> Hello everyone,
> 
> I'm currently working on a sensor driver for the Quectel L86-M33 GNSS
> module. It communicates over UART and is very feature rich, allowing users
> to send commands over UART to modify things such as position fix interval
> and device baud rate (default at 9600).
> 
> I'm able to correctly send commands to the device to change its baud rate,
> but I've so far been unsuccessful in figuring out how to change the baud
> rate of the UART device. So far I've attempted to change the baud rate
> using `file_ioctl` and termios within the device driver but had no luck. I
> also experimented with using termios calls in userspace but also had no
> success there. In each instance, the device would crash shortly after
> attempting to change the baud rate of the UART device.

Well, on normal unix you'd set speed with

    fd = open("/dev/ttyS0", ...);
    tcgetattr(fd, &tty)
    cfsetispeed(&tty, B9600);
    tcsetattr(fd, TCSANOW, &tty)

I never used dynamic baudrate on nuttx, but I would expect it to work as well.

You may want to step into tcsetattr() and see where it gets you. Maybe your
platform cannot set new baudrate properly?

And how does the driver crash? Do you have any stack trace? Again, this may
indicate that your platform just cannot set new baudrate.

-- 
.-----------------.-------------------.----------------------.-----------------.
| Michal Lyszczek | Embedded C, Linux |   Company Address    |  .-. opensource |
| +48 727 564 419 | Software Engineer | Akacjowa 10a; 55-330 |  oo|  supporter |
| https://bofc.pl `----.--------------: Brzezinka Sredzka PL | /`'\      &     |
| GPG FF1EBFE7E3A974B1 | Bits of Code | NIP:   813 349 58 78 |(\_;/) programer |
`----------------------^--------------^----------------------^-----------------'

Attachment: signature.asc
Description: PGP signature

Reply via email to