[En-Nut-Discussion] SPI on Arm7 (EIR) Board

Wiegelmann, Jörg Joerg.Wiegelmann at ces-tronics.de
Wed Sep 7 13:33:30 CEST 2011


Dear folks,

With a lot of work I switched to the newest operationsystem direct from the NutOs trunk.

I changed from the old proprietary function with polling from the first EIR Implementation to the actual interrupt driven implementation.

I think I found one problem: 

With the line rc = NutEventWait(&node->node_bus->bus_mutex, tmo); a mutex is set to protect the bus from concurrent access.

IMHO this is not sufficient for a proper operation. A mutex has to protect the whole hardware-SPI-Interface. I have one Task for the SPI-Memory Access over CS0

and another Task for the display over CS2. With the new implementation the bus-transfer crashed, when the software waits for completion of the transfer at

NutEventWait(&node->node_bus->bus_ready, NUT_WAIT_INFINITE) in At91SpiBus0Transfer  and at the same time another transfer is starting on a different chipselect. 

I'm a right or did I miss something????

My proposal is to remove the CS dependent mutex and insert one spi-hardware-mutex. 

 

Thank you and best regards 

Joerg

 

 




More information about the En-Nut-Discussion mailing list