TRK-MPC5606B : System Not Entering DRUN Mode

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

TRK-MPC5606B : System Not Entering DRUN Mode

6,099 Views
raghavendrapura
Contributor I

Hello,

 

After generating the firmware and upon compilation i am trying to test it on the Dev board. The system is in endless loop for the below highlighted code in red :

The current mode is always in reset. I tried with the LED Example given along with the DevKit : I compared the generated code and LED example code for clock and the source files were same.

I followed the same procedure mentioned for the FSK_LED_Example.

------------------------------------------------------------------------

/* ----------------   PLL Configuration  ------------------- */

 

 

    ME.DRUN.R = 0x001F0070;

        /* I/O Power Down Control: Disabled    */

        /* Main Voltage Regulator Control: Enabled    */

        /* Data Flash Power Down Control: Normal    */

        /* Code Flash Power Down Control: Normal    */

        /* System PLL: ON    */

        /* Crystal Oscillator: ON    */

        /* 16MHz IRC: ON    */

        /* System Clock Source: 16MHz IRC    */

 

 

        /* Re-enter in DRUN mode to update the configuration */

    ME.MCTL.R = 0x30005AF0;   

        /* Mode & Key */

    ME.MCTL.R = 0x3000A50F;   

        /* Mode & Key  Inverted  */

    while(0x1 == ME.GS.B.MTRANS){};   

        /* Wait for mode entry to complete  */

    while(0x3 != ME.GS.B.CURRENTMODE){};                                                       [Breakpoint Stuck Here]

        /* Check DRUN mode has been entered  */

 

 

        /* Wait for PLL to lock - will not lock before DRUN Re-entry  */

    while(0x0 == CGM.FMPLL_CR.B.S_LOCK){};   

-----------------------------------------------------------------------

 

 

Development Board : TRK-MPC5606B

Configuration Tool for Firmware : RappiD Tool

Debugger: Trace 32 and PEMICRO Multi Universal Debugger

IDE : Eclipse

Compiler : GHS Compiler

 

Could anybody please help me to resolve this issue.

 

And also send me the required jumper settings to be followed for the TRKMPC5606B because in the kit has no diagram for jumper settings.

 

Regards,

Raghavendra P

Labels (1)
0 Kudos
48 Replies

1,420 Views
rweiss
Contributor V

Hi,

looking at your TRACE32 screenshots it seems like you started TRACE32 in instruction set simulator mode.

E.g. MC_ME[GS] would never read zero when the core is halted in debug mode.

The TRACE32 instruction set simulator does not simulate peripherals.

Also the setup script you are using is intended for applications running in SRAM.

If your application is compiled for FLASH, make sure you program it to flash using the flash script demo\powerpc\flash\jpc560x.cmm

Regards,

Reinhard

0 Kudos

1,420 Views
raghavendrapura
Contributor I

Hello Reinhold,

Just for testing i commented the line &flashdriver="tbd.bin" and changed line SYStem.CPU MP55XX to SYStem.CPU MPC5606B.

And when i run the cmm it asks for data load and i provide the elf file and it runs for a long time for updating flash and finally hangs.

Regards,

Raghavendra P

0 Kudos

1,420 Views
rweiss
Contributor V

Hi, not sure how new or old your installation is. Please try this script.

Regards,

Reinhard

0 Kudos

1,420 Views
raghavendrapura
Contributor I

Hello Reinhard,

I tried setting up the SYStem.CPU MPC5606B and the above error disappears and Next error i got is unknown command for "INFO "C UTEST - User OTP area"

Regards,

Raghavendra P

0 Kudos

1,420 Views
rweiss
Contributor V

Hi,

do not change the script, the script is fine.

The problem is that you are still running TRACE32 as instruction set simulator!

Which TRACE32 debug module do you have and how is it connected to the PC?

Regards,

Reinhard

0 Kudos

1,420 Views
raghavendrapura
Contributor I

T32_PowerView.jpg

0 Kudos

1,420 Views
rweiss
Contributor V

Hi,

the executable is the same, but you have to change the operation mode in file c:\t32\config.t32

you have to change

PBI=SIM

to

PBI=

USB

An alternative and easier approach is using t32start.exe, set up a configuration and start from there.

