- From: Ronny H. Kavli <kavli_at_motorum.org>
- Date: Mon, 18 Oct 2004 11:57:33 +0200
eeckhaut_at_isia.cma.fr wrote:
> I'm sure that it is not an old message. Another message is added each time i
> invoke the comedi_config command.
>
> When i make a md5sum on my binary file, i get 81fdc53c2e57b367d90db1d36997bf23
> which is different from your key.
>
> I don't know where i'm wrong.
>
> The .h file i use comes from comedi cvs server (version 1.3 of the h file from
> ds in attic folder)
Ok. I took my headerfile from the IOTech ftp-site. (See the comedi
archives 29-SEP-2004. "DaqBoard/2000 and FPGA-code revisited" )
Here is my code for generating the bit-file:#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
#include <string.h>
#define DWORD unsigned short
#define BYTE unsigned char
#include "topbit.h"
int fd;
int main() {
unsigned int bTopSize, size;
bTopSize = sizeof(bTopBitArray);
printf("Hello DaqBoard2000 bitfile-generator.\n");
fd = open("DaqBoard2000_FPGA.bit", (O_CREAT|O_TRUNC|O_RDWR), 0644);
if (fd == -1) {
printf("Error during open: %s\n", strerror(errno));
return errno;
}
else {
printf("Reported size of bitfile is %u\n", (unsigned int)TopBitSize);
printf("Writing %u bytes to DaqBoard2000_FPGA.bit...\n", bTopSize);
size = write(fd, bTopBitArray, bTopSize);
if (size == -1)
printf("Error during write: %s\n", strerror(errno));
else
printf("Wrote %u bytes\n", size);
close(fd);
}
return 0;
}
-- Kavli
Received on 2004-10-18Z08:57:33