failed command: READ DMA

[   50.641091] ata17.00: irq_stat 0x40000001
[   50.641092] ata17.00: failed command: READ DMA
[   50.641095] ata17.00: cmd c8/00:02:02:00:00/00:00:00:00:00/e0 tag 14 dma 1024 in
[   50.641095]          res 51/04:02:02:00:00/00:00:00:00:00/e0 Emask 0x1 (device error)
[   50.641095] ata17.00: status: { DRDY ERR }
[   50.641096] ata17.00: error: { ABRT }
[   50.641231] ata17.00: configured for UDMA/133 (device error ignored)
[   50.641241] ata17: EH complete
[   50.641281] ata17.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
[   50.641282] ata17.00: irq_stat 0x40000001
[   50.641283] ata17.00: failed command: READ DMA
[   50.641285] ata17.00: cmd c8/00:02:02:00:00/00:00:00:00:00/e0 tag 17 dma 1024 in
[   50.641285]          res 51/04:02:02:00:00/00:00:00:00:00/e0 Emask 0x1 (device error)
[   50.641286] ata17.00: status: { DRDY ERR }
[   50.641287] ata17.00: error: { ABRT }
[   50.641422] ata17.00: configured for UDMA/133 (device error ignored)
[   50.641432] ata17: EH complete
[   50.641472] ata17.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
[   50.641472] ata17.00: irq_stat 0x40000001
[   50.641474] ata17.00: failed command: READ DMA
[   50.641476] ata17.00: cmd c8/00:02:02:00:00/00:00:00:00:00/e0 tag 20 dma 1024 in
[   50.641476]          res 51/04:02:02:00:00/00:00:00:00:00/e0 Emask 0x1 (device error)
[   50.641476] ata17.00: status: { DRDY ERR }
[   50.641477] ata17.00: error: { ABRT }
[   50.641613] ata17.00: configured for UDMA/133 (device error ignored)
[   50.641624] sd 16:0:0:0: [sdg]  
[   50.641624] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[   50.641625] sd 16:0:0:0: [sdg]  
[   50.641625] Sense Key : Aborted Command [current] [descriptor]
[   50.641626] Descriptor sense data with sense descriptors (in hex):
[   50.641629]         72 0b 00 00 00 00 00 0c 00 0a 80 00 00 00 00 00 
[   50.641630]         00 00 00 02 
[   50.641630] sd 16:0:0:0: [sdg]  
[   50.641631] Add. Sense: No additional sense information
[   50.641631] sd 16:0:0:0: [sdg] CDB: 
[   50.641633] Read(10): 28 00 00 00 00 02 00 00 02 00
[   50.641635] ata17: EH complete
[   50.641678] ata17.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
[   50.641679] ata17.00: irq_stat 0x40000001
[   50.641680] ata17.00: failed command: READ DMA
[   50.641682] ata17.00: cmd c8/00:04:04:00:00/00:00:00:00:00/e0 tag 23 dma 2048 in
[   50.641682]          res 51/04:04:04:00:00/00:00:00:00:00/e0 Emask 0x1 (device error)
[   50.641683] ata17.00: status: { DRDY ERR }
[   50.641683] ata17.00: error: { ABRT }
[   50.641816] ata17.00: configured for UDMA/133 (device error ignored)
[   50.641826] ata17: EH complete
[   50.641871] ata17.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
[   50.641871] ata17.00: irq_stat 0x40000001
[   50.641873] ata17.00: failed command: READ DMA
[   50.641875] ata17.00: cmd c8/00:04:04:00:00/00:00:00:00:00/e0 tag 24 dma 2048 in
[   50.641875]          res 51/04:04:04:00:00/00:00:00:00:00/e0 Emask 0x1 (device error)
[   50.641876] ata17.00: status: { DRDY ERR }
[   50.641876] ata17.00: error: { ABRT }
[   50.642011] ata17.00: configured for UDMA/133 (device error ignored)
[   50.642022] ata17: EH complete
[   50.642067] ata17.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
[   50.642067] ata17.00: irq_stat 0x40000001
[   50.642068] ata17.00: failed command: READ DMA
[   50.642071] ata17.00: cmd c8/00:04:04:00:00/00:00:00:00:00/e0 tag 25 dma 2048 in
[   50.642071]          res 51/04:04:04:00:00/00:00:00:00:00/e0 Emask 0x1 (device error)
[   50.642071] ata17.00: status: { DRDY ERR }

