Toggle navigation
首页
问答
文章
积分商城
专家
专区
更多专区...
文档中心
返回主站
搜索
提问
会员
中心
登录
注册
RT-Thread English
STM32 + i2c = I found BUG
发布于 2012-09-24 22:28:51 浏览:9702
订阅该版
Hi all! I'm trying to write for RT-Thread on STM32F103VE MCU. And my first try was i2c bus. I use componentsdriversi2c as base and add my own stm32_i2c.c realization. But when I call rt_i2c_core_init() which call ```return rt_mutex_init (&i2c_core_lock, "i2c_core_lock", RT_IPC_FLAG_FIFO);``` this mutex created in NULL thread and can't be used. Any try to access this mutex will make FAULT. For what this done? Sorry for my English. But it better than my Chinese [s:157]
查看更多
6
个回答
默认排序
按发布时间排序
aozima
2012-09-24
调网络不抓包,调I2C等时序不上逻辑分析仪,就像电工不用万用表!多用整理的好的文字,比截图更省流量,还能在整理过程中思考。
``` void rt_init_thread_entry(void* parameter) { #ifdef RT_USING_I2C rt_i2c_core_init(); rt_hw_i2c_init(); #endif } ```
Spider
2012-09-24
这家伙很懒,什么也没写!
I understand that i2c device can be initialized only from custom thread? I trying to init it from startup.c Right?
bloom5
2012-09-24
这家伙很懒,什么也没写!
yeah , usually it should be initialized from your own init thread,i2c device and all other devices but usart should/is recommandded to initialized from thread, and the usart device can be initialized from the startup step,and which is somewhat necessary to print the init infos.
grissiom
2012-09-26
这家伙很懒,什么也没写!
IIRC, it is recommended to init devices in a thread context. Because some initialization might be blocked.
ralfak
2014-05-21
这家伙很懒,什么也没写!
这个bug还存在,理论上讲,一个i2c外设也不可能register多个i2cbus设备,所以互斥量i2c_core_lock完全没意义,只需要lock自身所带的mutex就行了
撰写答案
登录
注册新账号
关注者
0
被浏览
9.7k
关于作者
Spider
这家伙很懒,什么也没写!
提问
1
回答
1
被采纳
0
关注TA
发私信
相关问题
1
Welcome to RT-Thread RTOS English discussion
2
good!
3
The speed of external SRAM of STM32
4
RT-Thread on ST Forum
5
Splay Tree
6
More RTGUI screenshot
7
STM32 pimer2
8
mini2440 support
9
Howto Run RT-Thread 0.4.0 on QEMU/mini2440
10
RT-Gui : how can use it?
推荐文章
1
RT-Thread应用项目汇总
2
玩转RT-Thread系列教程
3
国产MCU移植系列教程汇总,欢迎查看!
4
机器人操作系统 (ROS2) 和 RT-Thread 通信
5
【技术三千问】之《玩转ART-Pi》,看这篇就够了!干货汇总
6
五分钟玩转RT-Thread新社区
7
关于STM32H7开发板上使用SDIO接口驱动SD卡挂载文件系统的问题总结
8
STM32的“GPU”——DMA2D实例详解
9
RT-Thread隐藏的宝藏之completion
10
【ART-PI】RT-Thread 开启RTC 与 Alarm组件
最新文章
1
【睿擎工业平台试用】EtherCAT主站控制从站IO
2
【睿擎工业平台试用】硬件平台上手和Modbus功能使用
3
基于GD32F303从0搭建文件系统,挂载2个块设备到文件系统
4
rt thread 文件系统dfs挂载2个块设备
5
RT Thread 块设备注册
热门标签
RT-Thread Studio
串口
Env
LWIP
SPI
Bootloader
AT
Hardfault
CAN总线
ART-Pi
FinSH
DMA
USB
文件系统
RT-Thread
SCons
RT-Thread Nano
线程
MQTT
STM32
FAL
RTC
rt-smart
I2C_IIC
UART
cubemx
BSP
ESP8266
PWM
ota在线升级
WIZnet_W5500
packages_软件包
flash
freemodbus
GD32
潘多拉开发板_Pandora
ADC
编译报错
keil_MDK
定时器
flashDB
rt_mq_消息队列_msg_queue
ulog
socket
msh
中断
Debug
SFUD
C++_cpp
at_device
本月问答贡献
踩姑娘的小蘑菇
7
个答案
3
次被采纳
加缪
11
个答案
1
次被采纳
三世执戟
6
个答案
1
次被采纳
RTT_逍遥
5
个答案
1
次被采纳
用户名由3_15位
5
个答案
1
次被采纳
本月文章贡献
chejia12
9
篇文章
3
次点赞
纯白酱
2
篇文章
4
次点赞
Hlafklio
2
篇文章
1
次点赞
530china
1
篇文章
7
次点赞
rv666
1
篇文章
7
次点赞
回到
顶部
发布
问题
分享
好友
手机
浏览
扫码手机浏览
投诉
建议
回到
底部