spi

Initializating SanDisk SD card using SPI fails after doing HW reset

狂风中的少年 提交于 2019-12-05 18:49:35
I am using an STM32 micrcocontroller to interface an SD card memory using the SPI peripheral. I have done tests with 2Gb , 4Gb , 8Gb and 16Gb SanDisk cards. When I perform a reset with the 2Gb and 8Gb cards , nothing happens and I keep going with my tests. However, with 4Gb and 16Gb , once the reset is performed intialization fails . In fact , at the first insert in the SD slot , these cards are quite good initialized but one I perform the reset it does'nt pass. When I tried to debug this problem, I discovered that when dealing a reset the response to command CMD0 is wrong . I get 0x00 instead

SPI_IOC_MESSAGE(N) macro giving me fits

余生长醉 提交于 2019-12-05 18:43:25
I'm having trouble getting a SPI program I'm working on to behave correctly and it seems to be some issue with the SPI_IOC_MESSAGE(N) macro. Here's sample code that DOESN'T work (ioctl returns EINVAL (22) ): std::vector<spi_ioc_transfer> tr; <code that fills tr with 1+ transfers> // Hand the transmission(s) off to the SPI driver if (tr.size() > 0) { int ret = ioctl(fd, SPI_IOC_MESSAGE(tr.size()), tr.data()); if (ret < 1) { int err = errno; } } My test code right now is creating a vector of length 1. If I explicitly change the code to: int ret = ioctl(fd, SPI_IOC_MESSAGE( 1 ), tr.data()); ..

What makes SPI faster than I2C protocol [closed]

不打扰是莪最后的温柔 提交于 2019-12-05 17:14:41
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I know the basic of I2C and SPI communication. As both are synchronous protocol. I wanted to know that what makes SPI faster than I2C. If I am not wrong using I2C we can go used 400kbps while in SPI we can achieve 10mbps also. Does it because of hardware change? This question was asked to me in one of the

Serial versus SPI

与世无争的帅哥 提交于 2019-12-05 15:04:41
问题 What is the difference between SPI and serial? In reading an article talking about inter-processor communications, it states that serial interfaces are being replaced with SPI for better/faster comms? What exactly is the difference? 回答1: The word "serial" doesn't mean much. But I'll assume that you are talking about traditional serial communication standards. What's fundamentally different about SPI is that it is synchronous . As opposed to, say, RS-232, an asynchronous signaling standard. An

wk2124 在 rk3288 上的适配与调试

若如初见. 提交于 2019-12-05 14:37:56
2019-11-25 关键字:linux驱动开发、arm驱动适配、kernel开发、SPI转串口 WK2124 是一款 SPI 接口的 4 通道 UART 芯片。说白了就是一款通过 SPI 协议与 CPU 通信并对外表现出具备 4 个 232 串口功能的扩展芯片。它适用于 CPU 引脚资源不够或紧缺的情况,它的最高通信速率能达到 10Mbps。 本篇文章记述的是 WK2124 芯片在软件上的适配过程,属于软件开发范畴。但其实大家都知道,干到驱动这一层,对硬件电路一窍不通的话那是真干不下去。就拿这块芯片的软件层适配来说,我们需要的官方文档有: 1、芯片datasheet; 2、参考驱动程序; 3、参考原理图。 这些文件一般芯片厂商会提供,笔者这里也准备好了一份文件,有需要的可以直接下载: https://pan.baidu.com/s/1tpjTmRO5xgQXF-w7YsUqdA 提取码: juz1 首先来看看 WK2124 的引脚封装,如下图所示: 对于我们来说,在适配阶段需要关心的脚就 5 个,如上图标红框处所示。这些引脚的功用,datasheet 上都已有很详尽的说明: SPI 通信引脚在笔者的 3288 样机上所连接的 CPU 引脚是 SPI2,如下图所示: IRQ 脚在笔者的 3288 样机上所连接的 CPU 引脚是 GPIO7_A2,如下图所示: 然后,还有一个最重要的

0.树莓派3上安装配置Archlinux

北战南征 提交于 2019-12-05 09:15:00
本文永久地址:https://my.oschina.net/bysu/blog/1557801 1 下载: 下载(不得不吐槽,官网上的指引好像下载不了,还是我没找对,反正找了好久) 到http://sg.mirror.archlinuxarm.org/os/中下载 或直接到下面链接下载 http://sg.mirror.archlinuxarm.org/os/ArchLinuxARM-rpi-3-latest.tar.gz 顺便贴上fedora的下载地址: https://mirrors.tuna.tsinghua.edu.cn/fedora/releases/26/Spins/armhfp/images/Fedora-LXQt-armhfp-26-1.5-sda.raw.xz centos7的下载地址 http://mirror.centos.org/altarch/7/isos/armhfp/CentOS-Userland-7-armv7hl-Minimal-1708-RaspberryPi3.img.xz 2 安装Archlinux 安装Archlinux这部分在Linux系统中测试通过。 sdX 是SD卡盘符。 譬如我通过fdisk -l查到是/dev/sdb1,那么这里就是sdb.说明

提升不止一点点,Dubbo 3.0 预览版详细解读,还愣着干啥啊?进来啊

