S32K312 - ISELED not working

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S32K312 - ISELED not working

Jump to solution
3,257 Views
ssean
Contributor IV

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.

ssean_0-1736149910962.png

 

< 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.

ssean_1-1736150031872.png

 

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.

Tags (1)
0 Kudos
Reply
1 Solution
2,909 Views
cuongnguyenphu
NXP Employee
NXP Employee

@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?

cuongnguyenphu_1-1737718336772.png

cuongnguyenphu_2-1737718346633.png


One other thing is make sure your Port mode is correct: PTB14 and PTB16 as per example:

cuongnguyenphu_3-1737718381029.png

 



I will continue to check further in your configuration 

View solution in original post

0 Kudos
Reply
14 Replies
3,227 Views
cuongnguyenphu
NXP Employee
NXP Employee

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?

0 Kudos
Reply
3,190 Views
ssean
Contributor IV

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.

Tags (1)
0 Kudos
Reply
3,174 Views
cuongnguyenphu
NXP Employee
NXP Employee

@ssean 
Did you call ILaS_Init_Interface() before calling ILaS_Reset?

0 Kudos
Reply
3,162 Views
ssean
Contributor IV

Dear @cuongnguyenphu .

Yes.

I called ILaS_Init_Interface() before call ILaS_Reset().

It return "ILaS_OK".

 

0 Kudos
Reply
3,148 Views
cuongnguyenphu
NXP Employee
NXP Employee

@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?

0 Kudos
Reply
3,130 Views
ssean
Contributor IV

@cuongnguyenphu 

 

Iseled configuration is below.

It will little different with S32DS, because it used in HKMC Autosar tool.

< Iseled Module >

ssean_0-1737096215451.png

ssean_1-1737096529708.png

 

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.

0 Kudos
Reply
3,068 Views
cuongnguyenphu
NXP Employee
NXP Employee

@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:

cuongnguyenphu_0-1737364940371.png

3. If you're using DMA mode, let's double check for DMA complete notification in MCL module also:

cuongnguyenphu_1-1737365150244.png

 

cuongnguyenphu_2-1737365164483.png

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

 

0 Kudos
Reply
3,042 Views
ssean
Contributor IV

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);

 

ssean_0-1737441121058.png

 

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.

ssean_1-1737441362942.png

ssean_2-1737441379176.png

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.

Tags (1)
0 Kudos
Reply
2,910 Views
cuongnguyenphu
NXP Employee
NXP Employee

@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?

cuongnguyenphu_1-1737718336772.png

cuongnguyenphu_2-1737718346633.png


One other thing is make sure your Port mode is correct: PTB14 and PTB16 as per example:

cuongnguyenphu_3-1737718381029.png

 



I will continue to check further in your configuration 

0 Kudos
Reply
1,765 Views
ssean
Contributor IV
I made new article for this issue. Please check it?
0 Kudos
Reply
3,026 Views
cuongnguyenphu
NXP Employee
NXP Employee

@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

0 Kudos
Reply
3,012 Views
ssean
Contributor IV

@cuongnguyenphu 

I send arxml files in private message.

Please check that.

 

Best Regards,

Sean Sung.

0 Kudos
Reply
2,989 Views
cuongnguyenphu
NXP Employee
NXP Employee

@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?

0 Kudos
Reply
2,966 Views
ssean
Contributor IV

@cuongnguyenphu

No. There is no pulse signal on data, clock line.

0 Kudos
Reply