Can I open multiple file descriptors in MQX 4.0 for an SPI channel in MCF52259?

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

Can I open multiple file descriptors in MQX 4.0 for an SPI channel in MCF52259?

477 Views
lumi
Contributor II

Hi,

I'm working with MCF52259 in a bsp/psp modified from the tower board provided.

According to MQXIOUG rev 18, section 9.6 "Using the driver", I should be able to open multiple file handles to the same SPI channel, each using different Chip Selects (CS).

The paragraph reads:

"As described above, the SPI driver may be concurrently used from multiple tasks using multiple file

handles without needing any additional locking or synchronization in the application since the bus

reservation mechanism, internal to the SPI driver, prevents collisions in multitasking environment."

However, when I try something like this:

Task1:

     f1 = fopen("spi0:", NULL);

...and...

Task 2:

     f2 = fopen("spi0:", NULL);

, the second fopen fails. Making f2 equal to NULL.

Am I missing something? How can I really open two file descriptors for the same SPI channel?

Thanks

0 Kudos
1 Reply

299 Views
erikisaksson
Contributor I

Hi,

Same question, but MQX 4.1 for MCF52259.

I get the feeling that legacy SPI driver is still included, since there is both a spi_int and spi_pol...?

BR,

Erik

0 Kudos