LPC43xx Slave M0 App Core not working !!!

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

LPC43xx Slave M0 App Core not working !!!

1,577 Views
algorithmm
Contributor I

Hey guys , Im using the LPC4357 Dual core MCU . Im trying to make the slave M0 Core to turn on LED . I have created the application image for the M0 Core and included it in the M4 project.
Then sat the shadow register M0AppMEMMAP to point at the start of the image code (In the SRAM and on a 64Kbyte boundary as the manual says)
Here is my work so far
// This is the main from the M0 Project
void main ()
{ CLOCK_CMD(BASE_M4,CLK_M4_GPIO,ENABLE_CLK); // Enable the SCU CLOCK_CMD(BASE_M4,CLK_M4_SCU,ENABLE_CLK); // scu_pinmux(0x09 , 4 , MD_PDN , FUNC4); // GPIO_SetDir (5 , 1<<17 , 1); // GPIO_SetValue(5,1<<17); // Just turn on LED while(1) {

}
} //
//
// And this is the main from the M4 master core Project
#define SRAM_16KB_BLOCK_START 0x2000C000
uint8_t M0_App_Code[4*1024] __attribute__((at(SRAM_16KB_BLOCK_START)));
void main ()
{

uint32_t i; CLOCK_CMD(BASE_M4,CLK_M4_M0APP,ENABLE_CLK); // Enable M0 clock CLOCK_CMD(BASE_M4,CLK_M4_CREG ,ENABLE_CLK); // for(i=0; i<sizeof (LR0) ; i++) M0_App_Code[i]=LR0[i]; // Copy image to flash Halt_M0_Salve(); // Halt Slave CPU in case Set_M0_Start_Address(SRAM_16KB_BLOCK_START); // Set shadow register M0APPMEMMAP Start_M0_Slave(); // Start the M0 Core while(1) {

}

}
//
//
// And here is the Halt and Start functions

void Halt_M0_Salve(void)
{ uint32_t tmp; tmp=LPC_RGU->RESET_ACTIVE_STATUS1; while ((tmp & (1<<24))) { LPC_RGU->RESET_CTRL1=(1<<24); tmp=LPC_RGU->RESET_ACTIVE_STATUS1; }
} //
void Start_M0_Slave (void)
{

uint32_t tmp; tmp=LPC_RGU->RESET_ACTIVE_STATUS1; while (!(tmp & (1<<24))) { LPC_RGU->RESET_CTRL1=(0<<24); tmp=LPC_RGU->RESET_ACTIVE_STATUS1; }
} //
//
void Set_M0_Start_Address (uint32_t address)
{ LPC_CREG->M0APPMEMMAP=address;
} //
//
I have separate R/W sections for both cores (both projects) so there is no memory overlap
The problem is that it is not working .
Any ideas about what im missing? 

Labels (4)
0 Kudos
6 Replies

585 Views
katisr
Contributor I

algorithmm‌ :  Hello, I too have the same problem. Is the board now working as expected? 

lpcware-support‌ : I too have the same problem of not able to make the CM0 to turn on LED.  Any ideas or suggestions?

0 Kudos

585 Views
katisr
Contributor I

Hello all,

I too have the same problem. I am new to the world of multicore. My question is very basic I guess. I would like to know, how to determine the address : #define SRAM_16KB_BLOCK_START 0x2000C000 ? 

0 Kudos

585 Views
robertboys
Contributor IV

I just had a thought - if you select Peripherals in uVision while in Debug mode, and find the register RESET_CTRL1 and also M0APP_RST.  You should not only see what value(s) are in it - but you should also be able to change it from in there.  I don't have a board with me to test this myself..

0 Kudos

585 Views
robertboys
Contributor IV

Hello

Did you try the Dual Core example Keil provides ?

There is a tutorial but it hasn't been updated for MDK 5 yet - just for MDK 4 but might be useful: 

www.keil.com/appnotes/docs/apnt_241.asp

To turn on the M0 you have to clear  M0APP_RST which is in RESET_CTRL1 which I think you know.  You appear to have this in your code but I am not sure what the other stuff surrounding it does.  LPC_RGU->RESET_CTRL1=(0<<24)

Keil uses LPC_RGU->RESET_CTRL1 = 0; which ought to be the same.

To debug the LPC4300 series in DualCore - you need to run two instances of uVision.  However, if I remember correctly, if you just run the Cortex-M4 in 1st instance of uVision and don't start the 2nd instance, the M0 will start once  LPC_RGU->RESET_CTRL1 = 0; is reached.

Maybe the M0 is starting but you can't tell ?

Bob

0 Kudos

585 Views
algorithmm
Contributor I

Thx for ur reply Con Verse , I read the post but it did not add anything new , I have already followed the same procedure. Im using KEIL not LPC IDE , Im pretty sure my code has everything needed to start the slave core , but no idea why its not working. Im looking for a simple example that is not even using interrupt between cores , but just a slave core start to a memory location of an app image . 

0 Kudos

585 Views
converse
Senior Contributor V

Have you read this? https://community.nxp.com/message/637967 

There sre are also some examples for dual core in lpcopen.

0 Kudos