请问你是跑的那个EVM下的mcspi例程?
有无仔细查看MCSPIPINMUXSETUP函数?
如果选择了evmAM335X下的话,就会存在问题。因为其在该函数中会读取profile的值。
C:tiAM335X_StarterWare_02_00_01_01buildarmv7acgt_ccsam335xevmAM335x
而如果你用该程序跑在自己的板子上,就无法读取profile的值,因而就profile默认是0,就无法运行正确的配置。
int McSPIPinMuxSetup(unsigned int instanceNum) [ unsigned int profile = 0; int status = E_INST_NOT_SUPP;
if(MCSPI_INSTANCE == instanceNum) [ profile = EVMProfileGet();
switch (profile) [ case MCSPI_EVM_PROFILE: HWREG(SOC_CONTROL_REGS + CONTROL_CONF_SPI0_SCLK) = (CONTROL_CONF_SPI0_SCLK_CONF_SPI0_SCLK_PUTYPESEL | CONTROL_CONF_SPI0_SCLK_CONF_SPI0_SCLK_RXACTIVE); HWREG(SOC_CONTROL_REGS + CONTROL_CONF_SPI0_D0) = (CONTROL_CONF_SPI0_SCLK_CONF_SPI0_SCLK_PUTYPESEL | CONTROL_CONF_SPI0_SCLK_CONF_SPI0_SCLK_RXACTIVE); HWREG(SOC_CONTROL_REGS + CONTROL_CONF_SPI0_D1) = (CONTROL_CONF_SPI0_SCLK_CONF_SPI0_SCLK_PUTYPESEL | CONTROL_CONF_SPI0_SCLK_CONF_SPI0_SCLK_RXACTIVE); status = S_PASS; break; default: status = E_INVALID_PROFILE; break; ] ] return status; ]
请问你是跑的那个EVM下的mcspi例程?
有无仔细查看MCSPIPINMUXSETUP函数?
如果选择了evmAM335X下的话,就会存在问题。因为其在该函数中会读取profile的值。
C:tiAM335X_StarterWare_02_00_01_01buildarmv7acgt_ccsam335xevmAM335x
而如果你用该程序跑在自己的板子上,就无法读取profile的值,因而就profile默认是0,就无法运行正确的配置。
int McSPIPinMuxSetup(unsigned int instanceNum) [ unsigned int profile = 0; int status = E_INST_NOT_SUPP;
if(MCSPI_INSTANCE == instanceNum) [ profile = EVMProfileGet();
switch (profile) [ case MCSPI_EVM_PROFILE: HWREG(SOC_CONTROL_REGS + CONTROL_CONF_SPI0_SCLK) = (CONTROL_CONF_SPI0_SCLK_CONF_SPI0_SCLK_PUTYPESEL | CONTROL_CONF_SPI0_SCLK_CONF_SPI0_SCLK_RXACTIVE); HWREG(SOC_CONTROL_REGS + CONTROL_CONF_SPI0_D0) = (CONTROL_CONF_SPI0_SCLK_CONF_SPI0_SCLK_PUTYPESEL | CONTROL_CONF_SPI0_SCLK_CONF_SPI0_SCLK_RXACTIVE); HWREG(SOC_CONTROL_REGS + CONTROL_CONF_SPI0_D1) = (CONTROL_CONF_SPI0_SCLK_CONF_SPI0_SCLK_PUTYPESEL | CONTROL_CONF_SPI0_SCLK_CONF_SPI0_SCLK_RXACTIVE); status = S_PASS; break; default: status = E_INVALID_PROFILE; break; ] ] return status; ]
举报