This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Customer need to synchronise two ICE Boards V2 via SPI (Profinet R1 redundancy)
From Processor SDK RTOS documentation QSPI-McSPI, he found that this pin connection is neccessary:
EVM1(master)====EVM2(slave)
J3-Pin12(CLK)---------J3-Pin12(CLK)
J3-Pin14(MIS0)------- J3-Pin16(MISO)
J3-Pin16(MOSI)------- J3-Pin14(MOSI)
J3-Pin18(CS)-----------J3-Pin18(CS)
J3-Pin2(DGND)--------J3-Pin2(DGND)
In his main() he calls pin muxing routine Board_pinMuxConfig(iceV2Mux).
iceV2Mux:
PINMUX_config iceV2Mux[] = {
{CHIPDB_MOD_ID_GPIO,0,0},/*Configure used GPIO pins only*/
{CHIPDB_MOD_ID_GPIO,1,0},
{CHIPDB_MOD_ID_GPIO,2,0},
{CHIPDB_MOD_ID_GPIO,3,0},
{CHIPDB_MOD_ID_I2C,0,0},
{CHIPDB_MOD_ID_MCSPI,0,0},
{CHIPDB_MOD_ID_MCSPI,1,0},
{CHIPDB_MOD_ID_PRU_ICSS,1,0},
{0xFFFFFFFF,0,0}
};
in pdk_am335_1_0_6 he found this c-file: main-mcspi_slave_mode.c.
Question:
- Is this code able to build up a connection between two ICE baords or is there another function to setup spi connection ?
- Is his PINMUX_Config correct ?
Lali,
any answers ?
Meanwhile customer initiates SPIObj type mcspiCfgObj_t with values of master-mode and slave-mode for each board.
(I will send you code separtely via email, see MCSPI_DEFAULT_MASTER MCSPI_DEFAULT_SLAVE).
On ICE board is running SPITaskMasterBoard on other ICE Board SPITaskSlaveBoard (see source).
He need to send a frame from master to slave and receive with slave (see source).
SPI function is used from industrial_sdk\starterware\dal\mcspi.c
What is running well so far:
On ICE as SPI master with MCSPI_TRANSFER_MODE_TX_RX, /* txRxMode.*/ MCSPI_DATA_LINE_COMM_MODE_2, /* pinMode. */ ( rest of settings are unchanged see source: MCSPI_DEFAULT_MASTER) ,Frame from masterTxBuff[15] = { "Master-Test" } I can send and receive with ReciveData back.
Questions:
Until now slave is stucking in while loop:
while(((MCSPIChStatus(mySpiObj->instAddr, mySpiObj->channelNum) & MCSPI_CHSTAT_RXS_MASK) == 0);
SOurce is sent by email.
DJ-NG,
What code base was used to write the code? PDK MyExampleProjects?
I assume you are aware that we have an ICEv2 McSPI Master and slave example in the latest PDK which can be used in a board-board setting?
C:\ti\pdk_am335x_1_0_6\packages\MyExampleProjects\MCSPI_SlaveMode_SlaveExample_icev2AM335x_armExampleProject
C:\ti\pdk_am335x_1_0_6\packages\MyExampleProjects\MCSPI_SlaveMode_MasterExample_icev2AM335x_armExampleProject
Lali
Hey Lali,
I use the code from the industrial_sdk\starterware/dal/mcspi.c
My problem is I am nor sure which settings I have to use for mastermode and for slavemode to transmit and receive data.
Best regards
Felix