How can I change the default baudrate on NVRAM for Connect Core 9215?

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!

You’ll want to look at the API reference guide. Specifically:
Hardware/Board Support->Development Board Parameters->Functions

customizeReadDevBoardParams() will place the current values of NVRAM into a pointer to a devBoardParamsType structure that YOU supply. The third field in the structure is called baudrate. Set this to your desired default baud rate. It is an unsigned long.

Next call customizeWriteDevBoardParams passing this the same pointer to a devBoardParamsType structure that you used for the read. This will update NVRAM with your default baud rate.

you can change it through serial dialog (if you have’nt disabled it) by interrupting module’s boot. you can also change NVRAM variable’s values from your code.
see Netos API reference manual for APIs to do so or example in C:
etos75\src\bsp\customize\boardParams.c