Testing your minidriver

The Media5200b board has a single serial port that this minidriver example uses to receive bytes on. In order to test this driver, you should build an OS image that sets up TCP/IP and lets you telnet to the board. Since you'll be using the serial port as a data source; don't run the serial driver and don't put debug printouts or verbosity on procnto in your image. Once you have an image, you should burn it onto the onboard flash where you can boot from it.

Connect a NULL-modem cable between your Media5200b board and a host machine. The minidriver is running at 14400 baud, with no flow control. You must make sure that the host machine's serial port is also configured in this manner. On the host machine, begin sending characters to the serial port. Sample code should look like:

...
uint8_t test_data[20] = {"012345678987654321"};
...

if ((fd = open("/dev/ser1", O_RDWR)) == -1)
{
   fprintf(stderr, "Unable to open device: %s (errno=%d\n", device, errno);
   return (-1);
}

for (;;)
{
write(fd, test_data + index, 1);
   index++;
   if (index == 19)
   index = 0;
}

This code sends a pattern of characters to the serial port so that the minidriver can capture data.

Now boot the Media5200b board and telnet to it.

Once connected, you can run the sample full driver, mdrvr-serpsc that does the following:

Since the mdrvr-serpsc application is a sample serial driver you don't need to run devc-serpsc driver.