Manoj Palhade(deleted)
|
Programming Interface to eMMC in QNX
|
Manoj Palhade(deleted)
09/29/2022 8:22 AM
post121944
|
Programming Interface to eMMC in QNX
Hello QNX Expert,
I am very new to the QNX and NXP S32G board.
I am trying to access eMMC Card through C Code on NXP S32G board. Earlier, we managed to access eMMC Card on Linux using
the following sample code. But in QNX, it faced an issue using ioctl() calls.
Do you have any information and/or documents discussing accessing eMMC in QNX through programming?
I want to know how to read (ex. a device's physical sector size), write, and erase (number of blocks) in eMMC.
This API's like open() close(), lssek(), write() works.
Sample code for Linux
int fd = open("/dev/mmcblk0", O_RDWR);
struct stat sb;
fstat(fd, &sb)
int secsize = 0;
ret = ioctl(fd, BLKSSZGET, &secsize); //a device's physical sector size
if (ret < 0)
{
// set the erase block size
uint64_t range[2];
range[0] = offset; // input address
range[1] = len; // input block size
if (ioctl(fd, BLKDISCARD, &range)
{
}
}
close(fd)
Best Regards,
Manoj
|
|
|