Regards,

Reinhard

0 Kudos

1,420 Views
raghavendrapura
Contributor I

Hello Reinhard,

Config 32 settings are :

PBI=USB

SCREEN=

HEADER=TRACE32 Native Debugger

; Printer settings

PRINTER=WINDOWS

With the above settings i get error :

T32_PowerView.jpg

With the T32start i get below error

Trace32_Start.jpg

Trace32_Configuration.jpg

Regards,

Raghavendra P

0 Kudos

1,420 Views
rweiss
Contributor V

Hi,

I guess the USB driver was not installed.

Please take the installation DVD that came with the debugger, start the installer and make sure that you select "Debugger".

This will ensure that the USB driver gets installed and that you get the correct start links / config files.

Best regards,

Reinhard

0 Kudos

1,420 Views
raghavendrapura
Contributor I

Hello Reinhard,

Currently i am not in office and i will check this tomorrow by configuring the operation mode in file c:\t32\config.t32.

I tried the second method before  by using the t32start.exe and i referred the help manual to create a configuration for Power PC.

But after configuring i get TRACE32 not detected error and it points to c:\t32\config.t32 and to some other location.

While during the configuration  it asks for startup file in the advanced settings which i could not find for PowerPC OR MPC. But i think this was not mandatory.

Also i also have PEMicro Universal FX debuuger with ICDPROGNEXUS software for flashing and debugging.

Do you know the procedure to use the above environment. Basically i need to have the flexibilty to use both but one at a time.

Regards,

Raghavendra P

0 Kudos

1,420 Views
raghavendrapura
Contributor I

Hello,

The debugger is LAUTERBACH and it is connected to workstation through USB and connected to dev board through JTAG interface.

Please find below files which i see in the bin folder of T32

Trace32_F.jpg

Please let me know the correct application to be used for the cmm script.

Regards,

Raghavendra

0 Kudos

1,420 Views
raghavendrapura
Contributor I

Hello Reinhard,

I get error when i run your script

Raghavendra PTrace32_Error.jpgTrace32_Flash_Error.jpg

The contents of jpc560x.cmm file are :

;

; Example script for programming internal flash of JPC560x derivatives:

; - SPC560Bxx

; - MPC560xB

; - SPC560Pxx

; - MPC560xP

; - SPC560Sxx

; - MPC560xS

;

; Internal Program Flash Memory Bank 0 with 512 kByte:

;   Low address range   256 kByte (32, 16, 16, 32, 32, 128 kByte)

;                       0x00000000--0x0003ffff

;   Mid address range   256 kByte (2 * 128 kByte)

;                       0x00040000--0x0007ffff

;   Shadow row          32 kByte

;                       0x00200000--0x00203fff

;

; Internal Program Flash Memory Bank 1 with 512 kByte:

;   Low address range   256 kByte (32, 16, 16, 32, 32, 128 kByte)

;                       0x00080000--0x000bffff

;   Mid address range   256 kByte (2 * 128 kByte)

;                       0x000c0000--0x000fffff

;

; Internal Data Flash Memory with 64 kByte:

;   Low address range   64 kByte (4 * 16 kByte)

;                       0x00800000--0x0080ffff

;

; Internal SRAM         40 kByte

;                       0x40000000--0x40009fff

;

; Flash register base address is:

;   Flash Bank 0:       0xc3f88000

;   Flash Bank 1:       0xc3fb0000

;   Data Bank:          0xc3f8c000

;

; $Author: rweiss $

; $Date: 2013-07-03 11:19:34 +0200 (Mi, 03 Jul 2013) $

; $Rev: 2312 $

;

; Check if script is called with parameters

; Valid parameters:

;   PREPAREONLY     : prepare flash programming without user interaction

;   SKIPCONFIG      : skip configuration part to allow script esternal configuration

LOCAL &parameters &param_prepareonly &param_skipconfig

ENTRY %LINE &parameters

&param_prepareonly=(STRing.SCAN(STRing.UPpeR("&parameters"),"PREPAREONLY",0)!=-1)

&param_skipconfig=(STRing.SCAN(STRing.UPpeR("&parameters"),"SKIPCONFIG",0)!=-1)

