I am trying to modify the baudrate information on NVRAM.
I am able to open a Serial port and change the baudrate, but I have to do it everytime I open the port. What I want to do now is to save the baudrate information on the NVRAM as the default value so I do not have to change it everytime I turn off the board.
This is how I am donig it now:
int fd, tAtri;
struct termios termAttr;
speed_t baudRate;
tAtri=tcgetattr(fd, &termAttr);
/* Get the input speed. */
baudRate = cfgetispeed(&termAttr);
/* Set output speed if not 9600 baud. */
if (baudRate != B115200) {
cfsetispeed(&termAttr, B115200);
tcsetattr(fd, TCSANOW, &termAttr);
}
Thanks!