Page 1 of 1
Change STDIO UART before boot monitor?
Posted: Wed Oct 19, 2011 11:26 am
by BTastick
Hi, I'm working on an app for the MOD5270. I want to use UART0 for RS485. I added a few lines to an example program to switch the STDIO over to UART1, but I still get the "Waiting 2sec to start 'A' to abort" message on UART0 before the STDIO switches. Is it possible to switch UARTs sooner, or is this part of the boot loader? Sorry if this is a newbie question, I'm just getting started with Netburner.
void UserMain( void* pd )
{
// break STDIO connection to UART0
SerialClose( 0 );
// open UART1 for system output.
fdSysSerial = OpenSerial( 1, 115200, 1, 8, eParityNone );
ReplaceStdio( 0, fdSysSerial ); // replace STDIN
ReplaceStdio( 1, fdSysSerial ); // replace STDOUT
ReplaceStdio( 2, fdSysSerial ); // replace STDERR
.
.
.
Thanks.
Re: Change STDIO UART before boot monitor?
Posted: Wed Oct 19, 2011 11:52 am
by pbreed
Hit the advanced tab on ipsetup change
the monitor port to uart 1.
Re: Change STDIO UART before boot monitor?
Posted: Wed Oct 19, 2011 11:58 am
by lgitlitz
Hi,
The boot monitor has an option where you can change the boot serial port. This will select which port the boot message appears, and this is also the port that is configured for polling stdio at the start of your application. You can change this setting in the boot monitor by typing 'A' to enter the boot monitor, then type "setup", then type 'b' followed by the serial port number. You then must type 's' to save the settings. This changed from IPSetup too.
You can also change these settings in your application code. Look at the NNDK programmers manual (..\nburn\docs\NetworkProgrammersGuide) chapter 7. This will show you how to read and modify your config record in your application. The config record is the same settings struct you see in the boot monitor settings. Your application can check the boot port settings at the begining of UserMain, if they are set to the wrong port change it and reset. This way of changing the settings is good if you producing many products since you will not need to go into the monitor settings each time you program a board.
-Larry
Re: Change STDIO UART before boot monitor?
Posted: Thu Oct 20, 2011 4:51 am
by BTastick
Perfect. I changed it in IPSetup, nice to know I can do it from the boot monitor too. Changing it in the app is even better, that will save one step from the programming procedure. Thanks for the help!