MQX 4.0.2 can't open SPI2

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MQX 4.0.2 can't open SPI2

Jump to solution
1,722 Views
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?

Labels (3)
1 Solution
1,347 Views
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

View solution in original post

5 Replies
1,348 Views
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,347 Views
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 Kudos
Reply
1,347 Views
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,347 Views
karina_valencia
NXP Apps Support
NXP Apps Support

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

0 Kudos
Reply
1,347 Views
karina_valencia
NXP Apps Support
NXP Apps Support

timesyssupport  can you help on this case?