北战南征 提交于 2019-12-05 08:21:05
Dubbo 自 2011 年 10 月 27 日开源后,已被许多非阿里系的公司使用,其中既有当当网、网易考拉等互联网公司,也不乏中国人寿、青岛海尔等大型传统企业。 自去年 12 月开始,Dubbo 3.0 便已正式进入开发阶段,并备受社区和广大 Dubbo 用户的关注,本文将为您详细解读3.0 预览版的新特性和新功能。 下面先解答一下两个有意思的与 Dubbo 相关的疑问。 · 为什么 Dubbo 一开源就是 2.0 版本?之前是否存在 1.0 版本? 笔者曾做过 Dubbo 协议的适配兼容,Dubbo 确实存在过 1.x 版本,而且从协议设计和模型设计上都与 2.0 的开源版本协议是完全不一样的。下图是关于 Dubbo 的发展路径: · 阿里内部正在使用 Dubbo 开源版本吗? 是的,非常确定,当前开源版本的 Dubbo 在阿里巴巴被广泛使用,而阿里的电商核心部门是用的 HSF2.2 版本,这个版本是兼容了 Dubbo 使用方式和 Remoting 协议。当然,我们现在正在做 HSF2.2 的升级,直接依赖开源版本的 Dubbo 来做内核的统一。所以,Dubbo 是得到大规模线上系统验证的分布式服务框架,这一点毋容置疑。 Dubbo 3.0 预览版的要点 Dubbo 3.0 在设计和功能上的新增支持和改进,主要是以下四方面: · Dubbo 内核之 Filter 链的异步化

Linux 设备树学习——基于i2c总线分析

↘锁芯ラ 提交于 2019-12-05 04:26:04
目录 博客说明 开发环境 1. 如何使用设备树 1.1 u-boot支持设备树 1.2 Linux内核支持设备树 1.3 如何在开发板中使用设备树 2. 设备树介绍 2.1 设备树中的设备驱动节点 2.2 设备树匹配流程 2.2.1 以i2c匹配为例 2.2.2 设备树匹配下的程序模板 2.3 设备树中的设备节点转换 附录 参考资料 @(Linux 设备树——基于i2c总线分析) 博客说明 撰写日期 2019.11.18 完稿日期 2019.11.20 最近维护 暂无 本文作者 multimicro 联系方式 multimicro@qq.com 资料链接 本文无附件资料 GitHub https://github.com/wifialan/drivers/tree/master/device_tree_i2c 原文链接 https://blog.csdn.net/multimicro/article/details/103129546 开发环境 环境说明 详细信息 备注信息 操作系统 Ubunut 18.04 开发板 JZ2440-V3 u-boot uboot-2012.04.01 busybox busybox-1.22.1 u-boot和busybox编译器 arm-linux-gcc (4.4.3) Linux内核 linux-4.19-rc3 Linux内核编译器 arm

java中高级并发SPI机制

偶尔善良 提交于 2019-12-04 20:55:44
Java SPI 实际上是“基于接口的编程+策略模式+配置文件”组合实现的动态加载机制。 适用于:调用者根据实际使用需要,启用、扩展、或者替换框架的实现策略。 要使用Java SPI,需要遵循如下约定: 1、当服务提供者提供了接口的一种具体实现后,在jar包的META-INF/services目录下创建一个以“接口全限定名”为命名的文件,内容为实现类的全限定名; 2、接口实现类所在的jar包放在主程序的classpath中; 3、主程序通过java.util.ServiceLoder动态装载实现模块,它通过扫描META-INF/services目录下的配置文件找到实现类的全限定名,把类加载到JVM; 4、SPI的实现类必须携带一个不带参数的构造方法; 实例代码: 步骤1: 接口 实现1 实现2 步骤2 、在 src/main/resources/ 下建立 /META-INF/services 目录, 新增一个以接口命名的文件 (com.xxx.xxx.xxx.TestSpiService 文件),内容是要应用的实现类(这里是com.xxx.xxx.xxx.TestSpiServiceImp01和com.xxx.xxx.xxx.TestSpiServiceImp02,每行一个类)。 文件位置 - src -main -resources - META-INF - services -

什么是SPI

时间秒杀一切 提交于 2019-12-04 19:57:46
一、什么是SPI   SPI ,全称为 Service Provider Interface,是一种服务发现机制。它通过在ClassPath路径下的META-INF/services文件夹查找文件,自动加载文件里所定义的类。 这一机制为很多框架扩展提供了可能,比如在Dubbo、JDBC中都使用到了SPI机制。我们先通过一个很简单的例子来看下它是怎么用的。 1.1、小例子   首先,我们需要定义一个接口,SPIService 1 package com.viewscenes.netsupervisor.spi; 2 public interface SPIService 3 { 4 void execute(); 5 }   然后,定义两个实现类,没别的意思,只输入一句话。 1 package com.viewscenes.netsupervisor.spi; 2 public class SpiImpl1 implements SPIService 3 { 4 public void execute() 5 { 6 System.out.println("SpiImpl1.execute()"); 7 } 8 } 9 ----------------------我是乖巧的分割线---------------------- 10 package com.viewscenes