MPC5748G SEMA42 access

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

MPC5748G SEMA42 access

Jump to solution
1,823 Views
ondrau2
Contributor II

Hello.

I'm trying to use shared memory on MPC5748G.

I modified the link descriptors according to examples, and also tried to implement hardware semaphores.

However, once I attempt to write to any SEMA42 register, an IVOR1 exception is triggered.

My code is following:

int main(void)

{

xcptn_xmpl ();

peri_clock_gating(); /*Allow clk for PIT and FlexCAN*/

system160mhz();

hw_init();

SEMA42.RSTGT.W.R = 0xE200; /* IVOR1 exception thrown*/

SEMA42.RSTGT.W.R = 0x1DFF; /* Reset ALL Semaphores Gates 2nd write */

//Other code...

I must have missed something. Is any SEMA42 initialization required?

I also attempted to access the SEMA42 registers in interrupt handler, but still I received IVOR1 exception.

while(status != core_num)

{

/*Lock the gate*/

SEMA42.GATE[0].R = core_num + 1;//  IVOR1 exception thrown

status = SEMA42.GATE[0].R;

}

I believe I use supervisor mode (I didn't attempt to switch modes).

Any Ideas what am I doing wrong?

Thank you and best regards, Ondra.

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

Hi,

got it. It's caused by old revision of header file - there's wrong base address of SEMA42. It has been fixed in v6.0.2. You will find it attached.

But anyway, I recommend to update the S32 Design Studio. The latest update is UP8:

S32 Design Studio IDE for Power Architecture based MCUs|NXP 

Regards,

Lukas

View solution in original post

4 Replies
1,482 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

I can't see any problem here. The SEMA42 registers can be accessed without any initialization.

I did very quick test when I locked/unlocked first two gates and then I tested the reset of gates and it works as expected. I used new empty project created in S32 Design Studio.

    SEMA42.GATE[0].R = 1;
    SEMA42.GATE[0].R = 0;

    SEMA42.GATE[1].R = 1;
    SEMA42.GATE[1].R = 0;

    SEMA42.GATE[0].R = 1;
    SEMA42.GATE[1].R = 1;

    SEMA42.RSTGT.W.R = 0xE200;
    SEMA42.RSTGT.W.R = 0x1D00;

    SEMA42.RSTGT.W.R = 0xE201;
    SEMA42.RSTGT.W.R = 0x1D01;

Could you share your project?

Regards,

Lukas

0 Kudos
Reply
1,482 Views
ondrau2
Contributor II

Hello.

Thanks for reply.

I tried to create new project with SEMA42 access only, however the result is still the same...

My previous reduced project is attached.

I use s32 2017.R1 and microcontroller MPC5748GMKU6 (version of mask 1N81M).

Could you please share your working project?

Thank you, Ondřej.

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

Hi,

got it. It's caused by old revision of header file - there's wrong base address of SEMA42. It has been fixed in v6.0.2. You will find it attached.

But anyway, I recommend to update the S32 Design Studio. The latest update is UP8:

S32 Design Studio IDE for Power Architecture based MCUs|NXP 

Regards,

Lukas

1,482 Views
ondrau2
Contributor II

Hello.

Thank you.

Problem solved.

Best regards, Ondřej.

0 Kudos
Reply