AnsweredAssumed Answered

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

Question asked by lumi on Dec 9, 2013
Latest reply on Sep 24, 2014 by Erik Isaksson

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

Outcomes