LPC4337 Dual core example, M0 run from Flash bankB problem

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

LPC4337 Dual core example, M0 run from Flash bankB problem

Jump to solution
2,596 Views
aliasadzadeh
Contributor II

Hi,
I want to use flash bank A for the M4 core at Address of 0x1A000000 and Ram at address of 0x20000000,so far so good,

This is my code inside the M4 core

M4 main code

{
 /* Stop CM0 core */
 LPC_RGU->RESET_CTRL1 = (1 << 24);
 /* Download CM0 application */
 Load_CM0_Image (0x1B000000, LR0, sizeof(LR0)); 
 /* Start CM0 core */
 LPC_RGU->RESET_CTRL1 = 0;
}
/*----------------------------------------------------------------------------
 Load Cortex M0APP Application Image
 *----------------------------------------------------------------------------*/
void Load_CM0_Image (uint32_t DestAddr, const uint8_t *Image, uint32_t Sz) {
 uint32_t i;
 uint8_t *dp = (uint8_t *)DestAddr;
// /* Copy application image */
// for (i = 0; i < Sz; i++) {
// dp[i] = Image[i];
// }
 /* Set shadow pointer to beginning of the CM0 application */
 LPC_CREG->M0APPMEMMAP = DestAddr;
}

And here is my M0 code with these settings ,flash from 0x1B000000 and ram from 0x10000000

M0 main file

{
int i=0;
for (;;) 
 {
 i++;
 }
}

and these are the command line commands for the M0 project

$K/ARM/BIN/ElfDwT.exe !L BASEADDRESS(0x1B000000)
fromelf --cadcombined --output="..\Cortex M4\CM0_Image.c" ".\Objects\Test.axf"

and this one is for the M4 core

$K/ARM/BIN/ElfDwT.exe !L BASEADDRESS(0x1A000000)

The problem is that the Flash bank B @ 0x1B000000 is empty when I view it with j-link in debug and even if I program it with M0 app when I start debugging of M0, it would not run! Do you have any Idea what might has gone wrong? what should I do to use the Flash bank B as the Code part for M0 core, I have successfully done it in the RAM but I need it in the flash, Also Please Note that my Tool chain is keil and my Debugger is J-link, any hints or a sample, project would help a lot.

Regards

1 Solution
1,615 Views
bernhardfink
NXP Employee
NXP Employee

The breakpoint problem is solved there:  https://community.nxp.com/thread/458795?ru=316704&sr=stream 

Regards,

Bernhard.

View solution in original post

0 Kudos
7 Replies
1,616 Views
fernandotheirs
Contributor II

Hi bernhardfink‌, do you have a simple example as the required by Ali Asadzadeh? I'm stuck in the same situation and I think that most of the problems are related to the project configuration.

Exactly same MCU (LPC4337) but in a custom board. At the moment, I'm using the M4 for all operations but I would like to port all the IO operations to M0.

Thanks for the pptx file, it was really informative because I couldn't find any guide or tutorial to keep a dual core application from scratch running :/

Best regards,

Fernando

0 Kudos
1,616 Views
bernhardfink
NXP Employee
NXP Employee

Hi Fernando,

in this parallel thread I attached an example:  https://community.nxp.com/thread/469579 

Regards,

Bernhard.

1,616 Views
fernandotheirs
Contributor II

Hi Bernhard! Thanks for your help. I will reply in the other post to unify all the information. I'm having some problems to set breakpoint in M0.

0 Kudos
1,616 Views
bernhardfink
NXP Employee
NXP Employee

The breakpoint problem is solved there:  https://community.nxp.com/thread/458795?ru=316704&sr=stream 

Regards,

Bernhard.

0 Kudos
1,616 Views
bernhardfink
NXP Employee
NXP Employee

Hi Ali,

there are DualCore examples for the Keil MCB4357 board inside the Keil tool here:

..\Keil_v5\ARM\PACK\Keil\LPC4300_DFP\2.8.0\Boards\Keil\MCB4300\DualCore

With the link below you can download the LPCOpen package which also includes Dual Core examples:

https://www.nxp.com/downloads/en/software/lpcopen_2_20_keil_iar_nxp_lpcxpresso_4337.zip 

In general you can solve the dual core setup in an IDE tool in more than one way. With Keil µVision there are already 3 possible setups (see short presentation).

If you tell me which LPC4337 board and which Keil tool version you use, I can maybe send you a working example.

Regards,

Bernhard.

0 Kudos
1,616 Views
aliasadzadeh
Contributor II

Dear Bernhard

Thanks for your answer, I have seen the sample projects for the Dual core examples, all of them seems to work with the M0 running the Code from RAM, I have these tools, my board is a custom made board and It's MCU is LPC4337, with no other external memories like FLASH or RAM , Also I want both cores to run from the internal FLASH banks, M4 from FLASH bank A and M0 from the FLASH bank B, could you please send a working simple project that both cores boot and run the code from the FLASH,as the internal SRAM is limited and my app is bigger than the internal RAM that could hold, so I need it to be done in separate FLASH banks.

My Keil version is 5.24.2.0 and I use J-link, 

Thanks and Best Regards

0 Kudos
1,616 Views
aliasadzadeh
Contributor II

Thanks, Would you please share a simple example, I'm stocked!

0 Kudos