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.

TMS320F2812 CKFA software help...URGENT

Other Parts Discussed in Thread: TMS320F2812, SPRC097

Hi,

 

I am working with the tms320f2812 controller to be programmed via the serial port. I have all the hardware it needs including the edsp starter kit and the link research module used in "TMS320F281x Boot ROM Serial Flash Programming" and it works fine with the computer. The computer is able to transfer the CKFA file and the appcode to the TMS320F2812 using the serial port. But my task includes making this work with a microcontroller.

The micro controller I am using the Microchips 18F4620, which has 2 serial ports. At the end of the day, I would like the user to send the data through one of the serial ports to the microcontroller, which then transferrs the data to the Edsp board using the 2nd serial port. It all sounds simple, here is where the complication lies.

When the CKFA software is running, the DSP displays the following:

///////////////////////////////

Processor is unlocked.

Communication kernel received and executing.

Type 'a' to relock baud-rate:  

/////////////////////////////

when 'a' is typed, the baud rate is relocked again and the following display appears :

/////////////////////////////

 

Flash Checksum = 0xB98B

FLASH is not erased and should not be programmed until it is erased.

 

Erase FLASH? (y/n): y //user input

 

Erasing ... please wait ** erasing done

///////////////////////////////

 

So when a micro is attached on the other end, it would not be able to work with that, so I tried to modify the CKFA code so that the software does not ask for user inputs and just programs the data, but the problem is I cant seem to do it. What ever I try the CKFA comes to :

/////////////////////////////

Processor is unlocked.

Communication kernel received and executing.ׂþ

////////////////////////////

and STOPS.

Here is a segment of the code I am running, kindly let me know if I am doing anything wrong.

 

//////////////////////////////////

void main2(void)

