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.

CCS/TMS320F28075: Previously Working Project now gets stuck in Boot ROM

Part Number: TMS320F28075

Tool/software: Code Composer Studio

I'm not sure what happened.

I have a bootloader that starts on the processor which jumps to a main program.

This has been working for a long time.  

Suddenly, my boot loader will not start on power up or after a reboot.  From the debugger, I can see that it seems to get stuck after a reboot at 0x3fee00 then goes to 0x3fee04 then loops back to 0x3fee00.

My OTP has never been written and still appears to be the original values (all ones) (this is from both Z1 and Z2).  My boot pins GPIO72 and GPIO84 are both high (they have a 100K pull up on them).

I can't seem to get the debugger to attach with the bootROM source code, one reason being I can't find the old compiler anymore (can you give me a link to the legacy compilers page, I can't seem to find it anymore?).

The boot loader has not changed and it's starting up and working fine on another board with the same processor.  I have not had the chance to see if if it works on another board just yet.

Can you tell me why this is getting stuck and jumping to flash or help me connect and debug what might be happening in the debugger?

  • I've tracked it a little farther.

    GPIO72 is being held low.. I've removed the CAN transceiver it's connected to (CAN works when I get it started with the debugger). I've still got the 100K attached to the pin and to 3.3V.

    It appears that the processor is holding this pin low.

    I've tried adjusting the code to force this pin high before the restart (switch to GPIO and force high), but as soon as the Boot ROM starts, it pulls it low again... This forces it into a SCI Boot mode (which matches the MAP file from the BOOT ROM source)

    Again, this worked before and it works on other boards, now it doesn't. Is it somehow possible this is showing damage to the processor on this pin? If so, why would it still work as a CAN transceiver? Is my pull up too weak at 100K?
  • Going a bit further...  Changed the 100K pull up to a 1K...  no dice...  still low (not quite zero) with roughly 3+ mA pulling it low.

    At this point the only option was to override the defaults and actually write the OTP Boot Control Bits.

    That worked, the processor now starts up to flash on reset and power off/on.  I still have no idea and it's not clear why GPIO72 is pulling low when the Boot ROM starts.

    I added a check to the boot loader to verify the OTP is the correct bits, if not.  It writes it to values that force Flash.

    #pragma CODE_SECTION(Flash_Setup_OTP,ramFuncSection);
    Uint16 Flash_Setup_OTP(void)
    {
    	//Sets up OTP to force boot load from flash since we don't use TI's bootloader:
    
    	Uint32 tempBoot;
    	//Set the GPIO84 as boot select pin 1 (normally GPIO72 which is assigned to CANB):
    	tempBoot = (Uint32)85 << 24;
    	//Set the GPIO84 as boot select pin 0:
    	tempBoot += (Uint32)85 << 16;
    	//Set the Boot mode to Get/Wait (always boot to flash or wait if emulator attached):
    	//0xFF is used as it defined the "other" which means FLASH/Wait, and means this value can be overwritten later:
    	tempBoot += (Uint32)0xFF << 8;
    	//Set the Key:
    	tempBoot += (Uint32)0x5A;
    
    
    	Uint16 Buffer[2];	  	//Data value Buffer
    	Buffer[0] = (Uint16)(tempBoot & 0xFFFF);
    	Buffer[1] = (Uint16)(tempBoot >> 16);
    
    	volatile Uint32 Address = DCSM_Z2_BOOTCTRL_ADDRESS;
    
    	//See if it's already written:
    	if(DcsmZ2Otp.Z2OTP_BOOTCTRL != tempBoot)
    	{
    		//It's not:
    		//Write the value:
    		//DcsmZ1Otp.Z1OTP_BOOTCTRL = tempBoot;
    		EALLOW;
    		//Write the words to flash:
    		volatile Fapi_StatusType oReturnCheck;
    		oReturnCheck = Fapi_issueProgrammingCommand((uint32 *)Address, &Buffer[0], 2, 0, 0, Fapi_AutoEccGeneration);
    
    		while(Fapi_checkFsmForReady() == Fapi_Status_FsmBusy);
    		EDIS;
    
    		if(oReturnCheck != Fapi_Status_Success)
    		{
    			//
    			// Check Flash API documentation for possible errors
    			//
    			return FALSE;
    		}
    
    		return TRUE;
    	}
    
    	return TRUE;
    
    }

    NOTE:  This can be done to Z1 as well, but it works if you write either.  I figure I can still use Z1 if I want to change it something else later and I've already written Z2.

    For someone looking to write these values, the process is semi complicated.  The writing of the values requires the CSM unlocked (done before this function), the flash API to be initialized (also done before this function), and then to write the values as if they are flash you are writing program code to (shown).  I don't think the ECC auto-generation option is needed for this section of flash, but it worked with it on, so I left it.

  • Kyle

    Glad you found a solution that worked for you. The 100k should have been more than enough. The boot code doesn't configure any pins except as part of the bootloaders, so it's possible the device may have been damaged.

    Best regards
    Chris