Starting Second Core on MPC5676R

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

Starting Second Core on MPC5676R

Jump to solution
2,147 Views
dpastl
Contributor II

Hello,

 

I've been playing around with the MPC5676R for the last couple days. I can get to blinky on the first core without any problem, but the second I try to run the same code on the second core nothing happens.  I'm running the default project that Codewarrior creates when you start a bareboard MPC5676R project, with some added code to blink an LED, which is on GPIO 253.  I'm doing all the same initialization that I was doing on core 0, but core 1 does not seem to want to play ball.

 

The project adds this to start the second core:

 

SIU.RSTVEC1.B.RSTVEC = (unsigned long)__start_p1;

 

Is there anything else I need to do to get the second core going?  The Application Notes don't seem to mention anything else.

 

Any help is very much appreciated

 

Thanks!

Labels (1)
Tags (2)
0 Kudos
Reply
1 Solution
1,931 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

Have you tried to run following example?

Example XPC567XRKIT PinToggleStationery CW210

If I remember it well I have been facing the same issue. It is needed to change XBAR settings to let both cores to have same change to access the resources like this:

/* set round robin for all slaves */

XBAR.SGPCR0.B.ARB = 1;

XBAR.SGPCR1.B.ARB = 1;

XBAR.SGPCR2.B.ARB = 1;

XBAR.SGPCR3.B.ARB = 1;

XBAR.SGPCR6.B.ARB = 1;

XBAR.SGPCR7.B.ARB = 1;

Let me know if it helps or not.

View solution in original post

0 Kudos
Reply
4 Replies
1,932 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

Have you tried to run following example?

Example XPC567XRKIT PinToggleStationery CW210

If I remember it well I have been facing the same issue. It is needed to change XBAR settings to let both cores to have same change to access the resources like this:

/* set round robin for all slaves */

XBAR.SGPCR0.B.ARB = 1;

XBAR.SGPCR1.B.ARB = 1;

XBAR.SGPCR2.B.ARB = 1;

XBAR.SGPCR3.B.ARB = 1;

XBAR.SGPCR6.B.ARB = 1;

XBAR.SGPCR7.B.ARB = 1;

Let me know if it helps or not.

0 Kudos
Reply
1,931 Views
dpastl
Contributor II

Hello David,

I tried adding just the XBAR code but that doesn't seem to be enough.  I looked through the example code you linked and added support for the second core to run from flash:

#define FLASH_REG   FLASH_A.BIUCR.R
#define FLASH_DATA  0x00016B15

#define FLASH_REG2  FLASH_A.BIUCR3.R

#define FLASH_DATA2 0x00020015

Which I added to the __ppc_eabi_init.c file.  I'm still not getting the second core to access the pin.  I'll keep looking through the example code to see what they all did differently.

Thanks,

0 Kudos
Reply
1,931 Views
dpastl
Contributor II

Hmm,

Well it seems to be working, but not that reliably.  I put the code into debug mode and was able to step through the code and noticed the pin toggling.  I then programmed it with the flash build and let it run, but nothing happened.  Resetting the power to the board made the pin start toggling.  I'll have to keep an eye on this but for the moment that seems to have solved the problem.

Thanks!!

0 Kudos
Reply
1,931 Views
dpastl
Contributor II

It appears the issue is not that the second core is not starting, but that it will not toggle the LED.  I am able to run a debug session that will show the second core running, trying to set the pin, but not doing anything in particular.

0 Kudos
Reply