查看: 3162|回复: 0

[MQX] Problem about spi test on custom k60d100m with MQX 4.1

[复制链接]

该用户从未签到

1

主题

3

帖子

0

新手上路

Rank: 1

积分
27
最后登录
2015-1-30
发表于 2014-12-8 17:43:02 | 显示全部楼层 |阅读模式
Hi every,
我在开发中碰到个问题。 平台是K60M100M+MQX 4.1。 用MQX 4.1里面的SPI测试程序,结果只有一部分正确。这个硬件平台在MQX 3.8下工作正确。
以下是测试结果。

-------------- 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个字符写在了 0x000002f0, 但是从那个地址读的时候,读出来后面写在 0x00000300的数据。

simultaneous write全部都错了。

大家有啥好建议呀?谢谢。

我知道答案 目前已有0人回答
回复

使用道具 举报

您需要登录后才可以回帖 注册/登录

本版积分规则

关闭

站长推荐上一条 /3 下一条

Archiver|手机版|小黑屋|恩智浦技术社区

GMT+8, 2025-7-20 13:25 , Processed in 0.084221 second(s), 21 queries , MemCache On.

Powered by Discuz! X3.4

Copyright © 2001-2024, Tencent Cloud.

快速回复 返回顶部 返回列表