MQX 4.0.2 can't open SPI2

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

MQX 4.0.2 can't open SPI2

跳至解决方案
1,723 次查看
sandrobastos
Contributor IV

Hi,

I'm using TWR-VF65GS10 with IAR and MQX 4.0 and only can open SPI0 with "fopen ("spi0:", NULL)", if I try to open "spi1:" or "spi2:" the fopen() returns NULL.

Yes, I already enabled them im 'user_config.h', rebuilt, and I've checked in 'init_bsp' and they are being installed:

#if BSPCFG_ENABLE_SPI0

    _io_spi_install("spi0:", &_bsp_spi0_init);

#endif

#if BSPCFG_ENABLE_SPI1

    _io_spi_install("spi1:", &_bsp_spi1_init);

#endif

#if BSPCFG_ENABLE_SPI2

    _io_spi_install("spi2:", &_bsp_spi2_init);

#endif

My code is running at the A5 processor.

Any idea?

标签 (3)
1 解答
1,348 次查看
cyborgnegotiato
Senior Contributor II

Hi Sandro,

Your problem is in _io_spi_install which fail. This situation occurs because missing support for spi1 and spi2 in initialization function _bsp_dspi_io_init (tower board BSP has initializations for spi0, only) - this function simple return -1 (error).

Add code which setup iomux (for your spi connection) to the _bsp_dspi_io_init. It may be sufficient.

JM

在原帖中查看解决方案

5 回复数
1,349 次查看
cyborgnegotiato
Senior Contributor II

Hi Sandro,

Your problem is in _io_spi_install which fail. This situation occurs because missing support for spi1 and spi2 in initialization function _bsp_dspi_io_init (tower board BSP has initializations for spi0, only) - this function simple return -1 (error).

Add code which setup iomux (for your spi connection) to the _bsp_dspi_io_init. It may be sufficient.

JM

1,348 次查看
sandrobastos
Contributor IV

Hi, thank you all,

I'll use the SPI0 since its pins are available at the TWR connectors (they are repeated in TWR-SPI0 and TWR-SPI2); I thought SPI2 at TWR connector was connected with Vybrid DSPI2 but it isn't.

bye

0 项奖励
回复
1,348 次查看
timesyssupport
Senior Contributor II

If you used the MQX Installer for Linux to install your MQX sources, there was a patch applied to the MQX sources in order to prevent a device conflict if both Linux and MQX are running on the target. This patch changed the default DMA base pointers and SPI channels used by MQX. You can try reversing the attached patch if you are not using Linux on your target - but it probably is not the cause of the issue, as it affects DSPI0 functionality similarly to DSPI1. I would recommend contacting the MQX team to have their input on this issue.

Thanks,

Timesys Support

1,348 次查看
karina_valencia
NXP Apps Support
NXP Apps Support

juangutierrez can you check  previous update from Timesys and add your comments?

0 项奖励
回复
1,348 次查看
karina_valencia
NXP Apps Support
NXP Apps Support

timesyssupport  can you help on this case?