Phytec MPC5554 not running out of flash?

Peter Dufault dufault at hda.com
Fri Jul 11 12:44:38 UTC 2014


I've been developing code just fine running in SRAM with the current head.  I just tried to run out of flash.  My software put the program in flash just fine, but it doesn't run, it winds up in the BAM code trying to boot off the serial port / CAN.

The difference between SRAM and FLASH is only the setup of the MMU, and it's the same code in both cases. For SRAM flash is moved from 0 up to 21400000 and 4MB of SRAM down from 21400000 to 0.  The MMU is setup in the debugger and at startup the MMU setup is skipped if a flag in low memory is clear.  That's the only difference in the behavior (see below), and I've never noted any differences before.

I verified that I have the same MMU setup except for the address translation in both situations.  It was different, someone changed the setup to only set the supervisor mappings and not map certain sections executable but that didn't matter, I've duplicated those settings and it works the same way.

Before I go too far can anyone (Sebastian) think of changes in any other places that might affect this?

static BSP_START_TEXT_SECTION void mpc55xx_start_mmu(void)
{
  #ifdef MPC55XX_BOOTFLAGS
    /* If the low bit of bootflag 0 is clear don't change the MMU.  */
    bool do_mmu_config = (mpc55xx_bootflag_0 [0] & 1) != 0;
  #else
    bool do_mmu_config = true;
  #endif

  if (do_mmu_config) {
    mpc55xx_start_mmu_apply_config(
      &mpc55xx_start_config_mmu [0],
      mpc55xx_start_config_mmu_count [0]
    );
  }
}


Peter
-----------------
Peter Dufault
HD Associates, Inc.      Software and System Engineering



More information about the devel mailing list