RCM6700 need to share serial B between RS232 and writeUserBlock

writeUserBlock makes use of serial port B. Application uses all serial ports .Have not been successful in finding a way of serBopen(9600) … serBclose … writeUserBlock … serBopen(9600) . RS232 on SerB does not work again after writeUserBlock. (and writeUserBlock behaves oddly if serB has ever been opened.)

The RCM6700 uses a semaphore on the shared SPI lines of serial port B. You need to use SPIgetSemaphore() and SPIfreeSemaphore() to ensure that only one device accesses the port at a time.

And your serial device needs some sort of chip select so it doesn’t freak out at the data on TxB and RxB from other devices on the shared lines.

Don’t forget that when the RCM6700 starts up, it loads the firmware from serial flash.

Take a look at SPI_PORTB_UCOS.c or SPI_PORTB_COSTATE.c in Samples/RCM6700/Shared_SPI/ for an example of how to share SerB from an application using uC/OS-II or costates.