我希望找到一些帮助,即使这个问题可能是硬件而不是软件相关(我们会看到).我正在开发基于Freescales P1021处理器(ppc,e500v2核心)的定制电路板.外部PCB将连接,可由SPI配置.该外部PCB的规格读取为全双工模式下的2字节命令,并且只有最后一个字节用于在MISO上传输数据.
知道这一点,我目前正在准备一些软件来测试这个设备.所以我从众所周知的spi_test程序开始.
root@p1021rdb:~# ./spi_test -D /dev/spidev32766.3
spi mode: 0
bits per word: 8
max speed: 500000 Hz (500 KHz)
00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00
00 00
root@p1021rdb:~#
Run Code Online (Sandbox Code Playgroud)

信号显示608个时钟,似乎上半部分只有数据.我决定用loopback调查和测试它 - 切割MOSI-MISO将数据循环回rx缓冲区.结果:
root@p1021rdb:~# ./spi_test -D /dev/spidev32766.3
spi mode: 0
bits per word: 8
max speed: 500000 Hz (500 …Run Code Online (Sandbox Code Playgroud) 我使用Jenkins(在Windows机器上)作业通过Ant为不同的目标编译一些代码.为此,我将调用包含在(windows)批处理循环中的ant目标中,如下所示:
@echo off
for %%t in (target1 target2 target3) do (
ant -f build.xml build -DPARAM_TARGET=%%t
)
Run Code Online (Sandbox Code Playgroud)
这是我的第一个想法......但即使(例如)target1失败,这些代码也会导致成功构建.因此,我在Windows批处理构建步骤中添加了更多行,以获得更多概述.另外,我已经知道代码来获得与Jenkins相同的工作空间到我的本地机器并添加一个test.bat来检查windows批处理代码是否可以工作.
@echo off
for %%t in (target1 target2 target3) do (
ant -f build.xml build -DPARAM_TARGET=%%t
echo ELVL: %ERRORLEVEL%
IF NOT %ERRORLEVEL% == 0 (
echo ABORT: %ERRORLEVEL%
exit /b %ERRORLEVEL%
) ELSE (
echo PROCEED: %ERRORLEVEL%
)
)
Run Code Online (Sandbox Code Playgroud)
在我的本地Windows机器上测试这个显示预期的行为 - 这里成功:
BUILD SUCCESSFUL
Total time: 3 seconds
ELVL: 0
PROCEED: 0
Run Code Online (Sandbox Code Playgroud)
失败时:
BUILD FAILED
C:\Work\...
C:\Work\...
Total time: 0 seconds
ELVL: 9009 …Run Code Online (Sandbox Code Playgroud)