Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

RTOS/TM4C1294NCPDT: TM4C1294NCPDT TI-RTOS gives exception when using global(NDK stack)

$
0
0

Part Number:TM4C1294NCPDT

Tool/software: TI-RTOS

Respected sir,

                     Please reply as soon as possible. Its urgent.

                      I am trying to integrate  tcpecho example into my code. But as soon as i add Globals in rtos for NDK, it starts giving exception at following line.

 SSIDataPut(SSI2_BASE, adcTxBuffer[0]);
 while(SSIDataGetNonBlocking(SSI2_BASE, &adcresult))
 {
 }

                   Without NDK my code works perfectly fine. As soon as i try to add NDK it start creating problem. I have attache snaps of problem.

(Please visit the site to view this file)

Also i have attached some important files.

(Please visit the site to view this file)

(Please visit the site to view this file)

(Please visit the site to view this file)

(Please visit the site to view this file)

(Please visit the site to view this file)

Also initialization of SPI is as follows

Void spiFxn (UArg arg0, UArg arg1)
{
// SPI_Handle masterSpi;
// SPI_Transaction masterTransaction;

//************************************SPI FOR DAC*************************************
/* Initialize SPI handle as default master */
SPI_Params spiParamsdac;
SPI_Params_init(&spiParamsdac);
spiParamsdac.transferMode = SPI_MODE_BLOCKING;
spiParamsdac.transferTimeout = SPI_WAIT_FOREVER;
spiParamsdac.transferCallbackFxn = NULL;
spiParamsdac.mode = SPI_MASTER;
spiParamsdac.bitRate = 1000000;
spiParamsdac.dataSize =8;
spiParamsdac.frameFormat =SPI_POL1_PHA1;
spiParamsdac.custom =(uintptr_t) NULL;
masterSpi = SPI_open(Board_SPI1, &spiParamsdac); // change the cs pin to GPIO
if (masterSpi == NULL) {
System_abort("Error initializing DAC_SPI\n");
}
else {
// System_printf("DAC_SPI initialized\n");
// System_flush();
}

/* Initialize master SPI transaction structure */
masterTransaction.count = SPI_MSG_LENGTH;
masterTransaction.txBuf = (Ptr)masterTxBuffer;
masterTransaction.rxBuf = (Ptr)masterRxBuffer;
GPIO_write(Board_LDAC, 0); // LDAC PIN OF DAC ALWAYS KEEP LOW
////***************************SPI FOR ADC*************************************************

SPI_Params spiParams;
SPI_Params_init(&spiParams);
spiParams.transferMode = SPI_MODE_BLOCKING;
spiParams.transferTimeout = SPI_WAIT_FOREVER;
spiParams.transferCallbackFxn = NULL;
spiParams.mode = SPI_MASTER;
spiParams.bitRate = 1000000;
spiParams.dataSize =16;
spiParams.frameFormat =SPI_POL1_PHA0;
spiParams.custom =(uintptr_t) NULL;
adcSpi = SPI_open(Board_SPI0, &spiParams);
if (adcSpi == NULL) {
System_abort("Error initializing ADC_SPI\n");
}
else {
// System_printf("ADC_SPI initialized\n");
// System_flush();
}

/* Initialize master SPI transaction structure */
adcTransaction.count = ADC_SPI_MSG_LENGTH;
adcTransaction.txBuf = (Ptr)adcTxBuffer;
adcTransaction.rxBuf = (Ptr)adcRxBuffer;


// User specific code, enable interrupts:
Xint1Count = 0; // Count XINT1 interrupts
TimerCount = 0; // Count Timer0 interrupts
LoopCount = 0; // Count times through idle loop
Flag = 0;
Reg_Word = 0;

// Initialize Buffer Tables
for (n=0; n<BUF_SIZE; n++)
{
ADS833x_Buf[n] = n;
}

for (n=0; n<SIZE; n++)
{
ADS833x_Result[n] = n;
}


ADS833x_init();

// Step 6. IDLE loop:
// Select input Channel if Manual Channel Selection is enabled in CFR register
ADS833x_Buf[2] = ADS833x_CFR_Reg & 0x0800;
if (ADS833x_Buf[2] == 0)
{
System_printf("\n manual channel select\n");
System_flush();
Channel_Number = 0; // Should be 0~7,Channel number for Manual channel select
ADS833x_Channel_Select(Channel_Number); // Select ADC input channel // CHANGE THE CHANNEL IN TIMER INTERRUPT ALSO
}

////**************************************************END ADC******************************************************
////**************************************************ABSOLUTE ENCODER*************************************
////**************************************************Channel 0*************************************
SPI_Params spiParamsabsa;
SPI_Params_init(&spiParamsabsa);
spiParamsabsa.transferMode = SPI_MODE_BLOCKING;
spiParamsabsa.transferTimeout = SPI_WAIT_FOREVER;
spiParamsabsa.transferCallbackFxn = NULL;
spiParamsabsa.mode = SPI_MASTER;
spiParamsabsa.bitRate = 295000; //295K
spiParamsabsa.dataSize =16;
spiParamsabsa.frameFormat = SPI_POL1_PHA1;
spiParamsabsa.custom =(uintptr_t) NULL;
absaSpi = SPI_open(Board_SPI2, &spiParamsabsa);
if (absaSpi == NULL) {
System_abort("Error initializing ABSA_SPI\n");
}
else {
System_printf("ABSA_SPI initialized\n");
System_flush();
}

/* Initialize master SPI transaction structure */
absaTransaction.count = ABSA_SPI_MSG_LENGTH;
absaTransaction.txBuf = (Ptr)absaTxBuffer;
absaTransaction.rxBuf = (Ptr)absaRxBuffer;

//**************************************************Channel 1*************************************

SPI_Params chanbParams;
SPI_Params_init(&chanbParams);
chanbParams.transferMode = SPI_MODE_BLOCKING;
chanbParams.transferTimeout = SPI_WAIT_FOREVER;
chanbParams.transferCallbackFxn = NULL;
chanbParams.mode = SPI_MASTER;
chanbParams.bitRate = 295000;
chanbParams.dataSize =16;
chanbParams.frameFormat =SPI_POL1_PHA1;
// chanbParams.custom =(uintptr_t) NULL;
absbSpi = SPI_open(Board_SPI3, &chanbParams);
if (absbSpi == NULL) {
System_abort("Error initializing ABSB_SPI\n");
}
else {
System_printf("ABSB_SPI initialized\n");
System_flush();
}

/* Initialize master SPI transaction structure */
bTransaction.count = ABSB_SPI_MSG_LENGTH;
bTransaction.txBuf = (Ptr)bTxBuffer;
bTransaction.rxBuf = (Ptr)bRxBuffer;

timerFlag = 1;
//**************************************************END ABSOLUTE ENCODER*************************************

}

I am not using SPI_transfer(). Instead i am using library functions as given above.

Again please reply as soon as possible, its really urgent.

Regards,

Digvijay


Viewing all articles
Browse latest Browse all 262198

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>