Author Topic: LPC4337 Dual core example, M0 run from Flash bankB problem  (Read 1092 times)

0 Members and 1 Guest are viewing this topic.

Offline ali_asadzadehTopic starter

  • Super Contributor
  • ***
  • Posts: 1905
  • Country: ca
LPC4337 Dual core example, M0 run from Flash bankB problem
« on: February 05, 2018, 02:47:52 pm »
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

Code: [Select]
{
  /* 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

Code: [Select]
{
int i=0;

for (;;)
{
i++;
}
}


and these are the command line commands for the M0 project

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


and this one is for the M4 core

Code: [Select]
$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

ASiDesigner, Stands for Application specific intelligent devices
I'm a Digital Expert from 8-bits to 64-bits
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf