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/TMS320F28334: Code Composer Studio/TMS320F28334

Part Number: TMS320F28334
Other Parts Discussed in Thread: C2000WARE

Tool/software: Code Composer Studio

Hi ,

I am new to Code composer studio and I need help in create project on CCS. I have a output(.out) file of application code and I need to flash this output code to TMS320F28334 controller using UART communication. Could any one please help on this for implementation. 

Thanks & regards,

Jyoti

  • Hi,

    We provide a serial flash programmer and SCI flash kernels to help with this. We have many threads on E2E regarding this.

    Please read through this carefully: www.ti.com/.../sprabv4b.pdf

    Regards,
    sal
  • Hi Sal,

    Thanks for your reply

    We read document which you shared. We are planning to start with code composer studio, So could you please suggest us more about start on Code composer studio.

    Thanks & regards, 

    Jyoti

  • On the download page you will find some helpful links include a Wiki site.

    www.ti.com/.../CCSTUDIO

    processors.wiki.ti.com/.../Category:CCS

    Regards,
    sal
  • Hi Sal,

    We are flashing kernel and our application code using  f05_DownloadImage.cpp code.  Here we are able to load kernel to our controller but we are unable to load application code to it can you please suggest what might be the issue ?

    Thanks & regards,

    Jyoti

    //###########################################################################// FILE:   f05_DownloadImage.cpp// TITLE:  Download Image function required for serial flash programmer.//// This function is used to communicate and download with the device.  For // F05 devices, the serial flash programmer loads the kernel with a byte by// byte echo back.  When communicating the application to the kernel, it// works differently.  It sends chunks of the application and waits for // a checksum of that data.//###########################################################################// $TI Release: F28X7X Support Library$// $Release Date: Octobe 23, 2014 $//###########################################################################
    #include "../include/f05_DownloadImage.h"
    #include "stdafx.h"#include <stdint.h>#include <stdio.h>#include <stdlib.h>
    #ifndef __linux__#pragma once#include <conio.h>#include <windows.h>#include <dos.h>#endif
    // Linux exclusive#ifdef __linux__
    #include <string.h>#include <errno.h>#include <termios.h>#include <unistd.h>#include <fcntl.h>#include "linux_macros.h"
    #endif //__linux__

    //*****************************************************************************//// Helpful macros for generating output depending upon verbose and quiet flags.////*****************************************************************************#define VERBOSEPRINT(...) if(g_bVerbose) { _tprintf(__VA_ARGS__); }#define QUIETPRINT(...) if(!g_bQuiet) { _tprintf(__VA_ARGS__); }
    //*****************************************************************************//// Globals whose values are set or overridden via command line parameters.////*****************************************************************************extern bool g_bVerbose;extern bool g_bQuiet;extern bool g_bOverwrite;extern bool g_bUpload;extern bool g_bClear;extern bool g_bBinary;extern bool g_bWaitOnExit;extern bool g_bReset;extern bool g_bSwitchMode;extern bool g_bDualCore;extern wchar_t *g_pszAppFile;extern wchar_t *g_pszAppFile2;extern wchar_t *g_pszKernelFile;extern wchar_t *g_pszKernelFile2;extern wchar_t *g_pszComPort;extern wchar_t *g_pszBaudRate;extern wchar_t *g_pszDeviceName;
    //COM Port stuff#ifdef __linux__extern int fd;#elseextern HANDLE file;extern DCB port;#endif

    //*****************************************************************************//// Download an image to the the device identified by the passed handle.  The// image to be downloaded and other parameters related to the operation are// controlled by command line parameters via global variables.//// Returns 0 on success or a positive error return code on failure.////*****************************************************************************intf05_DownloadImage(void){ FILE *Kfh; FILE *Afh;
    unsigned int rcvData = 0; unsigned int rcvDataH = 0; int txCount = 0;
    uint16_t checksum; unsigned int fileStatus; DWORD dwRead;    #ifdef __linux__    unsigned char buf[8]; int readf; unsigned int sendData[8]; #else errno_t error; DWORD dwWritten; unsigned char sendData[8]; #endif
    QUIETPRINT(_T("Downloading %s to device...\n"), g_pszAppFile);
    // // Does the input file exist? // // Opens the Flash Kernel File    #ifdef  __linux__ Kfh = fopen(g_pszKernelFile, _T("rb")); #else error = _wfopen_s(&Kfh, g_pszKernelFile, _T("rb"));    #endif if (!Kfh) { QUIETPRINT(_T("Unable to open Kernel file %s. Does it exist?\n"), g_pszKernelFile); return(10); }
        //Opens the application file     #ifdef __linux__    Afh = fopen(g_pszAppFile, _T("rb"));    #else error = _wfopen_s(&Afh, g_pszAppFile, L"rb"); #endif if (!Afh) { QUIETPRINT(_T("Unable to open Application file %s. Does it exist?\n"), g_pszAppFile); return(10); }
    //Both Kernel, Application, and COM port are open
    //Do AutoBaud  dwRead = 0; sendData[0] = 'A'; #ifdef __linux__ write(fd, &sendData[0], 1);    while (dwRead == 0)    {
        readf = read(fd,&buf,1);        if(readf == -1)        {        QUIETPRINT(_T("Error %s\n"), strerror(errno));        }        dwRead = readf;        rcvData = buf[0];    if(readf == 0)    {    write(fd, &sendData[0], 1);    }    } #else WriteFile(file, &sendData[0], 1, &dwWritten, NULL); while (dwRead == 0) { ReadFile(file, &rcvData, 1, &dwRead, NULL); }    #endif
    if (sendData[0] != rcvData) return(12);

    VERBOSEPRINT(_T("\nKernel AutoBaud Successful")); //Find the start of the kernel data #ifndef __linux__ getc(Kfh); getc(Kfh); #endif getc(Kfh);
    fileStatus = fscanf_s(Kfh, "%x", &sendData[0]);    int i = 0; while (fileStatus == 1) { i++;
    //Send next char
    #ifdef __linux__ write(fd,&sendData[0],1); //usleep(10000); #else WriteFile(file, &sendData[0], 1, &dwWritten, NULL); #endif dwRead = 0; //SAL// while (dwRead == 0)// {// ReadFile(file, &rcvData, 1, &dwRead, NULL);// }// if (sendData[0] != rcvData)// {// return(99);// }
    //Read next char fileStatus = fscanf_s(Kfh, "%x", &sendData[0]); }
    VERBOSEPRINT(_T("\nKernel Loaded")); #ifdef __linux__ sleep(5); #else Sleep(5000); #endif VERBOSEPRINT(_T("\nDone Waiting for kernel boot...attempting autobaud")); #ifdef __linux__ if(tcflush(fd,TCIOFLUSH)== 0) { //printf("Input and Output successfully flushed"); } else { perror("tcflush error"); } #else     int purgeRet = PurgeComm(file, PURGE_RXCLEAR);
        #endif Sleep(5000);
    purgeRet = PurgeComm(file, PURGE_RXCLEAR);

    //Do AutoBaud sendData[0] = 'A';
    #ifdef __linux__ write(fd,&sendData[0],1); buf[0] = 0;    dwRead = 0;   // int counter = 0 ;    while (dwRead == 0)    {    //counter++;      readf = read(fd,&buf,1);        if(readf == -1)        {        QUIETPRINT(_T("Error %s\n"), strerror(errno));        }        dwRead = readf;        rcvData = buf[0];    }
        #else     WriteFile(file, &sendData[0], 1, &dwWritten, NULL);
    dwRead = 0; while (dwRead == 0) { ReadFile(file, &rcvData, 1, &dwRead, NULL); }    #endif
    int  err = GetLastError();
    if (sendData[0] != rcvData) return(12);
    VERBOSEPRINT(_T("\nApplication AutoBaud Successful")); //Find the start of the application data txCount = 0; checksum = 0; #ifndef __linux__ getc(Afh); getc(Afh); #endif getc(Afh);


    while (txCount < 22) { txCount++; fscanf_s(Afh, "%x", &sendData[0]); checksum += sendData[0]; //Send next char #ifdef __linux__    write(fd,&sendData[0],1); #else    WriteFile(file, &sendData[0], 1, &dwWritten, NULL);        #endif } dwRead = 0; while (dwRead == 0) { #ifdef __linux__    readf = read(fd,&buf,1);        if(readf == -1)        {        QUIETPRINT(_T("Error %s\n"), strerror(errno));        }        dwRead = readf;        rcvData = buf[0]; #else ReadFile(file, &rcvData, 1, &dwRead, NULL);     #endif } dwRead = 0; while (dwRead == 0) {     #ifdef __linux__    readf = read(fd,&buf,1);        if(readf == -1)        {        QUIETPRINT(_T("Error %s\n"), strerror(errno));        }        dwRead = readf;        rcvDataH = buf[0]; #else ReadFile(file, &rcvDataH, 1, &dwRead, NULL);     #endif }
    //Ensure checksum matches if (checksum != (rcvData | (rcvDataH << 8))) return(12);

    //RONNIES CODE int wordData; int byteData; txCount = 0; checksum = 0;
    int totalCount = 0; wordData = 0x0000; byteData = 0x0000; fileStatus = 1;
    //Load the flash application while (1){
    fileStatus = fscanf_s(Afh, "%x ", &sendData[0]); if (fileStatus == 0) break; #ifdef __linux__        write(fd,&sendData[0],1); #else WriteFile(file, &sendData[0], 1, &dwWritten, NULL); #endif checksum += sendData[0];
    // Get block size if (txCount == 0x00) { wordData = sendData[0]; } else if (txCount == 0x01) { byteData = sendData[0]; // form the wordData from the MSB:LSB wordData |= (byteData << 8); }
    txCount++; totalCount++;
    //If the next block size is 0, exit the while loop.  if (wordData == 0x00 && txCount > 1) {
    wordData = 0x0000; byteData = 0x0000;
    break; } // will execute when all the data in the block has been sent else if (txCount == 2 * (wordData + 3)) { dwRead = 0; while (dwRead == 0) { #ifdef __linux__ readf = read(fd, &buf, 1); if (readf == -1) { QUIETPRINT(_T("Error %s\n"), strerror(errno)); } dwRead = readf; rcvData = buf[0]; #else ReadFile(file, &rcvData, 1, &dwRead, NULL); #endif } dwRead = 0; while (dwRead == 0) { #ifdef __linux__ readf = read(fd, &buf, 1); if (readf == -1) { QUIETPRINT(_T("Error %s\n"), strerror(errno)); } dwRead = readf; rcvDataH = buf[0]; #else ReadFile(file, &rcvDataH, 1, &dwRead, NULL); #endif } //Ensure checksum matches if (checksum != (rcvData | (rcvDataH << 8))) return(12); else checksum = 0;
    wordData = 0x0000; byteData = 0x0000; txCount = 0x00; } // will execute when the flash kernel buffer is full (0x400 words == 0x800 bytes) else if ((txCount - 6) % 0x800 == 0 && txCount > 6) { dwRead = 0; while (dwRead == 0) {     #ifdef __linux__     readf = read(fd,&buf,1);         if(readf == -1)         {         QUIETPRINT(_T("Error %s\n"), strerror(errno));         }         dwRead = readf;         rcvData = buf[0];         #else ReadFile(file, &rcvData, 1, &dwRead, NULL); #endif } dwRead = 0; while (dwRead == 0) { #ifdef __linux__     readf = read(fd,&buf,1);         if(readf == -1)         {         QUIETPRINT(_T("Error %s\n"), strerror(errno));         }         dwRead = readf;         rcvDataH = buf[0]; #else ReadFile(file, &rcvDataH, 1, &dwRead, NULL);     #endif } //Ensure checksum matches if (checksum != (rcvData | (rcvDataH << 8))) return(12); else checksum = 0; } } VERBOSEPRINT(_T("\nApplication Load Successful"));
    //not sure if should add?    return 0;}

  • I was successful using the kernel, serial flash programmer, and blinky example.

    Please execute the below command using the files I provided in the ZIP to confirm. Use the correct COM port for your setup.

    serial_flash_programmer.exe -d f2833x -v -k f28335_flash_kernel.txt -a Example_2833xLEDBlink.txt -p COM13

    Regards,

    sal

    f2833.zip

  • Hi Sal,

    Can we do same with Code composer studio (without help of MS visual studio) ?

    We found the MS Visual Studio project file on C2000 kit but we didn't find for code composer studio.Can you please suggest where can we get this CCS project file?

    Thanks & regards,

    Jyoti

  • The host code serial flash programmer is built with a C++ program and is built for the target PC. For this we built in in VS.

    I am not aware that CCS has the ability to build C++ code for the host PC.

    So, you can use Visual Studio or use command line tools as well, like gcc, etc.

    sal
  • Hi sal,

    We tested binary code which was given by you (kernel,application code and executable for serial flash programer for LEDBlink example) and it was not working on our custom board.

    Here I attached screenshot which contains logs and you can see it stops at while downloading application image and does not come out from that loop.

    Please provide resolution for the same.

    Thanks & regards,

    Jyoti

  • Hi,

    Since I have the kernel working on our f2833x contorlCARD, I must suggest that you begin to debug this on your board.

    We provide the kernel and serial flash programmer as helps to the customer. You can use the kernel and debug it to get it working with your board or you can create your custom solution.

    Thanks,
    sal
  • Hi Sal,

    Can you please flash our appliaction file on your f2833x control card let us know wheather you are able to flash to  your controller card not. We are facing issue while flashing the below code to our board.

    I have attach 2 application file and serial flash path given below


    1. File name : PQCR_DAC_1.5V.out

    C:\ti\c2000\C2000Ware_1_00_06_00\utilities\flash_programmers\serial_flash_programmer>serial_flash_programmer.exe -d f2803x -k kernel.txt -a PQCR_DAC_1.5V.txt -p COM5 -b 9600 -v 

    2. File name : PQCR_DAC_3V.out

    C:\ti\c2000\C2000Ware_1_00_06_00\utilities\flash_programmers\serial_flash_programmer>serial_flash_programmer.exe -d f2803x -k kernel.txt -a PQCR_DAC_3V.txt -p COM5 -b 9600 -v 

    Please let us know if you are able to flash or not.

    Thanks & regards,

    Jyoti

    PQCR_DAC.zip

  • Hi Sal,

    Did you check flashing our aplication code on your board ?

    We need your help to fix issue on our project.So now we are debugging same code and we are able to load kernel to controller but we are facing issue while flashing application code to controller. 

        

    On above we can write appliaction code to com port file but while we are trying to read same from com port file it stuck and control not going further. Can you please suggest us what might be the issue ?

    Thanks & regards,

    Jyoti 

  • Hi,

    I have not tried using your code.

    You may need to provide the device more time to finish erasing the flash. The flash erase operation can take quite some time.

    Please add a delay after sending the autobaud lock character and after sending the header information, before sending the block size, block address, and data.

    Some data is apparently getting lost and it is likely do to a timing issue. You will need to debug this race condition.

    sal
  • Hi Sal,

    As per your suggestion we are selecting f2803x device for flasing f2833x device at serial flash command (for your reference -d f2803x -k D:\Bhanu\f2833\f28335_flash_kernel.txt -a D:\Bhanu\f2833\PQCR_DAC_3V.txt -p COM7 -b 9600 ).

    For f2803x device it is calling F05_DownloadImage() function inside f05_DownloadImage.cpp file. We didn't found any erase function calling in f05_DownloadImage.cpp and serial_flash_programmer.cpp file.

    Serial_flash_programmer.cpp having erase functions for different devices except f2803x device.So kindly please provide the erase function information for erasing the f2803x device in f05 file or provide the updated .cpp file which supports f2833x devices.

    Thanks & regards,
    Jyoti
  • Hi,

    The erase happens in the device kernel. After performing an autobaud lock and receiving the hex header information, the kernel erases the flash sectors. The erase operation takes a significant amount of time on this device. Please add a delay in the serial flash programmer after sending the header file information.

    This is likely an issue with synchronization of communication. You will need to debug where this is happening and either offer a corrective with a delay or with a handshake.

    Hope this helps,
    sal
  • Hi Sal,

    As you suggested that add delay after serial flash programer after sending header file information, We tried adding multiple delays but no luck.

    For your reference please check below screenshot.

    Can you please suggest what might be the issue ?

    Thanks & regards,

    Jyoti

  • Yes, that was the place I was talking about

    The issue is with the timing between the device and PC.

    Please debug your system and determine where the data is being lost and correct that with adding perhaps some additional delays.

    One what to help yourself debug this is to load the kernel via CCS onto the device and use the serial flash programmer to send the flash image. You can comment out the code in the serial flash programmer which sends the kernel, since you already have it loaded and running via CCS.

    Hope this helps,
    sal
  • f05_DownloadImage_new.cppHi sal,

    We are using F28335 but as you suggested we are passing argument as f2803x.

    we made the one kernel project and one application project as integrated is not working.

     First we try to run the kernel code in visual studio and reset the hardware.  It seems kernel code is loading.

    Then run the application code in visual studio only  then control is coming back to main from following code.

    if (checksum != (rcvData | (rcvDataH << 8)))

    return(12);

    else

    checksum = 0;

    here rcvData is 8 and rcvDataH is 0 hence condition is not matching and control return back to main and not loading application file at all.

    We have also added delay but it did not helped for us.

    I have some query as

    1) after karnel load reset is required or not?

    2)for f2803x we didnt find any erase function,  so erase is not required in the code?

    3) what is difference between rcvData and rcvDataH?

    4) Can you please provide whole project file for f28335?

    Attached the copy of project file. please look into this and let us know the issue.

    Thanks,

    Jyoti

  • Are you saying that the checksum is not as expected? If this is the case, then there may be some issue with the connection or SCI communication. Perhaps a lower baud rate may help. You can also check the communication using an oscilloscope or some other anaylzer to make sure what is being sent by PC and received by PC is correct and as expected.

    1) There is no reset after the kernel is loaded. After the kernel is loaded, the ROM branches to the kernel and executes the kernel.

    2) This is in SCI_Boot.c of the kernel code. There is no erase function in the PC code. The kernel erases the flash before programming it. Please read the Application Report again for better understanding.

    3) rcsData and rcvDataH are the two bytes of the checksum. The first is the low byte. The second is the high byte.

    4) We provide everything you need in C2000Ware. Kernel and serial flash programmer.

    sal
  • f05_DownloadImage(1).cppHi Sal,

    Today i installed the controlSuit 4.9 and as suggested in datasheet of Serial Flash Programming of C2000™ Microcontrollers i started work on serial flash programmer folder in visual studio.

    I observed kernel was loading successfully.

    I am getting error while matching application autobaud.

    In that i found sendData and rcvData were not matching.

    I tried with different baud rate, i observed different values for rcvData.

    I was trying to send 'A' in return i was getting  31, 0,172 values for different baud rate

    I tried adding delay from 10Sec to 1Min after loading the kernel but i am not succeeded.

    I tried one thing. When i added below lines of code in kernel after sending each char, application autobaud successful occurs.

                   dwRead = 0;

    while (dwRead == 0)

    {

    ReadFile(file, &rcvData, 1, &dwRead, NULL);

    Sleep(1);

    }

    printf(("==%lx\n"), rcvData);  

    But later i am sticking at ReadFile(file, &rcvDataH, 1, &dwRead, NULL);   in below loop.

        while (dwRead == 0)

    {

       #ifdef __linux__

        readf = read(fd,&buf,1);

           if(readf == -1)

           {

            QUIETPRINT(_T("Error %s\n"), strerror(errno));

           }

           dwRead = readf;

           rcvDataH = buf[0];

    #else

    ReadFile(file, &rcvDataH, 1, &dwRead, NULL);

    Sleep(50);

       #endif

    }

    Can you please suggest us something to resolve this issue.

    1) After adding read function while loading the kernel why autobaud was succcessfull for application?

    2)Why the control is sticking at ReadFile(file, &rcvDataH, 1, &dwRead, NULL);  in above code?

    3) Why we need to modify the project for F28335  as you said it will work directly ?

    3)Can you please provide the project file for F28335.  

    We are using F28335 but as you suggested we are passing argument as f2803x.

    Attache f05_DownloadImage(1).cpp file. can you please look into this code.

    Thanks,

    Jyoti

  • Hi sal,
    Can you please reply us for above queries ASAP.

    Thanks ,
    Jyoti
  • Hi Jyoti,

    I am not sure what else to say at this point of the debug. I cannot reproduce this issue and have this working on my side.

    I am not sure why the data is coming back different for different baud rates. The autobaud lock feature should be working.

    The PC is waiting at ReadFile because it is expecting some data from the device which it isn't receiving. It is possible that the device received some wrong data and branched to flash after not receiving 0x08AA. Please read through the source code we provide to understand this and read through the ROM bootloader section of the TRM.

    There is an issue with timing on your board between PC and device. You can provide some more syncronization if you wish. You can also remove the checksum feature and revert back to the echo back communication that the SCI bootloader uses. This may help since it appears your board/connection is sending and receiving inconsistently.

    sal
  • Hi Sal,

    serial_flash_programmer.exe -d f2833x -v -k f28335_flash_kernel.txt -a Example_2833xLEDBlink.txt -p COM13

    As you suggest command line to use  f2833x as device id but for our project we are using f2803x  because our project doesn't support f2833x device.So If you have project that support f2833x device please share with us.

    Q . Can you please tell us which gpio pin are you using for this LEDBlinking example ?

    Thanks & regards,

    Jyoti

  • There is no difference in the serial flash programmer if you use the f2803x option. It will call the download functions that are necessary for the f2833x device.

    Use a GPIO that you can monitor.

    sal
  • Hi Sal

    Is there any chances of mismatching of addresses while loading application into device?
    How we will be knowing where we are writing and from where we are reading from the device?

    Thanks,
    Jyoti
  • Hi Sal,

    i have few question as:

    1) Where we are using starting address and ending address of kernel and application?
    2)Why we are not getting ECHO back in application?
    3)Why we are sending Autobaud character for both kernel and application?
    4)Why we need to do autobaud for kernel and application seperately?
    5) IS it necessary to close the kernel file before writting the application file into device?
    6) Is it necessary to close the com port after loading the kernel for application?

    can you please reply us ASAP. Its urgent.

    Thanks
    Jyoti
  • Please read this very detailed application report: www.ti.com/.../sprabv4b.pdf

    And refer to the Boot ROM chapter of the TRM.

    sal
  • We have posted this information in documents so that we do not need to answer the same questions on every E2E post.

    Additionally, you can observe the source code of the serial flash programmer and SCI flash kernel. We provide the source code to aid the customer in reading and understanding the code and also giving the customer the ability to modify it and customize it.

    Thank you,
    sal
  • Dear Sal,

     we are having 2 application files(1.txt and 2.txt). Out of which we are able to load 1.txt application file but unable to load 2.txt. Can you please suggest us what might be the problem. Both files are of same size but very small change in the content. Attached the both application files for your reference.

    5123.1.txt6175.2.txt

    Thanks,

    Jyoti

  • We have got another issue while downloading application images using “serial_flash_programmer.exe”.

    We are able to download our own sample code generated from CCS4.

    We are also able to download some of the provided .out file, after converting them to hex. These files are converted from “*.out”  to “*.txt” using CCS8 provided tool “hex2000.exe”.

    Issue:

    Some of the “*.out” files are not downloading, stops after application Auto baud successful. It does not come out from the loop.

    We would like know the reason , why some of the application hex files are not successfully downloading  while others are downloading?

    Please help us on priority to resolve this issue.

    Thank you,

  • Which operating system are you using to convert the hex files?

    Are you opening the text file in a text editor?

    Sometimes the operating system will append characters to the end of the lines of the hex files.

    Please ensure you rebuild the .txt files and do not open them in a text file.

    sal
  • A debug example for the line ending issue that Sal mentioned: e2e.ti.com/.../2902135

    Thanks and regards,
    Vamsi

  • Application_Image_Not_working.txtApplication_Image_Working.txtHi, Vamsi & Sal,

    As suggested by Vamsi.. we will continue posting new issue here .

    We are able to download our own sample code generated from CCS4.

    We are also able to download some of the provided .out file, after converting them to hex. These files are converted from “*.out”  to “*.txt” using CCS8 provided tool “hex2000.exe”.

    Issue:

    Some of the “*.out” files are not downloading, stops after application Auto baud successful. It does not come out from the loop.

    We would like know the reason , why some of the application hex files are not successfully downloading  while others are downloading?

    PFA : working & not working Application image files.

    we have tested on Windows 10 & 7 Operating systems . we are not opening converted .txt files with Notepad to avoid any issues with appending characters.

    Request you to please check at your end priority and provide resolution.

    Awaiting for your reply

  • Hi,

    We cannot inspect the differences ourselves. We can help you debug this however.

    What are the differences between the different hex files? Are they created the same? What are the differences between the applications (.outs)? Are all of them entirely linked to load to flash? Do you have any sections linked to RAM in these hex files?

    sal
  • Jyoti,

    If you need further help on finding the differences between the failing and passing images, our compiler team may help you analyse it.
    You need to provide all the details (linker cmd, command used to produce the images, is it a standalone image or is part of multiple images for the same application etc.) along with a sample image for failing and passing case.

    Thanks and regards,
    Vamsi
  • Working_NotWorking.zip

    /*
    // TI File $Revision: /main/8 $
    // Checkin $Date: August 28, 2007   11:23:36 $
    //###########################################################################
    //
    // FILE:	F28334.cmd
    //
    // TITLE:	Linker Command File For F28334 Device
    //
    //###########################################################################
    // $TI Release: DSP2833x Header Files V1.03 $
    // $Release Date: December 3, 2007 $
    //###########################################################################
    */
    
    /* ======================================================
    // For Code Composer Studio V2.2 and later
    // ---------------------------------------
    // In addition to this memory linker command file, 
    // add the header linker command file directly to the project. 
    // The header linker command file is required to link the
    // peripheral structures to the proper locations within 
    // the memory map.
    //
    // The header linker files are found in <base>\DSP2833x_Headers\cmd
    //   
    // For BIOS applications add:      DSP2833x_Headers_BIOS.cmd
    // For nonBIOS applications add:   DSP2833x_Headers_nonBIOS.cmd    
    ========================================================= */
    
    /* ======================================================
    // For Code Composer Studio prior to V2.2
    // --------------------------------------
    // 1) Use one of the following -l statements to include the 
    // header linker command file in the project. The header linker
    // file is required to link the peripheral structures to the proper 
    // locations within the memory map                                    */
    
    /* Uncomment this line to include file only for non-BIOS applications */
    /* -l DSP2833x_Headers_nonBIOS.cmd */
    
    /* Uncomment this line to include file only for BIOS applications */
    /* -l DSP2833x_Headers_BIOS.cmd */
    
    /* 2) In your project add the path to <base>\DSP2833x_headers\cmd to the
       library search path under project->build options, linker tab, 
       library search path (-i).
    /*========================================================= */
    
    /* Define the memory block start/length for the F28334  
       PAGE 0 will be used to organize program sections
       PAGE 1 will be used to organize data sections
    
        Notes: 
              Memory blocks on F28334 are uniform (ie same
              physical memory) in both PAGE 0 and PAGE 1.  
              That is the same memory region should not be
              defined for both PAGE 0 and PAGE 1.
              Doing so will result in corruption of program 
              and/or data. 
              
              L0/L1/L2 and L3 memory blocks are mirrored - that is
              they can be accessed in high memory or low memory.
              For simplicity only one instance is used in this
              linker file. 
              
              Contiguous SARAM memory blocks can be combined 
              if required to create a larger memory block. 
     */
    
    
    MEMORY
    {
    PAGE 0:    /* Program Memory */
               /* Memory (RAM/FLASH/OTP) blocks can be moved to PAGE1 for data allocation */
    
       RAMM0       : origin = 0x000050, length = 0x0003B0     /* on-chip RAM block M0 */
       ZONE0       : origin = 0x004000, length = 0x001000     /* XINTF zone 0 */
       RAML0       : origin = 0x008000, length = 0x002000     /* on-chip RAM block L0 */
       RAML1       : origin = 0x00A000, length = 0x001000     /* on-chip RAM block L1 */
       RAML2       : origin = 0x00B000, length = 0x001000     /* on-chip RAM block L2 */
      // RAML3       : origin = 0x00B000, length = 0x001000     /* on-chip RAM block L3 */
       ZONE6       : origin = 0x100000, length = 0x0100000    /* XINTF zone 6 */ 
       ZONE7A      : origin = 0x200000, length = 0x000FC00    /* XINTF zone 7 - program space */ 
       FLASHH      : origin = 0x320000, length = 0x004000     /* on-chip FLASH */
       FLASHG      : origin = 0x324000, length = 0x004000     /* on-chip FLASH */
       FLASHF      : origin = 0x328000, length = 0x004000     /* on-chip FLASH */
       FLASHE      : origin = 0x32C000, length = 0x004000     /* on-chip FLASH */
       FLASHD      : origin = 0x330000, length = 0x004000     /* on-chip FLASH */
       FLASHC      : origin = 0x334000, length = 0x004000     /* on-chip FLASH */
       FLASHA      : origin = 0x33C000, length = 0x003F80     /* on-chip FLASH */
       CSM_RSVD    : origin = 0x33FF80, length = 0x000076     /* Part of FLASHA.  Program with all 0x0000 when CSM is in use. */
       BEGIN       : origin = 0x33FFF6, length = 0x000002     /* Part of FLASHA.  Used for "boot to Flash" bootloader mode. */
       CSM_PWL     : origin = 0x33FFF8, length = 0x000008     /* Part of FLASHA.  CSM password locations in FLASHA */
       OTP         : origin = 0x380400, length = 0x000400     /* on-chip OTP */
       ADC_CAL     : origin = 0x380080, length = 0x000009     /* ADC_cal function in Reserved memory */
       
       IQTABLES    : origin = 0x3FE000, length = 0x000b50     /* IQ Math Tables in Boot ROM */
       IQTABLES2   : origin = 0x3FEB50, length = 0x00008c     /* IQ Math Tables in Boot ROM */  
       FPUTABLES   : origin = 0x3FEBDC, length = 0x0006A0     /* FPU Tables in Boot ROM */
       ROM         : origin = 0x3FF27C, length = 0x000D44     /* Boot ROM */          
       RESET       : origin = 0x3FFFC0, length = 0x000002     /* part of boot ROM  */
       VECTORS     : origin = 0x3FFFC2, length = 0x00003E     /* part of boot ROM  */
    
    PAGE 1 :   /* Data Memory */
               /* Memory (RAM/FLASH/OTP) blocks can be moved to PAGE0 for program allocation */
               /* Registers remain on PAGE1                                                  */
       
       BOOT_RSVD   : origin = 0x000000, length = 0x000050     /* Part of M0, BOOT rom will use this for stack */
       RAMM1       : origin = 0x000400, length = 0x000400     /* on-chip RAM block M1 */
       RAML4       : origin = 0x00C000, length = 0x002000     /* on-chip RAM block L1 */
       //RAML5       : origin = 0x00D000, length = 0x001000     /* on-chip RAM block L1 */
       RAML6       : origin = 0x00E000, length = 0x001000     /* on-chip RAM block L1 */
       RAML7       : origin = 0x00F000, length = 0x001000     /* on-chip RAM block L1 */
       ZONE7B      : origin = 0x20FC00, length = 0x000400     /* XINTF zone 7 - data space */
       FLASHB      : origin = 0x338000, length = 0x004000     /* on-chip FLASH */
    }
    
    /* Allocate sections to memory blocks.
       Note:
             codestart user defined section in DSP28_CodeStartBranch.asm used to redirect code 
                       execution when booting to flash
             ramfuncs  user defined section to store functions that will be copied from Flash into RAM
    */ 
     
    SECTIONS
    {
     
       /* Allocate program areas: */
       .cinit              : > FLASHH      PAGE = 0
       .pinit              : > FLASHA,     PAGE = 0
       .text               : > FLASHA      PAGE = 0
       codestart           : > BEGIN       PAGE = 0
       ramfuncs            : LOAD = FLASHF, 
                             RUN = RAML0, 
                             LOAD_START(_RamfuncsLoadStart),
                             LOAD_END(_RamfuncsLoadEnd),
                             RUN_START(_RamfuncsRunStart),
                             PAGE = 0
       ramfuncs2           : LOAD = FLASHF, 
                             RUN = RAML1, 
                             LOAD_START(_Ramfuncs2LoadStart),
                             LOAD_END(_Ramfuncs2LoadEnd),
                             RUN_START(_Ramfuncs2RunStart),
                             PAGE = 0 
    
       csmpasswds          : > CSM_PWL     PAGE = 0
       csm_rsvd            : > CSM_RSVD    PAGE = 0
    
       InitFuncs        : > FLASHG,     PAGE = 0  	/*use this line just b4 the function "#pragma CODE_SECTION(FunctionName, "InitFuncs");"*/
       MMIFuncs         : > FLASHC,     PAGE = 0  	/*use this line just b4 the function "#pragma CODE_SECTION(FunctionName, "MMIFuncs");"*/
       MMIFuncsII		: > FLASHC,		PAGE = 0  	/*use this line just b4 the function "#pragma CODE_SECTION(FunctionName, "MMIFuncsII");"*/
       MMIFuncsIII		: > FLASHC,		PAGE = 0  	/*use this line just b4 the function "#pragma CODE_SECTION(FunctionName, "MMIFuncsIII");"*/
       
       /* Allocate uninitalized data sections: */
       .stack              : > RAMM1       PAGE = 1
       .ebss               : > RAML4       PAGE = 1
       .esysmem            : > RAMM1       PAGE = 1
       DISPBuffer		   : > RAML6,	   PAGE = 1
    
       /* Initalized sections go in Flash */
       /* For SDFlash to program these, they must be allocated to page 0 */
       .econst             : > FLASHD      PAGE = 0
       .switch             : > FLASHA      PAGE = 0      
    
       /* Allocate IQ math areas: */
       IQmath              : > FLASHC      PAGE = 0                  /* Math Code */
       IQmathTables     : > IQTABLES,  PAGE = 0, TYPE = NOLOAD 
       IQmathTables2    : > IQTABLES2, PAGE = 0, TYPE = NOLOAD 
       FPUmathTables    : > FPUTABLES, PAGE = 0, TYPE = NOLOAD 
          
       /* Allocate DMA-accessible RAM sections: */
       DMARAML4         : > RAML4,     PAGE = 1
     //  DMARAML5         : > RAML5,     PAGE = 1
       DMARAML6         : > RAML6,     PAGE = 1
       DMARAML7         : > RAML7,     PAGE = 1
       
       /* Allocate 0x400 of XINTF Zone 7 to storing data */
       ZONE7DATA        : > ZONE7B,    PAGE = 1
    
       /* .reset is a standard section used by the compiler.  It contains the */ 
       /* the address of the start of _c_int00 for C Code.   /*
       /* When using the boot ROM this section and the CPU vector */
       /* table is not needed.  Thus the default type is set here to  */
       /* DSECT  */ 
       .reset              : > RESET,      PAGE = 0, TYPE = DSECT
       vectors             : > VECTORS     PAGE = 0, TYPE = DSECT
       
       /* Allocate ADC_cal function (pre-programmed by factory into TI reserved memory) */
       .adc_cal     : load = ADC_CAL,   PAGE = 0, TYPE = NOLOAD
    
    }
    
    /*
    //===========================================================================
    // End of file.
    //===========================================================================
    */
    
    

    Hi, Vamsi & Sal,

    We are using standalone application images. We are converting from ".out" to ".txt" using below command
    (hex2000.exe -boot -sci8 -a -o application.txt application.out)

    and then flashing using "serial_flash_programmer.exe",using below arguments :
    (serial_flash_programmer.exe -d f2803x -k kernel.txt -a application.txt -p COM3 -b 9600 -v)

    we are generating.out files from project default rebuild option

    Attached : cmd linker file.(file extension is changed to .txt)
    Attached Images : working & Not working

    Attached .out files    : working & not working
    Attached .txt Files : working & Not Working

    Awaiting for your quick resolution.  8524.Application_Image_Working.txt1234.Application_Image_Not_working.txt

    Thank you

    Regards,
    Bhanu

  • Hi Bhanu,

    thanks, just for clarification for our team:

    - you use the same linker.cmd for both .out files?

    - you build and convert files on Windows machines?

    - What is causing the change in .out file (#define changes, manual edit,...)?

    Just trying to understand what could cause this as the resulting .txt only have minor differences in some bytes. I assume you tried that multiple times on multiple boards? Also in different orders?

    Do you have more working/non-working examples using other source code or build options?

    Best regards,

    Frank

  • Hi, Frank,

    Please find below information :

    - you use the same linker.cmd for both .out files?

    (Yes...we use same linker file)

    - you build and convert files on Windows machines?

    (Yes. we use windows 10 environment)

    - What is causing the change in .out file (#define changes, manual edit,...)?

    (change in some variables which are sent via SPI to configure DAC )

    Check the attached image shows what changes made it working & not working.

    -Just trying to understand what could cause this as the resulting .txt only have minor differences in some bytes. I assume you tried that multiple times on multiple boards? Also in different orders?

    (yes..we have tried on two boards multiple times)

    Attachments :

    Working & Not Working ImagWorking_1v.txtNot_Working2.txtes(set-2) - same linker file has been used

    Thank you,

    Bhanu

  • What does "(change in some variables which are sent via SPI to configure DAC )" mean?

    sal
  • Hi Sal,

    As you have requested to share what are the changes in the code for generating .out file.
    As attached in the earlier screenshot those are changes we are doing in the code for reflecting DAC output that is connected via SPI interface in out custom design board.
    Hope you understand clearly and provide resolution.

    Thank you,

    Regards,
    Bhanu
  • Hi Bhanu,

    Please try this one thing. In the flash kernel, add this one line of code. I am not sure if this will correct it, but it is worth a try.

    In the SCI autobaud lock function add SciaRegs.SCIHBAUD.bit.BAUD = 0;

    Then rebuild the kernel and regenerate the hex file for the kernel.

    //
    // SCIA_AutobaudLock - Perform autobaud lock with the host.
    // Note that if autobaud never occurs
    // the program will hang in this routine as there
    // is no timeout mechanism included.
    //
    void SCIA_AutobaudLock(void)
    {
    Uint16 byteData;

    //
    // Must prime baud register with >= 1
    //
    SciaRegs.SCILBAUD.bit.BAUD = 1;

    SciaRegs.SCIHBAUD.bit.BAUD = 0; //ADD THIS LINE OF CODE

    //
    // Prepare for autobaud detection
    // Set the CDC bit to enable autobaud detection
    // and clear the ABD bit
    //
    SciaRegs.SCIFFCT.bit.CDC = 1;
    SciaRegs.SCIFFCT.bit.ABDCLR = 1;


    Hope this helps,
    sal
  • //###########################################################################
    //
    // FILE:    SCI_Boot.c
    //
    // TITLE:   SCI Boot mode routines
    //
    // Functions:
    //
    //     Uint32 SCI_Boot(void)
    //     inline void SCIA_Init(void)
    //     inline void SCIA_AutobaudLock(void)
    //     Uint32 SCIA_GetWordData(void)
    //
    // Notes:
    //
    //###########################################################################
    // $TI Release: F2833x Support Library v2.00.00.00 $
    // $Release Date: Thu Oct 18 15:47:35 CDT 2018 $
    // $Copyright:
    // Copyright (C) 2009-2018 Texas Instruments Incorporated - http://www.ti.com/
    //
    // Redistribution and use in source and binary forms, with or without 
    // modification, are permitted provided that the following conditions 
    // are met:
    // 
    //   Redistributions of source code must retain the above copyright 
    //   notice, this list of conditions and the following disclaimer.
    // 
    //   Redistributions in binary form must reproduce the above copyright
    //   notice, this list of conditions and the following disclaimer in the 
    //   documentation and/or other materials provided with the   
    //   distribution.
    // 
    //   Neither the name of Texas Instruments Incorporated nor the names of
    //   its contributors may be used to endorse or promote products derived
    //   from this software without specific prior written permission.
    // 
    // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
    // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
    // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
    // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
    // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
    // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
    // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
    // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    // $
    //###########################################################################
    
    //
    // Included Files
    //
    #include "Boot.h"
    
    //
    // Private functions
    //
    inline void SCIA_Init(void);
    inline void SCIA_AutobaudLock(void);
    Uint16 SCIA_GetWordData(void);
    Uint16 SCIA_GetOnlyWordData(void);
    
    //
    // External functions
    //
    extern void CopyData(void);
    Uint32 GetLongData(void);
    extern void ReadReservedFn(void);
    extern unsigned int checksum;
    extern Uint32 byteData1;
    
    //
    // SCI_Boot - This module is the main SCI boot routine. It will load code via
    // the SCI-A port. It will return a entry point address back to the InitBoot
    // routine which in turn calls the ExitBoot routine.
    //
    Uint32
    SCI_Boot()
        {
        Uint32 EntryAddr;
    
        //
        // Assign GetWordData to the SCI-A version of the function.
        // GetOnlyWordData is a pointer to a function. This version doesn't send
        // echo back each character.
        //
        GetOnlyWordData = SCIA_GetOnlyWordData;
    
        SCIA_Init();
        SCIA_AutobaudLock();
        checksum = 0;
    
        //
        // If the KeyValue was invalid, abort the load and return the flash entry
        // point.
        //
        if (SCIA_GetOnlyWordData() != 0x08AA)
        {
            return FLASH_ENTRY_POINT;
        }
    
        ReadReservedFn();
    
        EntryAddr = GetLongData();
        CopyData();
    
        return EntryAddr;
    }
    
    //
    // SCIA_Init - Initialize the SCI-A port for communications with the host.
    //
    inline void
    SCIA_Init()
    {
        //
        // Enable the SCI-A clocks
        //
        EALLOW;
        SysCtrlRegs.PCLKCR0.bit.SCIAENCLK=1;
        SysCtrlRegs.LOSPCP.all = 0x0002;
        SciaRegs.SCIFFTX.all=0x8000;
        
        //
        // 1 stop bit, No parity, 8-bit character, No loopback
        //
        SciaRegs.SCICCR.all = 0x0007;
        
        //
        // Enable TX, RX, Use internal SCICLK
        //
        SciaRegs.SCICTL1.all = 0x0003;
        
        //
        // Disable RxErr, Sleep, TX Wake, Disable Rx Interrupt, Tx Interrupt
        //
        SciaRegs.SCICTL2.all = 0x0000;
        
        //
        // Relinquish SCI-A from reset
        //
        SciaRegs.SCICTL1.all = 0x0023;
        
        //
        // Enable pull-ups on SCI-A pins
        //
        //GpioCtrlRegs.GPAPUD.bit.GPIO28 = 0;
        //GpioCtrlRegs.GPAPUD.bit.GPIO29 = 0;
        GpioCtrlRegs.GPAPUD.all &= 0xCFFFFFFF;
        
        //
        // Enable the SCI-A pins
        //
        //GpioCtrlRegs.GPAMUX2.bit.GPIO28 = 1;
        //GpioCtrlRegs.GPAMUX2.bit.GPIO29 = 1;
        GpioCtrlRegs.GPAMUX2.all |= 0x05000000;
        
        //
        // Input qual for SCI-A RX is asynch
        //
        GpioCtrlRegs.GPAQSEL2.bit.GPIO28 = 3;
        EDIS;
        return;
    }
    
    //
    // SCIA_AutobaudLock - Perform autobaud lock with the host.
    // Note that if autobaud never occurs the program will hang in this routine as 
    // there is no timeout mechanism included.
    //
    inline void
    SCIA_AutobaudLock()
    {
        Uint16 byteData;
    
        //
        // Must prime baud register with >= 1
        //
        SciaRegs.SCILBAUD = 1;
        SciaRegs.SCIHBAUD = 1; //this line is recommended by TI
        //
        // Prepare for autobaud detection. Set the CDC bit to enable autobaud 
        // detection and clear the ABD bit
        //
        SciaRegs.SCIFFCT.bit.CDC = 1;
        SciaRegs.SCIFFCT.bit.ABDCLR = 1;
        
        //
        // Wait until we correctly read an 'A' or 'a' and lock
        //
        while(SciaRegs.SCIFFCT.bit.ABD != 1)
        {
            
        }
        
        //
        // After autobaud lock, clear the ABD and CDC bits
        //
        SciaRegs.SCIFFCT.bit.ABDCLR = 1;
        SciaRegs.SCIFFCT.bit.CDC = 0;
        
        while(SciaRegs.SCIRXST.bit.RXRDY != 1)
        {
            
        }
        byteData = SciaRegs.SCIRXBUF.bit.RXDT;
        SciaRegs.SCITXBUF = byteData;
    
        return;
    }
    
    //
    // SCIA_GetWordData - This routine fetches two bytes from the SCI-A port and
    // puts them together to form a single 16-bit value.  It is assumed that the 
    // host is sending the data in the order LSB followed by MSB.
    //
    Uint16
    SCIA_GetWordData()
    {
        Uint16 wordData;
        Uint16 byteData;
    
        wordData = 0x0000;
        byteData = 0x0000;
    
        //
        // Fetch the LSB and verify back to the host
        //
        while(SciaRegs.SCIRXST.bit.RXRDY != 1)
        {
            
        }
        wordData =  (Uint16)SciaRegs.SCIRXBUF.bit.RXDT;
        SciaRegs.SCITXBUF = wordData;
    
        //
        // Fetch the MSB and verify back to the host
        //
        while(SciaRegs.SCIRXST.bit.RXRDY != 1)
        {
            
        }
        byteData =  (Uint16)SciaRegs.SCIRXBUF.bit.RXDT;
        SciaRegs.SCITXBUF = byteData;
        checksum += wordData + byteData;
    
        //
        // form the wordData from the MSB:LSB
        //
        wordData |= (byteData << 8);
    
        return wordData;
    }
    
    //
    // SCIA_GetOnlyWordData - 
    //
    Uint16
    SCIA_GetOnlyWordData()
    {
        Uint16 wordData;
        Uint16 byteData;
    
        wordData = 0x0000;
        byteData = 0x0000;
    
        //
        // Fetch the LSB and verify back to the host
        //
        while(SciaRegs.SCIRXST.bit.RXRDY != 1)
        {
            
        }
        wordData =  (Uint16)SciaRegs.SCIRXBUF.bit.RXDT;
        //SciaRegs.SCITXBUF = wordData;
    
        //
        // Fetch the MSB and verify back to the host
        //
        while(SciaRegs.SCIRXST.bit.RXRDY != 1)
        {
            
        }
        byteData =  (Uint16)SciaRegs.SCIRXBUF.bit.RXDT;
        checksum += wordData + byteData;
    
        //
        // form the wordData from the MSB:LSB
        //
        wordData |= (byteData << 8);
    
        return wordData;
    }
    
    //
    // End of File
    //
    
    
    Hi, Sal,

    We have tried with your recommended changes ,added below line .

    (SciaRegs.SCIHBAUD = 1;)

    It did not resolve the issue,

    FYI: attaching "SCI_Boot.c" file here.

    Please check and let us know if any other changes will be recommended by you.

    Awaiting for your reply.

    Regards,

    Bhanu

  • Hi,

    You will need to provide some more information since we have this working on our side.

    You can use CCS and VS to help you debug this.

    When the device is stuck you can use CCS to load the symbols of the kernel to see where the CPU is hanging or blocked. You can also do the same with Visual Stdio for the PC.

    This is likely a timing issue, and you need to resolve the dependency between both processors.

    sal
  • Hi, Sal,

    We have done this multiple times with CCS debugging, we have observed kernel is loading properly without any issue till last byte.
    It hangs when it comes to Application downloading as shown in the previously attached screenshot image.

    Did you try loading our application images (.out & .txt) files, we have shared in the earlier thread.?
    Awaiting for your results on the same.

    Regards,
    Bhanu
  • No I have not tried your application.

    Since you have used CCS to help debug, what is the device doing when the process is hanging? Where is the CPU executing? Also, what is the host doing when the process hangs?

    sal
  • Hi Jyoti,

    I have checked your SCI_Boot.c file.

    You made the following change:

    //
    // Must prime baud register with >= 1
    //
    SciaRegs.SCILBAUD = 1;
    SciaRegs.SCIHBAUD = 1; //this line is recommended by TI

    There is a small mistake in the file. TI recommended to make HBAUD = 0 not HBAUD = 1.

    Please check the post from Sal.

    As Sal mentioned please modify it as

    //
    // Must prime baud register with >= 1
    //
    SciaRegs.SCILBAUD.bit.BAUD = 1;

    SciaRegs.SCIHBAUD.bit.BAUD = 0; //ADD THIS LINE OF CODE

    With this change rebuild the kernel and regenerate the hex file for the kernel.

    Thanks,

    Katta

  • DSP2833x_Sci.h Hi Sal & Katta,

    Not working as you have suggested.

    We have tested below lines as you have mentioned with some minor change, because exact line gives compilation error as attached in the screenshot.

    Also we are using "DSP2833x_Sci.h" header file. Here I am attaching for your reference.

    //

       // Must prime baud register with >= 1

       //

       //SciaRegs.SCILBAUD = 1;

       SciaRegs.SCILBAUD = 1;

       SciaRegs.SCIHBAUD = 0;   // added this line recommended by TI

       //

       // Prepare for autobaud detection. Set the CDC bit to enable autobaud

       // detection and clear the ABD bit

       //

    Please check and provide solution.

    Thank you,

    Regards,

    Bhanu

  • 0216.Application_Image_Working.txt6153.Application_Image_Not_working.txtSerial_Data_Capture_Working_NotWorking.zipHi Sal & Katta

    In addition to  above reply we have some more observation's while downloading through USB UART serial port.

    We are debugging this issue with serial port analyzer on the host side while downloading to board, to verify the exact sequence of download steps.

    PFA        : Working & Not working files , serial data captured for your reference.

                    Also attached working & not working(.txt) files for your reference.

    Observations :

    1. Captured multiple times with Not working file.

    a. It always stops at same particular location while downloading application image. (order Sequence no: 104491)

    b. It is receiving 2 bytes of data (i.e checksum), after sending every block (mostly 4094 bytes) of application image,

    c. We do not receive checksum after last block is sent (stopped at order sequence : 104491). It is received in working file

    2. We see there are only 3 bytes of code changes in working & not working files.

    a. These changes falls in the area where last block of not working files, which we do not receive checksum.

    Why we are not receiving the checksum, what could be the reason.? (we have observed that it stops downloading after around 70% is done)

    Regards,

    Bhanu

  • Hi Bhanu,

    I tested both .txt you have sent. And both have loaded successfully.

    I am not sure what could be the issue.

    First, can you try using what is in my attached ZIP. Maybe there is some slight difference but I am not sure what it could be.

    Second, can you use the compiler or linker flag which generates sub sections of the code. I see you have very large blocks of data in your hex file. Perhaps breaking these up into smaller blocks might help. The --gen_func_subsections flag may help to break this up though I am not positive.

    Regards,

    sal

    bhanu.zip

  •  Kernel_Header.zipHi Sal,

    we have tested with your shared Kernel  file & serial_flash_programmer  and we found same observation with these files as well.

    Actually we are using TMS320F28334 MCU, I assume you are testing on different MCU..i.e 28335.

    we are requesting you to please check on the exact part we are using.

    I am attaching the Flash kernel and header file used to generate the same.

    1. Why checksum is not received from the MCU with not working file ?

    2. Why 2 bytes of change at 6 places is causing above scenario ?

    Attaching comparison screenshot images also for your reference.

    Regards,

    Bhanu

  • Bhanu,

    I do not have access to that exact part number. Besides, there is no difference between then that would cause this issue.

    Here is what I suggest since we cannot reproduce this issue.

    The SCI kernel has been enhanced over the SCI bootloader to use a checksum feature instead of an echoback feature to ensure data integrity.

    I suggest you revert and modify the SCI kernel to use the echo back communication. For every byte it receives, send it back to to the host. This simplifies the communication and provides more handshaking between the host and device.

    You also will then need to modify the host serial flash programmer to use the echo back communication. This function already exists in the project and is currently used to communicate with the boot loader. Modify the code to use the same function to communicated with the modified kernel which would use echo back.

    Please attempt this change to get your solution working. Obviously yo have the echo back communication working with the bootloader. Replicate this with the kernel. We provide the source code to the host and device programs so that you can modify it and debug it if you need to.

    If you have specific questions about how to do this, please feel free to ask.

    Hope this helps,
    sal