LOCAL &flashbase &shadowbase &rambase &flashsize

LOCAL &flashdriver &multiflashbanks &newflashconfig

&flashbase=0x00000000

&shadowbase=0x00200000

&rambase=0x40000000

&flashsize=0x000000000

;&flashdriver="tbd.bin"

&multiflashbanks=0

&newflashconfig=0

LOCAL &DualPort

IF VERSION.BUILD.BASE()>=45520.

  &DualPort="/DualPort"

;========================================================================

; CPU setup

IF !&param_skipconfig

(

  SYStem.RESet

  SYStem.BdmClock 4.0MHz

  SYStem.CPU MPC5606B

  SYStem.DETECT.CPU

  SYStem.Option.WATCHDOG OFF

  SYStem.Up

; repeat CPU detection to ensure that the debugger

; can read from MIDR register for detection

  SYStem.DETECT.CPU

  SYStem.Up

)

; protect from accessing unimplemented memory (open Data.List/Dump windows)

MAP.DenyAccess 0x20000000--0x3FFFFFFF

;========================================================================

; Flash declaration

IF (CPU()=="SPC560D30"||CPU()=="MPC5601D")        ; Bolero128k (type Bolero256k)

(

  &flashsize=0x00020000

  &flashdriver="c90fl560x256k.bin"

  SYStem.MemAccess.Denied

  &DualPort=""

)

ELSE IF (CPU()=="SPC560D40"||CPU()=="MPC5602D")   ; Bolero256k

(

  &flashsize=0x00040000

  &flashdriver="c90fl560x256k.bin"

  SYStem.MemAccess.Denied

  &DualPort=""

)

ELSE IF (CPU()=="SPC560B40")||(CPU()=="MPC5602B")||(CPU()=="SPC560C40")||(CPU()=="MPC5602C") ; Bolero256k (type Bolero512k)

(

  &flashsize=0x00040000

  &flashdriver="c90lc560x.bin"

)

ELSE IF (CPU()=="SPC560B44")||(CPU()=="MPC5603B")||(CPU()=="SPC560C44")||(CPU()=="MPC5603C") ; Bolero384k (type Bolero512k)

(

  &flashsize=0x00060000

  &flashdriver="c90lc560x.bin"

)

ELSE IF (CPU()=="SPC560B50")||(CPU()=="MPC5604B")||(CPU()=="SPC560C50")||(CPU()=="MPC5604C") ; Bolero512k

(

  &flashsize=0x00080000

  &multiflashbanks=1

  &flashdriver="c90lc560x.bin"

)

ELSE IF (CPU()=="SPC560B54")||(CPU()=="MPC5605B") ; Bolero768K (type Bolero1.5M)

(

  &flashsize=0x000C0000

  &flashdriver="c90fl5607b.bin"

)

ELSE IF (CPU()=="SPC560B60")||(CPU()=="MPC5606B") ; Bolero1M (type Bolero1.5M)

(

  &flashsize=0x00100000

  &flashdriver="c90fl5607b.bin"

)

ELSE IF (CPU()=="SPC560B64")||(CPU()=="MPC5607B") ; Bolero1.5M

(

  &flashsize=0x00180000

  &flashdriver="c90fl5607b.bin"

)

ELSE IF (CPU()=="SPC560P34")||(CPU()=="MPC5601P") ; Pictus192k (type Pictus256k)

(

  &flashsize=0x00030000

  &flashdriver="c90fl560x256k.bin"

  SYStem.MemAccess.Denied

  &DualPort=""

)

ELSE IF (CPU()=="SPC560P40")||(CPU()=="MPC5602P") ; Pictus256k

(

  &NPC_DID=Data.Long(DBG:0x80)

  IF ((&NPC_DID&0x0FFFF000)==0x0AE20000)||((&NPC_DID&0x0FFFF000)==0x0AE21000) ; Pictus256k (type Pictus512k)

  (

    &flashsize=0x00040000

    &flashdriver="c90lc560x.bin"

  )

  ELSE                                            ; Pictus256k

  (

    &flashsize=0x00040000

    &flashdriver="c90fl560x256k.bin"

    SYStem.MemAccess.Denied

    &DualPort=""

  )

)

