[En-Nut-Discussion] NutRegisterDevice failed

Joachim Skale joachim.skale at tele2.at
Wed Nov 9 09:19:43 CET 2005


hi

within the following Code i get 0x8686 als Returncode for NutRegisterDevice for devDebug0.
one time i got Returncode 0 for NutRegisterDevice (&devDebug0, 0, 0) but the Filepointer was NULL.

#include <compiler.h>
#include <stdio.h>		// for std. IO Functions
#include <io.h>			// for _ioctl
#include <string.h>
#include <time.h>

#include <dev/lanc111.h>	// for EthernetController Board 2.1
#include <dev/debug.h>		// for Debug UART
#include <dev/uart.h>		// UART I/O function prototypes

#include <sys/device.h>		// for NutRegisterDevice

...
	u_long baud = 115200;
	int nRet = 0;
	nRet = NutRegisterDevice(&devDebug0, 0, 0);
	freopen("uart0", "w", uart);
	_ioctl(_fileno(uart), UART_SETSPEED, &baud);
	NutSleep(200);
	fprintf(uart,"\nUART open:\n");
	nRet = NutRegisterDevice(&DEV_ETHER, 0x8300, 5);	
	if (!nRet)
		fprintf(uart, "Ethernet Device registered.\n");
...

i my opinion i have included all necessary Headerfiles.



where the error ?


thanks for help
Joachim




More information about the En-Nut-Discussion mailing list