I try to use the QSPI module on AURIX TC277 with ERIKA. The communication should be performed in cooperation with the DMA.
For the configuration I am using low level drivers of Infineon (iLLD).
I implemented the necessary interrupts in the oil file as shown below. My problem is that the interrupt routines never get called, even though
the interrupt flags of the used DMA channels were set. Therefore no signals are on the bus.
Code: Select all
CPU test_application {
OS EE {
EE_OPT = "EE_DEBUG";
EE_OPT = "EE_SAVE_TEMP_FILES";
EE_OPT = "EE_ICACHE_ENABLED";
EE_OPT = "EE_DCACHE_ENABLED";
SERVICE_PROTECTION = TRUE;
MEMORY_PROTECTION = TRUE;
STACKMONITORING = TRUE;
REMOTENOTIFICATION = USE_RPC;
CPU_DATA = TRICORE {
CPU_CLOCK = 200.0;
APP_SRC = "master.c";
APP_SRC = "TestQSPImaster.c";
MULTI_STACK = TRUE;
COMPILER_TYPE = GNU {
EXPORT_FILE = "export_master.exp";
};
};
MCU_DATA = TRICORE {
MODEL = TC27x;
};
STATUS = EXTENDED;
STARTUPHOOK = TRUE;
SHUTDOWNHOOK = TRUE;
PROTECTIONHOOK = TRUE;
USEREMOTETASK = ALWAYS; //remote support for tasks (ActivateTask())
KERNEL_TYPE = BCC1;
};
TASK Task10ms {
PRIORITY = 7;
AUTOSTART = FALSE;
STACK = PRIVATE {
SYS_SIZE = 512;
};
ACTIVATION = 1;
SCHEDULE = NON;
};
ISR ISR_Qspi_Dma_Tx_Handler {
CATEGORY = 2;
PRIORITY = 10;
HANDLER = "ISR_Qspi_Dma_Tx_Handler";
};
ISR ISR_Qspi_Dma_Rx_Handler {
CATEGORY = 2;
PRIORITY = 11;
HANDLER = "ISR_Qspi_Dma_Rx_Handler";
};
ISR ISR_Qspi_Dma_Error_Handler {
CATEGORY = 2;
PRIORITY = 12;
HANDLER = "ISR_Qspi_Dma_Error_Handler";
};
ALARM Alarm1 {
COUNTER = SystemTimer;
ACTION = ACTIVATETASK{
TASK = Task10ms;
};
AUTOSTART = TRUE {
ALARMTIME = 1;
CYCLETIME = 10;
};
};
COUNTER SystemTimer {
MINCYCLE = 1;
MAXALLOWEDVALUE = 2147483647;
TICKSPERBASE = 1;
TYPE = HARDWARE {
DEVICE = "STM_SR0";
SYSTEM_TIMER = TRUE;
PRIORITY = 2;
};
SECONDSPERTICK = 0.001;
};
APPLICATION App_Master {
TRUSTED = TRUE;
TASK = Task10ms;
ALARM = Alarm1;
ALARM = Alarm2;
ISR = ISR_Qspi_Dma_Tx_Handler;
ISR = ISR_Qspi_Dma_Rx_Handler;
ISR = ISR_Qspi_Dma_Error_Handler;
SHARED_STACK_SIZE = 256;
IRQ_STACK_SIZE = 256;
};
};
Code: Select all
#define PRIO_DMA_CH1 10
#define PRIO_DMA_CH2 11
#define PRIO_QSPI_ER 12
uint32 TxIsrCnt=0;
uint32 RxIsrCnt=0;
uint32 ErrIsrCnt=0;
void ISR_Qspi_Dma_Tx_Handler()
{
TxIsrCnt++;
}
void ISR_Qspi_Dma_Rx_Handler()
{
RxIsrCnt++;
}
void ISR_Qspi_Dma_Error_Handler()
{
ErrIsrCnt++;
}
void InitQSPImaster()
{
...
spiMasterConfig.base.mode = SpiIf_Mode_master;
spiMasterConfig.base.maximumBaudrate = 10000000;
spiMasterConfig.base.txPriority = PRIO_DMA_CH1;
spiMasterConfig.base.rxPriority = PRIO_DMA_CH2;
spiMasterConfig.base.erPriority = PRIO_QSPI_ER;
// dma configuration.
spiMasterConfig.dma.txDmaChannelId = Dma_ChannelId_10;
spiMasterConfig.dma.rxDmaChannelId = Dma_ChannelId_11;
spiMasterConfig.dma.useDma = 1;
// init module and enable the service request nodes
SpiMaster_initModule(&spiMaster, &spiMasterConfig);
...
/* QSPI is ready for use now!!! */
}
So I guess, my ERIKA configuration is wrong or I forgot something.
Could you please give me a hint?
By the way, do you have some own low level drivers supporting AURIX architecture?
Best regards,
Stephan