programming interface to eMMC

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

programming interface to eMMC

Jump to solution
1,734 Views
manojp
Contributor I

Hello NXP Expert,

I am very new to the QNX and NXP S32G. I am trying to access eMMC Card through C Code. 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 used 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

Tags (4)
0 Kudos
Reply
1 Solution
1,723 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello,

You need to go with QNX for support on its OS, but you need erase and burn the eMMC every time you program code.

Regards

View solution in original post

2 Replies
1,707 Views
manojp
Contributor I

thanks, I got help from QNX for same.

0 Kudos
Reply
1,724 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello,

You need to go with QNX for support on its OS, but you need erase and burn the eMMC every time you program code.

Regards