{   

   Uint16 ErrorFlag, temp, Status;

 

/*------------------------------------------------------------------

 To use the F2812, F2811 or F2810 Flash API, the following steps

 must be followed:

 

      1. Modify Flash281x_API.config.h for your targets operating

         conditions.

      2. Include Flash281x_API_Library.h in the application.

      3. Add the approparite Flash API library to the project.

 

  The user's code is responsible for the following:

 

      4. Initalize the PLL to the proper CPU operating frequency.

      5. If required, copy the flash API functions into on-chip zero waitstate

         RAM.  

      6. Initalize the Flash_CPUScaleFactor variable to SCALE_FACTOR 

      7. Initalize the flash callback function pointer. 

      8. Optional: Run the Toggle test to confirm proper frequency configuration

         of the API. 

      9. Optional: Unlock the CSM.  

     10. Call the API functions: Flash_Erase(), Flash_Program(), Flash_Verify()

         

  The API functions will:

      

       Disable the watchdog

       Check the device revision (REVID).  This API is for Revision C silicon

       Perform the desired operation and return status

------------------------------------------------------------------*/

 

SCI_SendStatus("Communication kernel received and executing.");

// SCI_SendStatus("\n\rType 'a' to relock baud-rate: "); // This line was previously functional

 

 

/*------------------------------------------------------------------

 Initalize the PLLCR value before calling any of the F2810, F2811

 or F281x Flash API functions.

        

     Check to see if the PLL needs to changed

     PLLCR_VALUE is defined in Example_Flash281x_API.h

     1) Make the change

     2) Wait for the DSP to switch to the PLL clock

        This wait is performed to ensure that the flash API functions 

        will be executed at the correct frequency.

     3) While waiting, feed the watchdog so it will not reset. 

------------------------------------------------------------------*/

 

    initPLL();

 

/*------------------------------------------------------------------

  Initalize Flash_CPUScaleFactor.

 

   Flash_CPUScaleFactor is a 32-bit global variable that the flash

   API functions use to scale software delays. This scale factor 

   must be initalized to SCALE_FACTOR by the user's code prior

   to calling any of the Flash API functions. This initalization

   is VITAL to the proper operation of the flash API functions.  

   

   SCALE_FACTOR is defined in Example_Flash281x_API.h as   

     #define SCALE_FACTOR  1048576.0L*( (200L/CPU_RATE) )

     

   This value is calculated during the compile based on the CPU 

   rate, in nanoseconds, at which the algorithums will be run.

------------------------------------------------------------------*/

   

   Flash_CPUScaleFactor = SCALE_FACTOR;

 

 

/*------------------------------------------------------------------

  Initalize Flash_CallbackPtr.

 

   Flash_CallbackPtr is a pointer to a function.  The API uses

   this pointer to invoke a callback function during the API operations.

   If this function is not going to be used, set the pointer to NULL

   NULL is defined in <stdio.h>.  

------------------------------------------------------------------*/

   

 

 

//// the lines below were previously functional in the original code

 

 

//   Flash_CallbackPtr = &MyCallbackFunction; 

//   MyCallbackCounter = 0; // Increment this counter in the callback function

 

//Prep SCI with new baud rate

 

/* SCIA_Init();     Tirtho

SCIARegs.SCIFFTX.bit.SCIFFENA = 0;

SCIA_AutobaudLock();

SCIARegs.SCICTL1.bit.SWRESET = 0;

SCIARegs.SCICTL1.bit.SWRESET = 1;

SCIARegs.SCIFFTX.bit.SCIFFENA = 1;

SCIARegs.SCIFFTX.all &= 0x7FFF;

SCIARegs.SCIFFTX.all |= 0x8000;

SCI_SendStatus(" baud-rate relocked\n\r\r ");

*/

//Erase flash

temp = checksum_flash(); // I would like to jump to this segment of the code, but it does not seem to do so.

tempL = Convert_HEXtoASCII(temp);

SCI_SendStatus("\n\n\rFlash Checksum = 0x");

SCI_SendHexLong(tempL);

if(temp==0)

SCI_SendStatus("\n\rFLASH appears to be erased already.");

else

SCI_SendStatus("\n\rFLASH is not erased and should not be programmed until it is erased.");

SCI_SendStatus("\n\n\rErase FLASH? (y/n): ");

temp = 1; //intially it was "temp = SCIA_GetByteData_app();"

if( temp == 1)//initially it was "if( temp != 'n')" Tirtho 

{

SCI_SendStatus("\n\rErasing ... please wait");

#if FLASH_F2810

Status = Flash_Erase(SECTOR_F2810,&EraseStatus);

#endif

 

#if FLASH_F2811 | FLASH_F2812

Status = Flash_Erase(SECTOR_F2812,&EraseStatus);

#endif

if(Status != STATUS_SUCCESS) 

{

  SCI_SendStatus("\n\r Flash Erase Error ");

  Example_Error(Status);

}

SCI_SendStatus(" ** erasing done\n\r");

}

  

//Transfer and program application code

SCI_SendStatus("\n\rReady for application data transfer...\n\r");    

   SCIA_BlockProcessing();

 

//Calculate new checksum and compare with expected value

SCI_SendStatus(" ** application programmed");

temp = checksum_flash();

tempL = Convert_HEXtoASCII(temp);

SCI_SendStatus("\n\rFlash Checksum = 0x");

SCI_SendHexLong(tempL);

ErrorFlag = temp - CHECKSUM_EXPECTED;

if(ErrorFlag)

   {

SCI_SendStatus("  ** checksum error ");

   Example_Error(100);

}

SCI_SendStatus("  ** checksum verified ");

 

//CKFA software done

///////////////////////////////////////////////////

void initPLL(void)

{

    int i;

    if(*PLLCR != PLLCR_VALUE) 

    {

       EALLOW;

       *PLLCR = PLLCR_VALUE;

      

    

    // Wait for PLL to lock

       // Each time through this loop takes ~14 cycles

       // PLL Lock time is 131072 Cycles

       for(i= 0; i< 131072/14; i++){

           //*WDKEY = 0x0055;//The omitted lines were present in the original code

           //*WDKEY = 0x00AA;

 *WDCNTR = 0x0000;// NEW Code, cleared the watchdog counter, since we are not using an input key from the user.

       }

       for(i= 0; i< 131072/14; i++){

           //*WDKEY = 0x0055;

           //*WDKEY = 0x00AA;

           *WDCNTR = 0x0000;// NEW Code, cleared the watchdog counter, since we are not using an input key from the user.

       } 

       EDIS;

    }

 

return;

}

///////////////////////////////////////////

 

I would be glad if anyone could help me out. 

 

Thanks

T

  • Tranz,

     

    The software appears to work with the PC to 28x connection just not with the micro.  

    You should go about this by a debug approach to establish 28x to 28x communication before going to the non-28x support.  The app-report details the procedure required for 28x to 28x communication.

     

    Regards,

     

    Tim Love

  • hi

    tranz

    you have done the serial programming using the SCI_A  as you are telling,

    you have used the LS-2812COM . but i have created my own board(with 1 RS232 uart Transciever ) and connecting it the eZdspF2812

    but i am  not able to download the program to  flash through serial port SCI_A.

    can u suggest me the steps which i ahve to do from begining.

    thanks

    anu

  • Anu,

     

    I just replied to your other posting and suggested this app note which Tranz is using. Test  the serial link between eZdsp and the PC (with the added hardware) by using 281xSci_Echoback example project from software folder SPRC097 available on TI website.

     

    Pradeep Shinde 

  • hi pradeep

    thnks for the suggestion but i have already tried this method and it is working fine. it is echoing back the character , but it is not working boot from SCI_A mode is there any hardware configuration i have to change other than the jumper settings then please let me know

    thank

    anu

     

  • Hi Anu,

    Sorry for the late response. There are only two modifications to be done on the eZdsp board.One is the voltage and the other are the jumper settings to make the eZdsp boot from SCI A.

    Cheers

  • Hi Anu,

    Correct setting of boot-mode selection pins to SCI-A is important. You already have a transceiver. Do check is the connections between TX and RX pins between COM port and the transceiver are correct. This is one of the common mistakes.

    Pradeep

     

     

  • hi

    thanks for the response

    i have done all the jumper settings required for SCI boot mode . and transcivers also connected properly (as it was working in the echoback mode perfectly). but i think it may  not be going in to boot from SCI mode can u give some other solution

    and tranz u are talking about changing the voltage which voltage i have to change.

    thanks

    anu

  • Check the ezdsp manual you got with the kit or go to

    http://c2000.spectrumdigital.com/ezf2812/

    and check the technical reference guide for the power settings ( there are 2 options 5V and 3.3V , check jumper 4 and 5). Its been a long time since I looked at it, but I think it should be set at 3.3V to enable SCi based booting.

    Hope this helps.

    Cheers

  • Hi,

    To set the booting from SCI the only requirement is setting the boot-mode jumpers (JP7, JP8 = 0 and JP11, JP12 = 1). The 'Hi' level side of jumpers is hard connected to 3.3V (GPIO can not tolerate 5V). Tranz is probably talking about jumpers JP4, JP5 which are provided to select 3.3V or 5V supply for P8/P4 and P2 headers. They do not play any role for 'boot-to-SCI'.

    Check (with scope or DMM) if actually these pins on the part read the required voltage levels. I have seen once on one board though jumper was in correct position it was not making proper contact and not booting from SCI.

    Also check if Rx signal on Transceiver is connected to TX pin of the COM connector and vice-versa. In Echo-back test you might have just shorted Rx and Tx pins of the transceiver; but that does not ensure correct RX ->TX and Tx -> RX connections from PC to F2812. You can debug this by sending a character from PC (using hyper-terminal) and checking the RX register. 

    If everything above does not produce the result the only thing I can suspect is bad chip.

    Pradeep

     

  • hi pradeep

    thanks for your valuable suggestions i have checked the voltage levels for the jumpers

    for JP7 it is 3.25 v so i think it is not going to boot to SCI mode(because by default the SCITXDA is internally pulled up) . all other jumper are correct and i have seen the voltage levels also. as u are telling that u have gone through this type of case(board ),where all the things are correct(jumper setttings ) but then also it is not booting up. how u have solved the problem then please tell me,

    and one more doubt ,how to check whether it is going to boot to SCI mode or not

     

    thanks

    anu

     

  • hi pradeep

    thanks yaar

    the problem is solved now ,

    actually the problem was the jumper JP11 was mounted wrongly on the board as compared to its reference guide . so thats why it is giving problem

    thanks yaaar

    Anu