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.

programming algorithm problem on TMS470R1A384

Other Parts Discussed in Thread: TMS470R1A384

We are a universal programmer manufacturer and now working on the algorithm development for TMS470R1A384.

We've met a problem in mode entry. Anybody can help me? Thanks.

Problem:
 
We fail to enter debug mode. When we check Debug Status Register, the data we get is 0x16.
In addition, after IDCODE command is issued, the ID value read back is 0xE02F, 0x 3100.
The programming specification we are referring to is tms470r1x_jtag_revision2.2.pdf.
What do you think causes this problem?
The following are our pin setting and mode entry flow.
Thanks!
 
PIN Setting
VCCIO = VCCP = ADREFHI = VCCAD = 3.3V
   VCC = 1.8V
   VSS, ADREFLO,VSSAD, TEST connect to Ground
 
1.      Initial TAP to Run-Test/Idle
//Initial PIN state
IO(TCK_Port) = 1;                                   ! TCK -> higt                         
IO(TMS_Port) = 1;                                   ! TMS -> high            
IO(TDI_Port) = 0;                                    ! TDI -> low   
IO(TDO_Port) = 1;                                   ! floating TDO to Z-high
//release TRST
IO(TRST_Port) = 0;                                  ! TRST -> low                                    
Delay_10us_Scale;
IO(TRST_Port) = 1;                                  ! TRST -> high
Delay_2us_Scale;
//Go to Run-Test/Idle
IO(TMS_Port) = 1;                                   ! TMS -> high
CALL  TCK_10_Pulse;            ! TCK plus 10 more times to go to Test-Logic-Reset
IO(TMS_Port) =0;                                    ! TMS -> low
CALL  TCK_1_Pulse;                  ! Go to Run-Test-Idle
 
3.  Get IDCODE then go to Run-Test/Idle
            After executing IDCODE instruction, we Read out data 0xE02F, 0x 3100
 
4.      Select and activate scan chain 2
// JTAG instruction SCAN_N scan in, then go to Run-Test/Idle
    IO(TMS_Port) = 1;                         ! TMS -> high
CALL  TCK_1_Pulse;                ! Go to Select-DR-Scan
            CALL  TCK_1_Pulse;                        ! Go to Select-IR-Scan
IO(TMS_Port) = 0;                                 ! TMS -> low
            CALL  TCK_1_Pulse;                        ! Go to Capture-IR
            CALL  TCK_1_Pulse;                        ! Go to Shift-IR
            AR = 2;                                                                      
DM(Data_In) = AR;
            CALL shift_instruction_Run-Test/Idle;
// JTAG data 0x2 scan in, then go to Updae-DR
            IO(TMS_Port) = 1;                             ! TMS -> high
            CALL  TCK_1_Pulse;                        ! Go to Select-DR-Scan
            IO(TMS_Port) = 0;                             ! TMS -> low
            CALL  TCK_1_Pulse;                        ! Go to Capture-DR
            CALL  TCK_1_Pulse;                        ! Go to Shift-DR
            AR = 2;                                                           ! scan chain number
            DM(Data_In) = AR;
            CALL shift_instruction_Updae-DR/IR;       
// JTAG instruction INTEST scan in, then go to then go to Run-Test/Idle
            IO(TMS_Port) = 1;                             ! TMS -> high
            CALL  TCK_1_Pulse;                        ! Go to Select-DR-Scan
            CALL  TCK_1_Pulse;                        ! Go to Select-IR-Scan
            IO(TMS_Port) = 0;                             ! TMS -> low
            CALL  TCK_1_Pulse;                        ! Go to Capture-IR
            CALL  TCK_1_Pulse;                        ! Go to Shift-IR
            AR = 0xC;                                         
            DM(Data_In) = AR;
            CALL shift_instruction_Run-Test/Idle;
 
