programming interface to eMMC

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

programming interface to eMMC

跳至解决方案
3,604 次查看
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

标记 (4)
0 项奖励
回复
1 解答
3,593 次查看
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

在原帖中查看解决方案

2 回复数
3,577 次查看
manojp
Contributor I

thanks, I got help from QNX for same.

0 项奖励
回复
3,594 次查看
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