在线时间3 小时
UID3081571
注册时间2014-12-8
NXP金币0
该用户从未签到
新手上路
- 积分
- 27
- 最后登录
- 2015-1-30
|
发表于 2014-12-10 17:49:14
|
显示全部楼层
请教个问题。我现在用k60里面spi DMA方式读EEPROM。我用了package里面的SPI TEST。
以下是测试结果
-------------- SPI driver example --------------
This example application demonstrates usage of SPI driver.
It transfers data to/from external memory over SPI bus.
The default settings in memory.h apply to TWR-MEM flash memory.
Test channel is spi2:
Current baud rate ... 9600000 Hz
Changing the baud rate to 500000 Hz ... OK
Current baud rate ... 500000 Hz
Setting clock mode to SPI_CLK_POL_PHA_MODE0 ... OK
Getting clock mode ... SPI_CLK_POL_PHA_MODE0
Setting endian to SPI_DEVICE_BIG_ENDIAN ... OK
Getting endian ... SPI_DEVICE_BIG_ENDIAN
Setting transfer mode to SPI_DEVICE_MASTER_MODE ... OK
Getting transfer mode ... SPI_DEVICE_MASTER_MODE
Clearing statistics ... OK
Getting statistics:
Rx packets: 0
Tx packets: 0
Read memory status ... 0x00
Enable write latch in memory ... OK
Read memory status ... 0x02
Write unprotect memory ... OK
Enable write latch in memory ... OK
Read memory status ... 0x03
Write unprotect memory ... OK
Enable write latch in memory ... OK
Read memory status ... 0x03
Erase whole memory chip:
Read memory status ... 0x03
Read memory status ... 0x00
Erase chip ... OK
Enable write latch in memory ... OK
Read memory status ... 0x02
Write byte 0xba to location 0x000000f0 in memory ... done
Read memory status ... 0x00
Read byte from location 0x000000f0 in memory ... 0xba
Byte test ... OK
Getting statistics:
Rx packets: 9
Tx packets: 26
Enable write latch in memory ... OK
Read memory status ... 0x02
Page write 12 bytes to location 0x000001f0 in memory:
Hello,World!
Read memory status ... 0x00
Reading 12 bytes from location 0x000001f0 in memory:
Hello,World!
Write short data test ... OK
Enable write latch in memory ... OK
Read memory status ... 0x02
Page write 16 bytes to location 0x000002f0 in memory:
ABCDEFGHIJKLMNOP
Enable write latch in memory ... OK
Read memory status ... 0x02
Page write 56 bytes to location 0x00000300 in memory:
QRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyz1234567890
Read memory status ... 0x00
Reading 72 bytes from location 0x000002f0 in memory:
QRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyz1234567890▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
Write long data test ... ERROR
IO_IOCTL_SPI_READ_WRITE ... OK
Simultaneous write and read - memory read from 0x000000f0 (10):
Write: 0x03 0x00 0x00 0xf0 0x00 0x00 0x00 0x00 0x00 0x00
Read : 0xff 0xff 0xff 0xf0 0xf0 0xf0 0x00 0x51 0x52 0x53
Simultaneous read/write (data == 0xf0) ... ERROR
-------------- End of example --------------
小于16个字节的读写正确。不过分两次写的话,第二次的就覆盖第一次。请问有什么建议吗?谢谢。 |
|