5. Set DBGRQ bit in Debug Control Register then go to Run-Test-Idle
            IO(TMS_Port) = 1;                             ! TMS -> high
            CALL  TCK_1_Pulse;                        ! Go to Select-DR-Scan
            IO(TMS_Port) = 0;                             ! TMS -> low
            CALL  TCK_1_Pulse;                        ! Go to Capture-DR
            CALL  TCK_1_Pulse;                        ! Go to Shift-DR                                            
                       
            AR = 16;
            DM(Data_Len) = AR;           
            AR = 0x02;                                         ! low word
            DM(Data_In) = AR;
            CALL shift_instr_inScan2;
           
            AR = 0x00;                                         ! high word
            DM(Data_In) = AR;                                      
            CALL shift_instr_inScan2;
 
            AR = 5;
            DM(Data_Len) = AR;
AR = 0x00;                                                         ! EmbeddedICE Debug Control Register address
            DM(Data_In) = AR;                                      
            CALL shift_instr_inScan2;
                       
            AR = 0x01;                                                     ! write bit
            IO(TDI_Port) = AR;                           ! last bit shift 'in'
            IO(TMS_Port) = 1;                                         ! TMS -> high
            CALL TCK_1_Pulse;                         ! Go to Exit1-DR
            CALL TCK_1_Pulse;                         ! Go to Update-DR
            IO(TMS_Port) = 0;                                         ! TMS -> low
            CALL TCK_1_Pulse;                         ! Go to Run-Test-Idle  
 
6.  Check if TMS470R1x Core is in Debug mode, read Debug Status Register
            IO(TMS_Port) = 1;                                         ! TMS -> high
            CALL TCK_1_Pulse;                         ! Go to Select-DR-Scan
            IO(TMS_Port) = 0;                                         ! TMS -> low
            CALL TCK_1_Pulse;                         ! Go to Capture-DR
            CALL TCK_1_Pulse;                         ! Go to Shift-DR
           
            AR = 16;
            DM(Data_Len) = AR;                                               
            AR = 0x00;                                         ! low word
            DM(Data_In) = AR;
            CALL shift_instr_inScan2;
            AR=DM(Data_Out);
            DM(Data_Out1) = AR;
                       
            AR =0x00;                                          ! high word
            DM(Data_In) = AR;                                      
            CALL shift_instr_inScan2;
            AR=DM(Data_Out);
            DM(Data_Out2) = AR;
                       
            AR = 5;
            DM(Data_Len) = AR;           
            AR = 0x01;                                         ! EmbeddedICE Debug Status Register address
            DM(Data_In) = AR;
            CALL shift_instr_inScan2;
                       
            AR = 0x00;                                                     ! read bit
            IO(TDI_Port) = AR;                           ! last bit shift 'in'
            IO(TMS_Port) = 1;                                ! TMS -> high
            CALL TCK_1_Pulse;                         ! Go to Exit1-DR
            AR = IO(TDO_Port);                         ! a bit shift 'out'
            AR = IO(PD_Data_Get_Port);
            CALL TCK_1_Pulse;                         ! Go to Update-DR
            IO(TMS_Port) =0;                                          ! TMS -> low
            CALL TCK_1_Pulse;                         ! Go to Run-Test-Idle  
 
Repeat step 6 more times, we still get data 0x16 from Debug Status Register,
DBGACK(bit0) = 0, nMREQ = 0, we fail to enter the debug mode.
 
 
 
 
//Subroutine:
                        MX1 = 1;
                        MY1 = 0;
