AnsweredAssumed Answered

S32 1.3: SAEK8: elf error when placing interrupt

Question asked by richard payne on Jan 2, 2017
Latest reply on Jan 10, 2017 by richard payne

Attached zipped file is the test code used to evaluate the UART, GPIO and clock as part of learning curve. The code worked fine on KEA128 device via freedom board (S32 ver 1.3 install kit).

 

I created new project for KEA8 device and then copied the code library from KEA132 to KEA8 device I modfied the code to match KEA8 pin layout and deleted UART1, UART2 reference in my code and library and so on.

 

The code complies but generate elf error without explaination why elf error occurred. 

Description Resource Path Location Type
make: *** [KAE8-Riscy-1A.elf] Error 1 KAE8-Riscy-1A C/C++ Problem

 

I used commenting certain code in main.c until the error goes away. I isolated the source of error which is related to uart.c and uart.h library from Quick Start Package v5. After further isolation experiment using commenting and bang there the problem.....

 

pUART->C3=pConfig->sctrl3settings.byte;
pUART->C2 =pConfig->sctrl2settings.byte;

/*
if(1==pConfig->sctrl2settings.bits.bIlie||1==pConfig->sctrl2settings.bits.bRie||1==pConfig->sctrl2settings.bits.bTcie||1==pConfig->sctrl2settings.bits.bTie
||1==pConfig->sctrl3settings.bits.bFeie||1==pConfig->sctrl3settings.bits.bNeie||1==pConfig->sctrl3settings.bits.bOrie||1==pConfig->sctrl3settings.bits.bPeie)
{
if(pUART==UART0)
{
Enable_Interrupt(UART0_IRQn);

}
}
*/

I moved the below to my code to enable interrupt

Enable_Interrupt(UART0_IRQn);

 

void UART0_Init(void)

{

//------------------------------------Setup Module.
UART_ConfigType Uart_Config={{0}};

Uart_Config.sctrl1settings.bits.bM=0; // 8 bit Mode
Uart_Config.sctrl1settings.bits.bPe=0; // Parity disable
Uart_Config.bSbns=0; // One stop bit
Uart_Config.sctrl2settings.bits.bRe=1; // Receiver enable
Uart_Config.sctrl2settings.bits.bTe=1; // Transmitter enable
Uart_Config.sctrl2settings.bits.bRie=1; // Transmit buffer empty interrupt enable
//Uart_Config.sctrl2settings.bits.bTie=1; // Transmit buffer empty interrupt enable
Uart_Config.u32SysClkHz = 20000000; // Bus clock in Hz
Uart_Config.u32Baudrate = 115200; // Baud rate

//------------------------------------Initialization of UART module
UART_SetCallback(DEBUGUART, UART0_ISR);

UART_Init(DEBUGUART,&Uart_Config);         
Enable_Interrupt(UART0_IRQn);               // Test Placement which generate ELF error. 
//------------------------------------Setup Flags
zUARTFlag.zSysWord=0;
RxPointer=0;

}

Commenting out the Enable_Interrupt(UART0_IRQn); 

will make elf go away then I cannot setup interrupt on UART.

 

Why this error happen and is there work-around this solution?

Original Attachment has been moved to: KAE8-Riscy-1A.rar

Outcomes