[   50.642072] ata17.00: error: { ABRT }


在启动时刷出大量这样的错误日志,确认是硬盘坏掉了,最终是能启动起来,但是要刷大约120秒的这样的信息,这个盘并非是系统盘,使用来做raid5,当做存储用的,我的意思是希望在boot时并不来检测这样的信息,把系统盘加载完了就行了,不知道有没有什么方法


在网上搜了一些信息,都没有能解决,大多数的说法是acpi引起的,比如:问题

http://ubuntuforums.org/showthread.php?t=1034762&page=2http://ubuntuforums.org/showthread.php?t=1034762这个帖子,他的解决方法是在/etc/modprobe.d里加一个options.conf文件,里面内容为options libata noacpi=1

问题得到解决,我尝试了,并没有改变,仍然要刷120秒左右


比如这个帖子http://ubuntuforums.org/showthread.php?t=1853783是通过在启动项里加参数来解决的:

 /etc/default/grub里

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi=off pci=noacpi"

然后运行update-grub,更行一下grub,尝试后,刷此类信息的时间到时缩短了,这是在ubuntu下的结果,在opensuse下不行,会在boot时卡住了。


我猜想boot时和udev有关吧,但是没有任何的头绪,哎~~~~~~

要如何才能在boot时并不来检测这样的信息,把系统盘加载完了就行了呢????

这里留个记号,待以后有机会了再来解决这个问题了




### STM32硬件I2C配置与使用教程 #### 配置方法概述 STM32系列微控制器提供了集成的I2C接口,能够简化开发者的工作流程并提高数据传输效率。具体来说,在STM32F103C8T6型号中,内置有两个独立的I2C外设——I2C1和I2C2[^2]。 为了使这些外设正常工作,需要正确初始化相应的参数,比如设定从机地址、调整通信速率以及启用DMA传输等特性来适应不同的应用场景需求。 #### 初始化过程详解 当准备启动硬件I2C模块时,应该先完成如下几个重要步骤: - **开启时钟源**:确保目标I2Cx(x=1,2)对应的APB1总线上的时钟已经打开; - **设置GPIO引脚功能**:将SCL(Serial Clock Line) 和SDA (Serial Data Line)连接至指定的GPIO端口,并将其配置成复用推挽输出模式; - **配置I2C参数**: - 使用`I2C_InitTypeDef`结构体定义必要的属性,如频率(`I2C_ClockSpeed`)、应答方式(`I2C_AcknowledgedAddress`)等; - 对于主设备而言,还需指明期望访问的目标从器件地址; - **调用库函数进行实际初始化**:最后一步是执行官方提供的HAL或标准固件库里的相应API来进行最终确认,例如`HAL_I2C_Init()` 或者 `I2C_Init()`; 以上操作完成后即可让硬件I2C进入待命状态等待进一步指令[^4]。 #### 数据收发实例说明 一旦完成了上述准备工作之后,则可以通过编写简单的程序片段实现基本的数据交换逻辑。下面给出一段基于HAL库编写的Python风格伪代码用于展示如何向外部传感器发送命令读取返回值: ```python import stm32_hal as hal def read_sensor_data(sensor_address): i2c_handle = hal.I2C_HandleTypeDef() # Initialize the I2C handle with predefined settings. init_structure = { "ClockSpeed": 100000, "DutyCycle": hal.I2C_DUTYCYCLE_2, "OwnAddress1": 0, "AddressingMode": hal.I2C_ADDRESSINGMODE_7BIT, "DualAddressMode": hal.I2C_DUALADDRESS_DISABLE, "OwnAddress2": 0, "GeneralCallMode": hal.I2C_GENERALCALL_DISABLE, "NoStretchMode": hal.I2C_NOSTRETCH_DISABLE } i2c_handle.Init(**init_structure) if not hal.HAL_I2C_Master_Transmit(i2c_handle, sensor_address << 1, command_register, 1, timeout_ms): raise Exception("Failed to send register address") buffer_size = 3 data_buffer = bytearray(buffer_size) if not hal.HAL_I2C_Master_Receive(i2c_handle, sensor_address << 1, data_buffer, buffer_size, timeout_ms): raise Exception("Failed to receive data from slave device") return list(data_buffer) ``` 这段代码展示了怎样利用HAL库封装好的高级别APIs去控制具体的事务处理细节,从而达到高效便捷的目的。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值