Other Parts Discussed in Thread: SYSBIOS
Tool/software: TI-RTOS
Hello everybody ,
Actually Im doing work with AM65xx processor IDK von Family Sitara and i m already finish with the setup and install SDK RTOS 5.01 now I have to start with diagnostic for MCSPI, I already used the rtos_template_app_am65xx_a53 as Project to create my program . I created the test Program as a Task , and I called it in my main File , butt i got errors (look pleas at the Picture Fehler), I can’t fixed it. Can anyone pleas checkout my program and tell me how can I fixed this errors.
Best regrades
Anas
/**
*
* \brief Template application tasks file:
* This template application exercises multiple tasks and
* peripherals. The different task functions are run under
* separate Tasks in TI BIOS.
* The appTasksCreate function creates the different tasks.
* More tasks can be added in this function as required.
*/
/* Standard header files */
#include <string.h>
/*
30.11.18
for Use Mailbox, neet to include this header file
#include <ti/sysbios/knl/Mailbox.h>*/
/* XDCtools Header files */
#include <xdc/std.h>
#include <xdc/cfg/global.h>
#include <xdc/runtime/System.h>
#include <xdc/runtime/Error.h>
/* Local template app header file */
#include "app.h"
#include "SPI_log.h"
/* SPI Header files */
#include <ti/drv/spi/soc/SPI_soc.h>
#include <ti/drv/spi/SPI.h>
#include <ti/drv/spi/MCSPI.h>
/* MACROS*/
/* Test channel # */
#define MCSPI_TEST_CHN 0
/* Maximum # of channels per SPI instance */
#define MCSPI_MAX_NUM_CHN 4
/**
* @brief Function spi_test_task : Execute read on SPI bus
*
* @param[in] arg0, arg1: Arguments ( Currently not used)
* @retval none
*/
void mcspi_test_task(UArg arg0, UArg arg1)
{
//has been Changed from (Anas Mekkaoui ID:A0238198)
SPI_HWAttrs spi_cfg;
// SPI_v1_HWAttrs spi_cfg;
uint32_t instance;
uint32_t txBuf,rxBuf,len;
uint32_t terminateXfer = 0;
MCSPI_Params spiParams;
MCSPI_Handle spi[MCSPI_MAX_NUM_CHN];
/* Transaction data */
SPI_Transaction* transaction;
bool transferOk;
bool testPassed = true;
/* Soc configuration structures indexing starts from 0. If the IP
* instances start with 1, to address proper Configuration
* structure index, McSPI Instance should be substracted with 1
*/
instance=BOARD_MCSPI_MASTER_INSTANCE;
/* Set the default SPI init configurations */
SPI_socSetInitCfg(instance, &spi_cfg);
appPrint("\n spi_test task started");
/* Default SPI configuration parameters */
/* Initialize SPI handle */
/* SPI params structure */
MCSPI_Params_init(&spiParams);
/* Init SPI driver */
SPI_init();
spiParams.transferMode=SPI_MODE_BLOCKING;
spiParams.transferCallbackFxn=NULL;
spi[MCSPI_TEST_CHN]= MCSPI_open(instance, MCSPI_TEST_CHN,&spiParams);
if (!spi[MCSPI_TEST_CHN])
{
testPassed = false;
goto err;
}
/*At this point, the SPI driver is ready to block-mode data transfer for a particular instance identified by Handle */
/* TODO: Add SPI functionality test here */
// while(1){
//
// }
/* Write Command */
txBuf=0xA5A5A5A5; /* Test data 32bit*/
len=sizeof(txBuf);
transaction->txBuf=(UInt8 *)&rxBuf; /* Buffer to be written */
transaction->rxBuf=(UInt8 *)&txBuf;/* Buffer holding the received data */
transaction->count=len;/* Transfer Length ,transCount: Number of frames for this transaction */
transaction->arg=(void *)&terminateXfer;
transferOk=MCSPI_transfer(spi[MCSPI_TEST_CHN], transaction);/* Perform SPI transfer */
if (!transferOk)
{
/* SPI transaction failed */
testPassed=false;
goto err;
}
SPI_log("\n Received Data : %x. \n", rxBuf);
if (txBuf != rxBuf)
{
testPassed=false;
MCSPI_close(spi[MCSPI_TEST_CHN]);
}
err:
if(true == testPassed)
{
SPI_log("\n All tests have passed. \n");
}
else
{
SPI_log("\n Some tests have failed. \n");
}
Task_sleep(10);
appPrint("\n spi_test task ended");
Task_exit();
}