AnsweredAssumed Answered

LPC4337 Dual core example, M0 run from Flash bankB problem

Question asked by Ali Asadzadeh on Feb 5, 2018
Latest reply on Apr 13, 2018 by Fernando Theirs

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

Outcomes