MPC5744 SENT driver Migrated to S32DS, but there is compile error.

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

MPC5744 SENT driver Migrated to S32DS, but there is compile error.

Jump to solution
1,612 Views
ChenBowen
Contributor II

 Dear expert:  

    Just referenced your AN4856 about SENT driver for 5744. I tried to migrate the example project to S32DS, but there is compile error. 

sent驱动报错1.PNG

 

sent驱动报错2.PNG

One more doubt,  do you suggest to enable the FastMsgFiFo and Crc when using this driver?  

 

 

 

 

 

 

0 Kudos
Reply
1 Solution
1,591 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi @ChenBowen 

__interrupt attribute is not supported here. It should inform the compiler to create a prologue and epilogue for interrupt function and also it should put se_rfi instruction at the end of the function. If you want to use hardware interrupt mode, here's an example how to do that (it's little bit complicated):

https://community.nxp.com/t5/MPC5xxx-Knowledge-Base/Example-MPC5744P-HardwareVectoreMode-S32DS-1-0/t...

To read/write MSR or SPR in general, you can follow:

https://community.nxp.com/t5/S32-Design-Studio/Read-PowerPC-Machine-State-Register-from-C/td-p/15990...

To access MSR[EE] bit, you can use: __asm__(" wrteei 1");

I would use DMA and FIFO to offload the CPU.

Regards,

Lukas

 

View solution in original post

0 Kudos
Reply
6 Replies
1,592 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi @ChenBowen 

__interrupt attribute is not supported here. It should inform the compiler to create a prologue and epilogue for interrupt function and also it should put se_rfi instruction at the end of the function. If you want to use hardware interrupt mode, here's an example how to do that (it's little bit complicated):

https://community.nxp.com/t5/MPC5xxx-Knowledge-Base/Example-MPC5744P-HardwareVectoreMode-S32DS-1-0/t...

To read/write MSR or SPR in general, you can follow:

https://community.nxp.com/t5/S32-Design-Studio/Read-PowerPC-Machine-State-Register-from-C/td-p/15990...

To access MSR[EE] bit, you can use: __asm__(" wrteei 1");

I would use DMA and FIFO to offload the CPU.

Regards,

Lukas

 

0 Kudos
Reply
1,582 Views
ChenBowen
Contributor II

 Thank you!   I choose the sw interrupt mode, that problem is solved. 

  However,  I don't know assembly languageI, still don't know how to modify the following code.   

Is my modification right? I remove the "asm".

    修改后的.PNG

 

      Moreover,  How to modify this function?  Could you please help me modify it

as I I have no knowledge of assembly language.

 

SEN驱动报错3.PNG

 

 

 

 

 

 

    

0 Kudos
Reply
1,111 Views
gsr007
Contributor I

Excuse me,I want to know how do you set the sw interrupt mode?

Thank you!

0 Kudos
Reply
1,564 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Regarding Suspend:

lukaszadrapa_0-1678905040373.png

 

And regarding Restore, you can simply use C code like this:

if(Msr&0x8000) /* Check what was original value of MSR[EE]  and write it to MSR[EE] using wrteei instruction*/

  __asm__("wrteei 1")

else

  __asm__("wrteei 0")

 

Regards

Lukas

0 Kudos
Reply
1,520 Views
ChenBowen
Contributor II

    重定义错误.PNG重定义错误2.PNG

Here comes another problem...     Can I just add "static" before the "inline void" ?

 

0 Kudos
Reply
1,109 Views
gsr007
Contributor I

Hello,can I ask if the compilation problems have been resolved?

If yes,can I have some communication with you? Because I met the same issue.

Thanks!

0 Kudos
Reply