设为首页收藏本站

Discuz! Board

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
热搜: 活动 交友 discuz
查看: 3341|回复: 2
打印 上一主题 下一主题

51822跑s110时进行IIC读操作出现了HardFault_Handler故障

[复制链接]

5

主题

14

帖子

114

积分

注册会员

Rank: 2

积分
114
跳转到指定楼层
楼主
钟HL 发表于 2016-2-19 16:20:11 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
请教大家:51822跑s110时,使用twi_master_transfer()进行IIC读操作出现了HardFault_Handler故障。
前提:在初始化时进行读操作并未出现异常。
而在按键事件处理button_event_handler()函数中进行读操作就会发生上述故障!
希望大神指教!
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖
回复

使用道具 举报

0

主题

1

帖子

29

积分

新手上路

Rank: 1

积分
29
沙发
zzz7794672 发表于 2016-3-4 17:25:58 | 只看该作者
我用官方的5.1版本的SDK也遇到过这种问题,后来改成10.0版本的SDK就解决了,所以如果你还是用老版本的SDK就赶紧升级吧。
回复 支持 反对

使用道具 举报

2

主题

14

帖子

83

积分

注册会员

Rank: 2

积分
83
板凳
armM0 发表于 2016-4-18 19:36:23 | 只看该作者
本帖最后由 armM0 于 2016-4-18 19:38 编辑

顶。我的也是。我使用的是硬件方式,不是IO口模拟IIC时序的。
在nRF51寄存器说明书v3.0.pdf第145页,
28.3 Shared resources
The TWI shares registers and other resources with other peripherals that have the same ID as the TWI.
Therefore, you must disable all peripherals that have the same ID as the TWI before the TWI can be
configured and used. Disabling a peripheral that has the same ID as the TWI will not reset any of the
registers that are shared with the TWI. It is therefore important to configure all relevant TWI registers
explicitly to secure that it operates correctly.
The Instantiation table in Instantiation on page 17 shows which peripherals have the same ID as the TWI.
17页:
ID Base address  Peripheral    Instance     Description
4 0x40004000   SPI        SPI1      SPI master 1
4 0x40004000   SPIS       SPIS1      SPI slave 1
4 0x40004000   TWI       TWI1      Two-wire interface master 1

以上说明twi和spi共用一个ID,请教各位:如何禁用SPI,SPIS,只保留TWI的ID?
回复 支持 反对

使用道具 举报

Archiver|手机版|小黑屋|Comsenz Inc.   

GMT+8, 2024-5-7 06:37 , Processed in 0.144037 second(s), 28 queries .

Powered by Discuz! X3

© 2001-2013 Comsenz Inc.

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