ELSE IF (CPU()=="SPC560P44")||(CPU()=="MPC5603P") ; Pictus384k (type Pictus512k)

(

  &flashsize=0x00060000

  &flashdriver="c90lc560x.bin"

)

ELSE IF (CPU()=="SPC560P50")||(CPU()=="MPC5604P") ; Pictus512k

(

  &flashsize=0x00080000

  &multiflashbanks=1

  &flashdriver="c90lc560x.bin"

)

ELSE IF (CPU()=="SPC560S")||(CPU()=="MPC5606S")   ; Spectrum1M

(

  &flashsize=0x00100000

  &multiflashbanks=1

  &flashdriver="c90lc560x.bin"

  &NPC_DID=Data.Long(DBG:0x80)

  IF (&NPC_DID&0x0FFFF000)!=0x0AE60000

  (

    ;Spectrum cut2 or newer

    &newflashconfig=1

  )

)

; initialize internal SRAM

Data.Set EA:0x40000000--0x40003fff %Quad 0

FLASH.RESet

; Flash bank 0

FLASH.Create 1. (&flashbase+0x00000000)++0x07fff TARGET Quad 0. ; L0

FLASH.Create 1. (&flashbase+0x00008000)++0x03fff TARGET Quad 1. ; L1

FLASH.Create 1. (&flashbase+0x0000c000)++0x03fff TARGET Quad 2. ; L2

FLASH.Create 1. (&flashbase+0x00010000)++0x07fff TARGET Quad 3. ; L3

FLASH.Create 1. (&flashbase+0x00018000)++0x07fff TARGET Quad 4. ; L4

IF &flashsize>0x00020000

(

  FLASH.Create 1. (&flashbase+0x00020000)++0x1ffff TARGET Quad 5. ; L5

)

IF &flashsize>0x00040000

(

  FLASH.Create 2. (&flashbase+0x00040000)++0x1ffff TARGET Quad 0. ; M0

)

IF &flashsize>0x00060000

(

  FLASH.Create 2. (&flashbase+0x00060000)++0x1ffff TARGET Quad 1. ; M1

)

IF &flashsize>0x00080000

(

  IF &multiflashbanks==1

  (

    IF &newflashconfig==1

    (

      FLASH.Create 3. (&flashbase+0x00080000+0x00000000)++0x1ffff TARGET Quad 0. ; L0

      FLASH.Create 3. (&flashbase+0x00080000+0x00020000)++0x1ffff TARGET Quad 1. ; L1

    )

    ELSE

    (

      ; Flash bank 1

      FLASH.Create 3. (&flashbase+0x00080000+0x00000000)++0x07fff TARGET Quad 0. ; L0

      FLASH.Create 3. (&flashbase+0x00080000+0x00008000)++0x03fff TARGET Quad 1. ; L1

      FLASH.Create 3. (&flashbase+0x00080000+0x0000c000)++0x03fff TARGET Quad 2. ; L2

      FLASH.Create 3. (&flashbase+0x00080000+0x00010000)++0x07fff TARGET Quad 3. ; L3

      FLASH.Create 3. (&flashbase+0x00080000+0x00018000)++0x07fff TARGET Quad 4. ; L4

      FLASH.Create 3. (&flashbase+0x00080000+0x00020000)++0x1ffff TARGET Quad 5. ; L5

    )

    FLASH.Create 4. (&flashbase+0x00080000+0x00040000)++0x1ffff TARGET Quad 0. ; M0

    FLASH.Create 4. (&flashbase+0x00080000+0x00060000)++0x1ffff TARGET Quad 1. ; M1

  )

  ELSE

  (

    &flashaddr=&flashbase+0x00080000

    &Hx=0.

    WHILE &flashaddr<(&flashbase+&flashsize)

    (

      FLASH.Create 3. &flashaddr++0x1ffff TARGET Quad &Hx ; H0..H11

      &flashaddr=&flashaddr+0x20000

      &Hx=&Hx+1.

    )

  )

)

; Shadow row

FLASH.Create 9. (&shadowbase+0x00000000)++0x3fff NOP Quad

; Data flash

FLASH.Create 10. (&flashbase+0x00800000)++0x3fff TARGET Quad 0.

