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.

CCS/TMS320F28035: Access interruption configuration library by address

Part Number: TMS320F28035

Tool/software: Code Composer Studio

Hi,

We want to set a interruption configuration to a lib, access by address.

Detailed code as attached. 

typedef interrupt void(*PINT)(void);

#define ADCINT1_OFT  64  // ADC - if Group 10 ADCINT1 is enabled, this must be Rsvd1_1
#define PIEIER1_OFT  0  // PIE INT1 IER register  
#define PIEIER_INTx1  (1 << 0 )
#define M_INT1  0x0001	
#define PIEACK_GROUP1   0x0001


static const PieCfg AdcIntCfgTab =
{
	ADCINT1_OFT,
	PIEIER1_OFT,	
	PIEIER_INTx1,
	M_INT1,
	PIEACK_GROUP1
};

/**********************************************************************************
***********************************************************************************/
void HwPieInit(void (*UserInterrupt)(void),PieCfg PieTable)
{

	PINT UserCfgInt =&PieVectTable.PIE1_RESERVED;	
	volatile union PIEIER_REG *const PieIerX=&PieCtrlRegs.PIEIER1;       // PIE INT1 IER register  
	
	EALLOW;	
	*((volatile Uint16 *)(UserCfgInt+PieTable.PieIntOft))=UserInterrupt;	
	*((volatile Uint16 *)(PieIerX+PieTable.PieIerXOft))|=PieTable.PieInx;	
	IER |= PieTable.PieMint;
	PieCtrlRegs.PIEACK.all =PieTable.PieAck;
	EDIS;	

}


#pragma CODE_SECTION(Seq1InterruptServiceRoutine, "ramfuncs");
interrupt void Seq1InterruptServiceRoutine(void)
{
	
}


void main(void)
{
    HwPieInit(&Seq1InterruptServiceRoutine,AdcIntCfgTab);

}

During the position when execute *((volatile Uint16 *)(UserCfgInt + PieTable.PieIntOft))= UserInterrupt;

In memory browser, the address is 0x003F82D2.

But actually address is 0x0082D2.

1. CCS7.3, the above code can be compiled, but an error occurs when access to the address 0x3F82D2, the jumping to interruption is incorrectly.

2. CCS5.5, failed to compile.

So we change uint16 * to uint32, it's correct.

Q:  During the interruption address access, should it be addressed as 16-bit or 32-bit? Thanks a lot.

  • It should be a 32-bit variable. A 16-bit variable is only wide enough to hold 0x82D2. I'm guessing the only reason the PIE table is showing up correctly is being there was already a 0x003F in the upper word of that location.

    Whitney