Toggle navigation
首页
问答
文章
积分商城
专家
专区
更多专区...
文档中心
返回主站
搜索
提问
会员
中心
登录
注册
RT-Thread English
STM32 + i2c = I found BUG
发布于 2012-09-24 22:28:51 浏览:9679
订阅该版
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
五分钟玩转RT-Thread新社区
6
【技术三千问】之《玩转ART-Pi》,看这篇就够了!干货汇总
7
关于STM32H7开发板上使用SDIO接口驱动SD卡挂载文件系统的问题总结
8
STM32的“GPU”——DMA2D实例详解
9
RT-Thread隐藏的宝藏之completion
10
【ART-PI】RT-Thread 开启RTC 与 Alarm组件
最新文章
1
RT-Thread 携手 Copilot:智能代码审查,加速开源协作
2
重磅预售!RT-Trace调试工具
3
基于RT-Thread的STM32F4开发第五讲——软件模拟I2C
4
关于vscode env gcc工具链下,使用其他下载器(cmsis-dap)的launch.json编写
5
新版OneNet的星火1号开发板例程适配(一)
热门标签
RT-Thread Studio
串口
Env
LWIP
SPI
AT
Bootloader
Hardfault
CAN总线
FinSH
ART-Pi
DMA
USB
文件系统
RT-Thread
SCons
RT-Thread Nano
线程
MQTT
STM32
FAL
RTC
rt-smart
I2C_IIC
cubemx
UART
ESP8266
WIZnet_W5500
BSP
ota在线升级
PWM
flash
packages_软件包
freemodbus
潘多拉开发板_Pandora
ADC
GD32
定时器
编译报错
flashDB
keil_MDK
socket
中断
rt_mq_消息队列_msg_queue
Debug
ulog
SFUD
msh
C++_cpp
at_device
本月问答贡献
出出啊
1524
个答案
343
次被采纳
小小李sunny
1444
个答案
290
次被采纳
张世争
821
个答案
179
次被采纳
crystal266
555
个答案
162
次被采纳
whj467467222
1222
个答案
149
次被采纳
本月文章贡献
Pai同学
7
篇文章
10
次点赞
RTT_逍遥
2
篇文章
8
次点赞
Rick98
1
篇文章
2
次点赞
河南理工大学恁带劲儿
1
篇文章
2
次点赞
加缪
1
篇文章
1
次点赞
回到
顶部
发布
问题
分享
好友
手机
浏览
扫码手机浏览
投诉
建议
回到
底部