FLASH.Create 10. (&flashbase+0x00804000)++0x3fff TARGET Quad 1.

FLASH.Create 10. (&flashbase+0x00808000)++0x3fff TARGET Quad 2.

FLASH.Create 10. (&flashbase+0x0080c000)++0x3fff TARGET Quad 3.

; CFLASH UTEST sector (OTP)

FLASH.Create 11. (&flashbase+0x00400000)++0x1fff TARGET Quad 0. /OTP; CFLASH UTEST - User OTP area

FLASH.Create 11. (&flashbase+0x00402000)++0x1cff NOP    Quad 0. /OTP; CFLASH UTEST - Reserved

FLASH.Create 11. (&flashbase+0x00403d00)++0x00e7 TARGET Quad 0. /OTP; CFLASH UTEST - User OTP area

FLASH.Create 11. (&flashbase+0x00403de8)++0x0007 TARGET Quad 0. /OTP; CFLASH UTEST - Nonvolatile Low/Mid Address Space Block Locking Register

FLASH.Create 11. (&flashbase+0x00403df0)++0x0007 NOP    Quad 0. /OTP; CFLASH UTEST - Reserved

FLASH.Create 11. (&flashbase+0x00403df8)++0x000f TARGET Quad 0. /OTP; CFLASH UTEST - Nonvolatile Secondary Low/mid Address Space Block Locking Register

FLASH.Create 11. (&flashbase+0x00403e00)++0x00ff NOP    Quad 0. /OTP; CFLASH UTEST - User OTP area

FLASH.Create 11. (&flashbase+0x00403f00)++0x00ff TARGET Quad 0. /OTP; CFLASH UTEST - Reserved

; DFLASH UTEST sector (OTP)

FLASH.Create 12. (&flashbase+0x00c00000)++0x1fff TARGET Quad 0. /OTP; DFLASH UTEST - User OTP area

FLASH.Create 12. (&flashbase+0x00c02000)++0x1cff NOP    Quad 0. /OTP; DFLASH UTEST - Reserved

FLASH.Create 12. (&flashbase+0x00c03d00)++0x00e7 TARGET Quad 0. /OTP; DFLASH UTEST - User OTP area

FLASH.Create 12. (&flashbase+0x00c03de8)++0x0007 TARGET Quad 0. /OTP; DFLASH UTEST - Nonvolatile Low/Mid Address Space Block Locking Register

FLASH.Create 12. (&flashbase+0x00c03df0)++0x0007 NOP    Quad 0. /OTP; DFLASH UTEST - Reserved

FLASH.Create 12. (&flashbase+0x00c03df8)++0x000f TARGET Quad 0. /OTP; DFLASH UTEST - Nonvolatile Secondary Low/mid Address Space Block Locking Register

FLASH.Create 12. (&flashbase+0x00c03e00)++0x00ff NOP    Quad 0. /OTP; DFLASH UTEST - User OTP area

FLASH.Create 12. (&flashbase+0x00c03f00)++0x00ff TARGET Quad 0. /OTP; DFLASH UTEST - Reserved

FLASH.TARGET E:&rambase E:&rambase+0x2000 0x1000 ~~/demo/powerpc/flash/quad/&flashdriver /STACKSIZE 0x0200 &DualPort

; flash script ends here if called with parameter PREPAREONLY

IF &param_prepareonly

  ENDDO PREPAREDONE

;========================================================================

; Flash programming example

;

; Flash programming speed is about three times faster when memory class E:

; is used for data buffer (DUALPORT memory access). For DUALPORT access it

; is required to setup MemAccess NEXUS for both, NEXUS and JTAG debugger.

DIALOG.YESNO "Flash programming prepared. Program flash memory now?"

LOCAL &progflash

ENTRY &progflash

IF &progflash

(

  FLASH.ReProgram ALL /Erase

  Data.LOAD.auto *

  FLASH.ReProgram off

)

ELSE

(

  FLASH.List

)

; set JTAG clock back to default

SYStem.BdmClock 4MHz

ENDDO

P.S : Sorry.I was not able to attach the jmm file here so i had to copy paste it whole.

Regards,

Raghavendra

0 Kudos

1,420 Views
raghavendrapura
Contributor I