shift_instruction_Run-Test/Idle:                                                                                                     
AY0=0x1;
AR = DM(Data_In);                                  
CNTR = 3;                                                                                     
DO shift_loop_1 UNTIL CE;
IO(TDI_Port) = AR;                                  
CALL TCK_1_Pulse;
SR = LSHIFT AR BY -1(LO);                  
AR = SR0;                                                                                                 
DM(Data_In)=AR;
AR = IO(TDO_Port);                                
AR = IO(PD_Data_Get_Port);                             
AR = AR AND AY0;
AY1 = AR;
AR = DM(Data_Out);
SR = LSHIFT AR BY 1 (LO);              
AR = SR0 OR AY1;                                  
DM(Data_Out) = AR;
shift_loop_1:    AR=DM(Data_In);   
                        IO(TDI_Port) = AR;                          
                        IO(TMS_Port) = MX1;                                  
                        CALL TCK_1_Pulse;                        
                        AR = IO(TDO_Port);            
                        AR = IO(PD_Data_Get_Port);                                 
                        AR = AR AND AY0;
                        AY1 = AR;
                        AR = DM(Data_Out);
                        SR = LSHIFT AR BY 1 (LO);              
                        AR = SR0 OR AY1;                          
                DM(Data_Out) = AR;
                       
                        CALL TCK_1_Pulse;                        
                        IO(TMS_Port) = MY1;                                   ! TMS -> low
                        CALL TCK_1_Pulse;                         ! Go to Run-Test-Idle  
                        RTS;  
 
shift_instruction_Updae-DR/IR:
                    AY0=0x1;
AR = DM(Data_In);                                  
CNTR = 3;                                                                                     
DO shift_loop UNTIL CE;
IO(TDI_Port) = AR;                                  
CALL TCK_1_Pulse;
SR = LSHIFT AR BY -1(LO);                  
AR = SR0;                                                                                                 
DM(Data_In)=AR;
AR = IO(TDO_Port);                                
AR = IO(PD_Data_Get_Port);                             
AR = AR AND AY0;
AY1 = AR;
AR = DM(Data_Out);
SR = LSHIFT AR BY 1 (LO);              
AR = SR0 OR AY1;                                  
DM(Data_Out) = AR;
shift_loop:    AR=DM(Data_In);       
                        IO(TDI_Port) = AR;                          
                        IO(TMS_Port) = MX1;                                  
                        CALL TCK_1_Pulse;                        
                        AR = IO(TDO_Port);            
                        AR = IO(PD_Data_Get_Port);                                 
                        AR = AR AND AY0;
                        AY1 = AR;
                        AR = DM(Data_Out);
                        SR = LSHIFT AR BY 1 (LO);              
                        AR = SR0 OR AY1;                          
                DM(Data_Out) = AR;
                        CALL TCK_1_Pulse;                         Go to Update-IR/DR
                        RTS;  
 
shift_instr_inScan2:                                                                                                 
                        DM(Data_Out)=MY1;
                        AR = DM(Data_Len);
                        CNTR = AR;                                      
                        AR = DM(Data_In);
                        AY0=0x8000;
                        DO Scan2_loop UNTIL CE;
                        IO(TDI_Port) = AR;                                      
                        CALL TCK_1_Pulse;
                        SR = LSHIFT AR BY -1(LO);                      
                AR = SR0;                                                                                                 
        DM(Data_In)=AR;
        AR = IO(TDO_Port);                            
                        AR = IO(PD_Data_Get_Port);                     
                        SR = LSHIFT AR BY 15 (LO);               
                        AR = SR0 AND AY0;
                        AY1 = AR;
                        AR = DM(Data_Out);
                        SR = LSHIFT AR BY -1 (LO);
                        AR = SR0 OR AY1;  
                DM(Data_Out) = AR;                               
Scan2_loop:     AR=DM(Data_In);   

  • Wapping Hu,

    Your problem has been notified to our Flash/JTAG expert member.

    We will get back on this as soon as we can.

    1. Can you tell us what JTAG you are using ?

    2. Are you trying to program Flash using this algorithm or is this an algorithm for your debugger ?

     

    Best Regards,

    Pratip Kumar

    Important Note : Please be aware that the TMS470R1x series is not recommended for new designs.Please see the full 'NRDN' notice here.

    Soon TI will be launching the new TMS470M series of microcontrollers. This series will feature greater ARM CPU performance and a similar peripherial set to the TMS470R1 Series of microcontrollers.  Please come back soon for more information about the TMS470M Series of microcontrollers.  The product preview for the first two microcontrollers in the TMS470M series is available here: TMS470MF0660x - SPNS157. The TMS470M Series Technical Reference Manual is available here: TMS470M TRM.