This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM1705 GEL Script Error when Powering EMIFA

Other Parts Discussed in Thread: AM1705

Hi there,

I'm having issues powering up the EMIFA peripheral through the GEL Script for an AM1705. I've attached my current GEL Script with the PSC0_lPSC_enable(0,3) uncommented out. When it is run like this I get the following output:

PLL Configured EMIFA Enabled.txt
ARM9_0: GEL Output: 

AM1707 EVM Startup Sequence

ARM9_0: GEL Output: Disable IRQ/FIQ
ARM9_0: GEL Output: Flush Data Cache
ARM9_0: GEL Output: Flush Instruction Cache
ARM9_0: GEL Output: Disable MMU
ARM9_0: GEL Output: Setup PINMUX Registers...ARM9_0: GEL Output: [Done]
ARM9_0: GEL Output: PLL Setup Complete 
ARM @ 300MHz 
ARM9_0: GEL Output: Setup Power Modules (All on)...ARM9_0: Trouble Writing Memory Block at 0x1c10120 on Page 0 of Length 0x4 
ARM9_0: GEL: Error while executing OnTargetConnect(): Target failed to write 0x01C10120
at *((unsigned int *) (0x01C10000+0x120))=(0x1<<PD) [evmam1705.gel:324]
at PSC0_lPSC_enable(0, 3) [evmam1705.gel:593]
at Setup_Psc_All_On() [evmam1705.gel:41]
at OnTargetConnect()
ARM9_0: Trouble Reading Register REG_ENDIAN: (Error -150 @ 0x2A3C) One of the FTDI driver functions used during configuration returned a invalid status or an error. (Emulation package 6.0.407.3) 
ARM9_0: Trouble Reading Register REG_SYSTEM_TARGET_PSR: (Error -150 @ 0x2A3C) One of the FTDI driver functions used during configuration returned a invalid status or an error. (Emulation package 6.0.407.3) 
ARM9_0: Trouble Reading Register REG_SYSTEM_TARGET_CONFIG: (Error -150 @ 0x2A3C) One of the FTDI driver functions used during configuration returned a invalid status or an error. (Emulation package 6.0.407.3) 
ICEPICK_C: Error: (Error -150 @ 0x0) One of the FTDI driver functions used during configuration returned a invalid status or an error. (Emulation package 6.0.407.3) 
ARM9_0: Trouble Reading Register REG_SYSTEM_MMU_CONFIG: (Error -150 @ 0x2A3C) One of the FTDI driver functions used during configuration returned a invalid status or an error. (Emulation package 6.0.407.3) 
ARM9_0: Trouble Reading Memory Block at 0xfffd3fa0 on Page 0 of Length 0xc: (Error -150 @ 0x2A3C) One of the FTDI driver functions used during configuration returned a invalid status or an error. (Emulation package 6.0.407.3) 
ICEPICK_C: Error: (Error -150 @ 0x0) One of the FTDI driver functions used during configuration returned a invalid status or an error. (Emulation package 6.0.407.3) 
ARM9_0: Error: Failed to get PRSC status
ARM9_0: Unable to determine target status after 20 attempts
ARM9_0: Failed to remove the debug state from the target before disconnecting. There may still be breakpoint op-codes embedded in program memory. It is recommended that you reset the emulator before you connect and reload your program before you continue debugging

However when I run it with that line commented out I get this:

PLL Configured EMIFA NOT Enabled.txt
ARM9_0: GEL Output: 
AM1707 EVM Startup Sequence

ARM9_0: GEL Output: Disable IRQ/FIQ
ARM9_0: GEL Output: Flush Data Cache
ARM9_0: GEL Output: Flush Instruction Cache
ARM9_0: GEL Output: Disable MMU
ARM9_0: GEL Output: Setup PINMUX Registers...ARM9_0: GEL Output: [Done]
ARM9_0: GEL Output: PLL Setup Complete 
ARM @ 300MHz 
ARM9_0: GEL Output: Setup Power Modules (All on)...ARM9_0: GEL Output: [Done]
ARM9_0: GEL Output: SDRAM Setup Complete @ 114MHz 
ARM9_0: GEL Output: ARM Enabled
ARM9_0: GEL Output: 
Startup Complete.

Occasionally when I run it without initialising the PLL then the error says that "the controller detected a target power loss". 

During the PLL initiasation I've probed the 1.2V pin for the PLL supply and that holds steady without any drop in voltage.

I've also documented another issue that I had with the GEL Script here: 