Hello Reinhard,

Many thanks for your information.

Yes i did see that i was using SRAM Trace 32 script which was wrongly suggested by my colleague.

I tried with jpc560x.cmm script i get the error C:\T32\demo\powerpc\flash\quad\tbd.bin not found.

Could you please assist me where can find the file tbd.bin? Do i have to edit some settings in the jpc560x.cmm file before running the script?

Apart from this do you see any other issue in my environment or do you have any recommended best practice.

Below is my environment :

Development Board : TRK-MPC5606B

Configuration Tool for Firmware : RappiD Tool

Debugger: Trace 32 and PEMICRO Multi Universal Debugger

IDE : Eclipse / CodeWarrior 10.6

Compiler : GHS Compiler / GCC

Regards,

Raghavendra P

0 Kudos

1,420 Views
raghavendrapura
Contributor I

Hello Reinhold,

Just for testing i commented the line &flashdriver="tbd.bin" and changed line SYStem.CPU MP55XX to SYStem.CPU MPC5606B.

And when i run the cmm it asks for data load and i provide the elf file and it runs for a long time for updating flash and finally hangs.

Regards,

Raghavendra P

0 Kudos

1,420 Views
martin_kovar
NXP Employee
NXP Employee

Hi,

I have just tested your code and it is OK. MCU executes all instructions and stays in endless loop in DRUN mode.

Check if jumper J1 is placed in position SBC_5V then check jumpers J5, J22 (xtal, extal) and j23 which has to be fitted. You can also check jumpers according user manual.

http://cache.freescale.com/files/microcontrollers/doc/user_guide/TRKMPC5604BEVBUM.pdf?fsrch=1&sr=3&p...

Regards,

Martin

0 Kudos

1,420 Views
raghavendrapura
Contributor I

Hello Martin,

When we received the DevKit it already had few jumper settings but how do we verify if this is correct. I am not able to get some information on the required and mandatory jumper setting for the board.

The system MODE is always in reset state.

Regards,

Raghavendra P

0 Kudos

1,420 Views
martin_kovar
NXP Employee
NXP Employee

Hi,

Please clarify me the following:

- which power supply do you use? (external, sbc, usb)

- jumper settings, jumper J1 - J5 also jumper J15, J16, J17 and J22 and J23

Regards,

Martin

0 Kudos

1,420 Views
raghavendrapura
Contributor I

Hello Martin,

1. I have plugged in through external

2. jumper J1 - J5 also jumper J15, J16, J17 and J22 and J23 is closed

Regards,

Raghavendra P

0 Kudos

1,420 Views
martin_kovar
NXP Employee
NXP Employee

Hi,

the jumper setting seems to be ok. So try to create empty project a flash this project to the MCU. Then look at the mode entry module and write me what status is in CURRENT_MODE. It should be DRUN mode.

Then try this code:

     

/* Enter RUN0 with PLL as sys clk (64 MHz) with 8 MHz crystal reference. */
void InitModesAndClks(void) {
      ME.MER.R = 0x0000001D;          /* Enable DRUN, RUN0, SAFE, RESET modes */
CGM.FMPLL_CR.R = 0x01200100; /* 8MHz xtal: Set PLL0 to 64 MHz */
ME.RUNPC[0].R = 0x000000FE; /* enable peripherals run in all modes */
ME.RUN[0].R = 0x001F0074; /* RUN0 cfg: IRCON,OSC0ON,PLL0ON,syclk=PLL */
      /* Mode Transition to enter RUN0 mode: */
      ME.MCTL.R = 0x40005AF0;         /* Enter RUN0 Mode & Key */
      ME.MCTL.R = 0x4000A50F;         /* Enter RUN0 Mode & Inverted Key */
      while (ME.GS.B.S_MTRANS) {} ;    /* Wait for mode transition to complete */
while(ME.GS.B.S_CURRENTMODE != 4) {}; /* Verify RUN0 is the current mode */
}

Regards,

Martin

0 Kudos

1,420 Views
raghavendrapura
Contributor I

Hello Martin,

If you could observe in the screenshot the signal S_SYSCLK = 0000 eventhough we have selected PLL. Thats strange

Regards,

Raghavendra P

0 Kudos