This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

OMAP138L-Linux4.19内核-SPI驱动问题



如题,

OMAP138L,SPI1挂载2片SPI Flash, 运行linux4.19内核, 对SPI1做了pinmux引脚复用,

采用DMA模式,(POLL模式会提示出现 SPI Bit Error的报错)

在内核启动过程中,固定有一个flash读ID的值为全F,并会出现 SPI Bit Error的报错;

对flash也不能进行正确的读写(出现 SPI Bit Error的报错)

  • 请问用的什么型号的spi flash?是自制板还是TI EVM?
    以下是TRM中对Bit Error报错的说明,可以参考看一下:
    This bit is set when a mismatch of internal transmit data and transmitted data is detected. The SPI
    samples the signal of the transmit pin (master: SPIx_SIMO, slave: SPIx_SOMI) at the receive point
    (half clock cycle after transmit point). If the sampled value differs from the transmitted value a bit
    error is detected and the flag is set. A possible reason for a bit error can be a too high bit
    rate/capacitive load or another master/slave trying to transmit at the same time.
    降低SPI比特率,看看问题是否仍然存在。
    检查波形看一下有没有问题。
    如果使用SPI0或其他CS,问题是否仍然存在?
    请确保SPI flash和OMAPL138的模式匹配,比如时钟极性和相位是否匹配?
  • 另外一个flash是可以正确读写的是吗?出错的flash接在哪个cs管脚?配置和另外一个flash的配置流程一样吗?
  • 1、型号 2片都是n25q128;

    2、自制板;

    3、spi时钟原设定频率为30Mhz,改过1Mhz,问题存在;

    4、不是时钟极性、相位;

    5、看过手册对该位的描述了,正如您给的英文段落一样;

    6、不具备使用SPI0调试的条件;

    7、试过将两个spi flash 的片选线反接;

    以上均不可;

    后在另一块板子上将spi flash模式设置为SPI_MODE_0(之前是SPI_MODE_3),SPI_IO_TYPE_DMA类型之前是(POLL),

    内核可认出2片flash,并可正常操作。但这个内核在我这块板子还是不行。

    结论:
     初步判断是我这块板子的flash可能因为来回焊接翘起引脚等因素,flash坏掉了。

  • 都一样的,初步怀疑是flash芯片坏掉
  • 好的,那您换块flash试试,如果还是不行的话,再看看是不是软件问题。