页次: 1
原本开发板I2C0接口接NAU8822的,自己画了一块小板,板子上I2C0暂时没有接元件,用i2cdetect测试如下:
./i2cdetect -y 0
0 1 2NAU8822 on find
3 4 5 6NAU8822 on find
7 8 9 aNAU8822 on find
b c d eNAU8822 on find
f
00: NAU8822 on find
-- -- NAU8822 on find
-- NAU8822 on find
NAU8822 on find
-- NAU8822 on find
NAU8822 on find
-- NAU8822 on find
NAU8822 on find
请问如何解决该问题???
谢谢!
如题,按照开发板文档配置和描述如下:
Device Drivers --->
Generic Driver Options --->
<*> Nuvoton NUC970 FMI function selection
Select FMI device to support (Support MTD NAND Flash) --->
-*- Memory Technology Device (MTD) support --->
<*> Command line partition table parsing
<*> Caching block device access to MTD devices
-*- NAND Device Support --->
-*- Nuvoton NUC970 MTD NAND --->
NUC970 NAND Flash pin selection (Port C) --->
驱动中的基本设置 如果需要由 U-boot 环境变量传入就必须将”Command line partition table parsing” 选上, 否则会使用驱动程序里的默认配置, 主要会将 MTD 分为三块空间. 上电进入 shell 后, 分别是/dev/mtdblock0, /dev/mtdblock1, 以及 /dev/mtdblock2. 第一块是放置U-Boot 的空间, 第二块放置内核文件, 第三块则是用来挂载 YAFFS2 或 UBIFS 文件系统的空间.若是配置有需要更改, 例如增加或减少分区, 改变分区大小. 请直接编辑uboot/include/nuc970_evb.h 或 drivers/mtd/nand/nuc970_nand.c.
我打开nuc970_evb.h和nuc970_nand.c却无从下手,我只想增加mtdblock3分区,目前只有mtdblock0~2分区
如题:
代码如下:
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <asm/termios.h>
#include <memory.h>
#define DEV_NAME "/dev/ttyS7"
int main (int argc, char *argv[])
{
int fd;
int len, i,ret;
char buf[] = "Hello TopSemic! \n";
fd = open(DEV_NAME, O_RDWR | O_NOCTTY|O_NDELAY);
if(fd < 0)
{
perror(DEV_NAME);
return -1;
}
len = write(fd, buf, sizeof(buf));
if (len < 0)
{
printf("write data error \n");
}
while(1)
{
memset(buf,0x00,sizeof(buf));
len = read(fd, buf, sizeof(buf));
printf("len = %d\r\n", len);
usleep(500000);
}
}
页次: 1