Hello.
I try porting ISELED example code into my AUTOSAR project.
ISELED example for S32DS is working well.
But my that is not working in my AUTOSAR project.
< Example for S32DS >
1. After called ILaS_Reset() --> LPSPI module enabled with MASTER_MODE.
< My AUTOSAR Project >
1. After called ILaS_Reset() --> LPSPI module not enabled.
2. LPSPI_1 ISR not called.
I configured ISR but not triggered from ISELED driver.
3. Iseled_cb() not called.
Could you give me some check list for ISELED ?
I already configure DMA for LPSPI_1, GPT Timer, Interrupt and ISELED setting.
Best Regards,
Sean Sung.
Solved! Go to Solution.
@ssean
I think this issue is relating to ISR configuration or callback setting of DMA.
I compared with our example, your Callback notification of DMA are wrong, could you correct this and try again?
One other thing is make sure your Port mode is correct: PTB14 and PTB16 as per example:
I will continue to check further in your configuration
I guess you haven't initialized clock for LPSPI, or you missed some steps before ILaS_Reset() as S32DS example did.
Could you double check these points?
Dear @cuongnguyenphu .
When I use SPI functions(Init, Send) in same program for test, it is okay.
So, I guess LPSPI clock okay.
I called ILaS_Init_Interface() --> ILaS_Reset().
Is there some missed?
Best Regards,
Sean Sung.
@ssean
Did you call ILaS_Init_Interface() before calling ILaS_Reset?
Dear @cuongnguyenphu .
Yes.
I called ILaS_Init_Interface() before call ILaS_Reset().
It return "ILaS_OK".
@ssean
Can you share me your configuration files of Iseled and other modules in your project? Also with the snapshot of steps you called Ilas functions?
Iseled configuration is below.
It will little different with S32DS, because it used in HKMC Autosar tool.
< Iseled Module >
Generated files of ISELED module are attached.
Iseled init sequence is below.
void TEST_FUNC_ISELED(void)
{
if(TestSeq == 0)
{
Rm_Init(&Rm_Config);
TestSeq++;
}
else if(TestSeq == 1)
{
//Spi_Init(NULL_PTR);
Os_EnableInterruptSource(LPSPI_1_Isr, 0);
iseledReturn = ILaS_Init_Interface(IseledContainer0.nrOfILaSNetworks, &IseledContainer0);
TestSeq++;
}
else if(TestSeq == 2)
{
/* Send reset message to strips */
iseledReturn = ILaS_Reset(BROADCAST_ADDRESS, NetWorkNumber);
/* Allow ILaS board to reset */
TestSeq++;
}
}
Best Regards,
Sean Sung.
@ssean
What is the value of iseledReturn after you called ILas_Reset?
I have some ideas about this situation:
1. Perhaps you haven't initialized Gpt and Port module before Initialize Ilas. From your code sequence, I can see only Rm_Init() is initialized
2. Could you double check the ISR configuration for LPSPI_1_Isr handler in you config? the name of ISR handler should like Integration Manual of Iseled module mentioned, and let's try to increase Isr priority of LPSPI to see if it solve issue:
3. If you're using DMA mode, let's double check for DMA complete notification in MCL module also:
4. Try to adding some delay after calling Ilas_Reset like Iseled example did:
ILaS_Reset(0U, NetWorkNumber);
while((state != 1U) && (timeout-- > 0U));
/* Allow ILaS board to reset */
delay_t(T_DELAY);
5. In our logic code of Ilas_Reset, the CR.MEN bit only be set when the LPSPI is idle, so please make sure there's no other places trigger this LPSPI
Dear @cuongnguyenphu
ILas_Reset() return ILaS_OK.
1. Gpt and Port module already initialized in AUTOSAR Platfrom MCAL init function.
So, I only add RM module init manually.
When I test GPT like below, GPT works fine.
/* Test for GPT */
Gpt_EnableNotification(GptConf_GptChannelConfiguration_GptChannelConfiguration_Iseled);
Gpt_StartTimer(GptConf_GptChannelConfiguration_GptChannelConfiguration_Iseled, 100);
2. LPSPI_1_Isr handler is okay.
When I trigger LPSPI interrupt forced set LPSPI_1 register (TDIE), ISR called.
And it called ISELED_LPSPI_1_Isr() to ISELED library.
3. DMA ISR not called because LPSPI_1 not enabled from library.
I'll check after solve LPSPI_1 not enabled issue.
4. Delay no effected.
5. When I call ILaS_Reset(), LPSPI_1 in Idle state. (LPSPI_1, MBF register)
Thank you for your long check list.
Could you check another check list, code branch or exception in iseled library source code?
Best Regards,
Sean Sung.
@ssean
I think this issue is relating to ISR configuration or callback setting of DMA.
I compared with our example, your Callback notification of DMA are wrong, could you correct this and try again?
One other thing is make sure your Port mode is correct: PTB14 and PTB16 as per example:
I will continue to check further in your configuration
@ssean If then I think I need to check your configuration files again.
Could you please send me these files in .xdm or .arxml format (configure files before generated): Os, Platform(if any), Gpt, Iseled, Mcl, Mcu, RM
@ssean
I received your message and in analyzing it.
I will get back soon
Could you help me check this also: Is there any pulse signal after calling ILaS_Reset function?
No. There is no pulse signal on data, clock line.