Let me know if you need any more information or tests that I should do.

  • Have you tried to enable the EMIFA PSC via C code like you did before ?
    Same emulator hand issue ?
  • When I use C I get the following error during the PLL enable command:

    ARM9_0: Can't Run Target CPU: (Error -2030 @ 0x30302820) Internal error: Access to unknown or invalid register was requested. Restart the application. If error persists, please report the error. (Emulation package 6.0.407.3)

    I've included all my C code and I've double checked that the order of operations agrees with the Technical Reference Manual:

    boot.c
    /*
     * boot.c
     *
     *  Created on: 6 Oct 2016
     *      Author: Haydn
     */
    
    extern void main(void);
    
    
    void boot(void)
    {
      asm(" .global STACKStart");
      asm(" .global _stack");
      asm(" .global main");
    	asm(" NOP");
      asm(" MRS  r0, cpsr");
      asm(" BIC  r0, r0, #0x1F");       // CLEAR MODES
      asm(" ORR  r0, r0, #0x13");       // SET SUPERVISOR mode
      asm(" ORR  r0, r0, #0xC0");       // Disable FIQ and IRQ
      asm(" MSR  cpsr, r0");
      asm(" NOP");
    
      // Set the IVT to low memory, leave MMU & caches disabled
      asm(" MRC  p15,#0,r0,c1,c0,#0");
      asm(" BIC  r0,r0,#0x00002300");
      asm(" BIC  r0,r0,#0x00000087");
      asm(" ORR  r0,r0,#0x00000002");
      asm(" ORR  r0,r0,#0x00001000");
      asm(" MCR  p15,#0,r0,c1,c0,#0");
      asm(" NOP");
    
      // Setup the stack pointer
      asm(" LDR  sp,_stack");
      asm(" SUB  sp,sp,#4");
      asm(" BIC  sp, sp, #7");
    
      // Call to main entry point
      main();
    
      asm("_stack:");
      asm(" .word STACKStart");
    }
    
    
    
    4237.gel_rewrite.c
    /*
     * gel_rewrite.c
     *
     *  Created on: 6 Oct 2016
     *      Author: Haydn
     */
    
    #include "reg_map.h"
    
    
    
    int Sys_Config(void){
    	KICK0R = 0x83e70b13;
    	KICK1R = 0x95a4f1e0;
    
    	PINMUX0 = 0x11112100;  	// EMIFB and RTCK
    	PINMUX1 = 0x11111111;  	// EMIFB
    	PINMUX2 = 0x01111111;  	// EMIFB
    	PINMUX3 = 0x00000000;  	// Reserved
    	PINMUX4 = 0x00000000;  	// Reserved
    	PINMUX5 = 0x11111110;  	// EMIFB
    	PINMUX6 = 0x11111111;  	// EMIFB
    	PINMUX7 = 0x11111111; 	// EMIFB and SPI0
    	PINMUX8 = 0x20011100;  	// UART2, BOOT7 and UART0
    	PINMUX9 = 0x00000002;  	// UART2
    	PINMUX10 = 0x00000000;  // No Use
    	PINMUX11 = 0x00081188;  // UART1
    	PINMUX12 = 0x88808800;  // GPIO
    	PINMUX13 = 0x11088888;  // EMIFA
    	PINMUX14 = 0x00111111;  // EMIFA
    	PINMUX15 = 0x10000000;  // EMIFA
    	PINMUX16 = 0x00000001;  // EMIFA
    	PINMUX17 = 0x00011000;  // EMIFA
    	PINMUX18 = 0x00110010;  // EMIFA
    	PINMUX19 = 0x00000001;  // EMIFA
    
    	return 0;
    }
    
    
    int Setup_PLL(void){
    	int i = 0;
    	unsigned int CLKMODE = 0;
    	unsigned int PLLM = 24;
    	unsigned int POSTDIV = 1;
    	unsigned int PLLDIV3 = 2;
    	unsigned int PLLDIV5 = 2;
    	unsigned int PLLDIV7 = 5;
    
    	PLL0_PLLCTL &= 0xFFFFFFFE;			// Clear PLLEN
    	PLL0_PLLCTL &= 0xFFFFFFF7;			// Clear PLLRST
    
    	for (i = 0; i < 4; i++){			// Wait 4 OSCIN cycles to confirm
    		;
    	}
    
    
    	PLL0_PLLCTL &= 0xFFFFFEFF;			// Clear CLKMODE to select crystal
    	PLL0_PLLCTL &= 0xFFFFFFDF;			// Clear PLLENSRC
    
    
    	PLL0_PLLCTL &= 0xFFFFFFF7; 			// Clear PLLRST
    
    	PLL0_PLLCTL &= 0xFFFFFFFD;			// Clear PLLPWRDWN
    
    	PLL0_PLLM |= PLLM;					// Set PLLM to 24 for 600MHz clock
    
    	PLL0_POSTDIV = (0x8000 | POSTDIV);	// Set POSTDIV to 1 for /2
    
    	while (PLL0_PLLSTAT & 0x1){			// Check GOSTAT bit if transition is ongoing
    		;
    	}
    
    	PLL0_PLLDIV3 = (0x8000 | PLLDIV3);	// Set the EMIFA Clock
    	PLL0_PLLDIV5 = (0x8000 | PLLDIV5);	// Set the EMIFB Clock
    
    	PLL0_PLLCMD = 0x1;					// Set the GOSET bit to initiate transition
    
    	while (PLL0_PLLSTAT & 0x1){			// Wait for GOSTAT bit to clear
    			;
    		}
    
    
    	PLL0_PLLCTL |= 0x8;
    
    	for (i = 0; i < 2400; i++){			// Wait for PLL to lock
    		;
    	}
    
    	PLL0_PLLCTL |= 0x1;
    
    	return 0;
    }
    
    int PSC0_lPSC_Enable(uint32_t LPSC_num){
    
    	while (PSC0_PTSTAT & 0x1){			// Wait for other transitions
    		;
    	}
    
    	*(unsigned int*) (PSC0_MDCTL + 4 * LPSC_num) |= 0x3;
    	// Enable the module
    
    	PSC0_PTCMD = 0x1;					// Initialise the transition
    
    	while (PSC0_PTSTAT & 0x1) {
    		; 								// Wait for power state transition to finish
    	}
    
    	return 0;
    }
    
    int PSC1_lPSC_Enable(uint32_t LPSC_num){
    
    	while (PSC1_PTSTAT & 0x1){			// Wait for other transitions
    		;
    	}
    
    	*(unsigned int*) (PSC1_MDCTL + 4 * LPSC_num) |= 0x3;
    	// Enable the module
    
    	PSC1_PTCMD = 0x1;					// Initialise the transition
    
    	while (PSC1_PTSTAT & 0x1) {
    		; 								// Wait for power state transition to finish
    	}
    
    	return 0;
    }
    
    
    int Setup_PSC(void){
    
    	PSC0_lPSC_Enable(0);		// EDMA Channel Controller
    	PSC0_lPSC_Enable(1);		// EDMA Transfer Controller 0
    	PSC0_lPSC_Enable(2);		// EDMA Transfer Controller 1
    	PSC0_lPSC_Enable(3);		// EMIFA
    	PSC0_lPSC_Enable(4);		// SPI0
    	PSC0_lPSC_Enable(5);		// MMC
    	PSC0_lPSC_Enable(6);		// ARM Interrupt Controller
    	// Number 7 is the ARM core it will be enabled later
    	PSC0_lPSC_Enable(9);		// UART0
    	PSC0_lPSC_Enable(10);		// SCR0
    	PSC0_lPSC_Enable(11);		// SCR1
    	PSC0_lPSC_Enable(12);		// SCR2
    	PSC0_lPSC_Enable(13);		// PRU
    
    	PSC1_lPSC_Enable(1);		// USB0
    
    	PSC1_lPSC_Enable(3);		// GPIO
    
    	PSC1_lPSC_Enable(5);		// EMAC
    	PSC1_lPSC_Enable(6);		// EMIFB
    	PSC1_lPSC_Enable(7);		// MCASP0
    	PSC1_lPSC_Enable(8);		// MCASP1
    
    	PSC1_lPSC_Enable(10);		// SPI1
    	PSC1_lPSC_Enable(11);		// I2C1
    	PSC1_lPSC_Enable(12);		// UART1
    	PSC1_lPSC_Enable(13);		// UART2
    
    	PSC1_lPSC_Enable(17);		// EHRPWM
    
    	PSC1_lPSC_Enable(20);		// ECAP
    	PSC1_lPSC_Enable(21);		// EQEP
    
    	PSC1_lPSC_Enable(24);		// SCR8
    	PSC1_lPSC_Enable(25);		// SCR7
    	PSC1_lPSC_Enable(26);		// SCR12
    
    	PSC1_lPSC_Enable(31);		// Shared RAM
    
    
    
    	return 0;
    }
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    3527.main.c
    /*
     * main.c
     */
    
    
    
    #include "reg_map.h"
    
    int main(void) {
    	
    	Sys_Config();
    	Setup_PLL();
    	Setup_PSC();
    
    
    
    
    
    
    
    	return 0;
    }
    
    reg_map.h

  • Hi Haydn

    From your other posts it appears that you do have hardware issues with your custom board

    You mentioned

    "It seems that I managed to solve this error by increasing the current limit on my power supply to 1A. It was previously at 500mA and the board was drawing about 25mA so I didn't really think it could be the power supply. But that's all I've changed.

    In summary for anyone who else finds this thread, the PLL and PSC error was solved by heating up the ground pad again to make sure that it was soldered correctly and then the next error was caused by a current limit that was too low. "

     

    Have you fixed all of these issues? I still think the type of errors you are getting are related to potential issues with your board design.

    It will be very difficult to provide good support , if you have marginality in your design somewhere  - so you may want to debug this further and share what you find and if you are able to eliminate this being a board issue etc for us to help you further.

    Regards

    Mukul 

  • Hi Mukul,

    In the other post I also realised that I had left some startup code commented out and that as soon as I uncommented it then the GEL Script stopped working again.
    I definitely agree that I have some hardware issues however since I am a student I don't know where to begin to look. I'm happy to send my schematics and PCB layout to you in an email if that will help you give me advice.
    As I also said in the other post I'm going to get some more components and set up another board in about 2 weeks. I'm just really busy with my University work at the moment.
  • Haydn,

    We do not have any issue with the GEL file on our EVMs. Since you do have the hardware issues on your custom board, you see problem with the GEL file initialization.

    We do not do the schematics and PCB layout review through E2E forum. You may need to submit the review request through your local FAE.

    Regards,
    Senthil