a question about SD card rtems_blkdev_generic functions

Chan Kim ckim at etri.re.kr
Wed Aug 19 12:46:27 UTC 2015


Hello, rtems folks,
I managed to write an SD card driver on our platform (it was a month ago but I was doing other things lately) and am
tryng to test file read and write. File read is done anyway and I can print the file contents.
Couple of days ago I saw block write starting initiated by file write operation, but somehow I don't know how to make block write start.

somewhere in the driver,  there are lines below.

static const rtems_driver_address_table sd_card_disk_ops = {
    .initialization_entry = sd_card_disk_init,
    .open_entry = rtems_blkdev_generic_open,
    .close_entry = rtems_blkdev_generic_close,
    .read_entry = rtems_blkdev_generic_read,
    .write_entry = rtems_blkdev_generic_write,
    .control_entry = rtems_blkdev_generic_ioctl
};

sc = rtems_io_register_driver( 0, &sd_card_disk_ops, &major);

but strangely, even when I read a file successfully(using fopen, fgets) and print it, only rtems_blkdev_generic_open and rtems_blkdev_generic_close function are called and rtems_blkdev_generic_read/write.functions are not called.
Is this normal? Can someone direct me to a good document on how this works or explain it to me?
Thanks!
Chan


More information about the users mailing list