Home/Support/Support Forum/How can I change the default baudrate on NVRAM for Connect Core 9215?
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

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

0 votes
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!
asked Aug 7, 2014 in NET+OS by hsantana New to the Community (22 points)

Please log in or register to answer this question.

2 Answers

0 votes
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.
answered Aug 7, 2014 by dakotas_dad Veteran of the Digi Community (694 points)
0 votes
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:\netos75\src\bsp\customize\boardParams.c
answered Aug 26, 2014 by LeonidM Veteran of the Digi Community (2,821 points)
...