lpcware

LPC4337 M0APP Core Startup Failure

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 18, 2016 by lpcware
Content originally posted in LPCWare by Master Chef on Wed Mar 09 12:18:18 MST 2016
09 March, 2016 - O.K. Here's the scenario:

I've been working on a dual-core DSP application using only the M4 initially because I wanted to first validate the design of the hardware platform (external peripheral hardware) before complicating it with code running on the "Slave" core (M0APP).  I've got an Ethernet Switch and it's associated IP stack running along with my DSP code on the M4 without problems.  I want to migrate the Network Code to the M0APP in order to minimize the impact of the Networking to my DSP code.  I'm developing on Keil uVision 5.15 with MDK-Pro middleware via a Keil uLink Pro.  I have +30 years experience in bare metal and embedded software development.

I've added a second project for the M0APP and have verified (in debug) that the LR0 array is being generated properly and included in the M4 project, which places its image at the beginning of Flash Bank B.  So, the Flash ROM arrangement is M4 image in Flash Bank A / M0APP image in Flash Bank B.  When the M4 runs the post-reset SystemInit does the following:

[list=1]
  [*]Enables the M0APP Branch Clock [LPC_CCU1->CLK_M4_M0APP_CFG = (1UL << 0)]
  [*]Puts the M0APP in Reset [LPC_RGU->RESET_CTRL1 = (1UL << 24)]
  [*]Sets VTOR to the start of Flash Bank A [SCB->VTOR = ( (uint32_t)(&__Vectors) ) & 0xFFF00000UL]
  [*]Programs the PLL1 (CPU) Clock Frequency
  [*]Starts up the M4 DSP application
[/list]

Once the RTOS and DSP application are up and running, I initialize the interprocessor communication structures and then do the following:

[list=1]
  [*]Set the M0APP Shadow Register to the start of Flash Bank B
  [*][LPC_CREG->M0APPMEMMAP = (uint32_t) &LR0]
  [*]Execute a Data Synchronization Barrier (just to be sure)
  [*]Clear and enable the M0APP_IRQ
  [*]Take the M0APP core out of Reset [LPC_RGU->RESET_CTRL1 = 0]
  [*]Wait for the M0APP to SEV to the M4 that it has completed its startup
[/list]

One of the first things that I do in the M0APP code is to change the state of an LED that is already setup by the M4.  It is literally within the first 10 lines of main().  I never even get there.  What above or elsewhere could be hanging the M0APP core?  When I look at the M0_Reset_Handler in startup_LPC43xx_M0.s all I see is:


LDRR0, =__main
BXR0


Could the M0APP be getting hung up in the Run-Time scatter/init code?  If so, what would cause that?

Outcomes