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.

TDA4VM: In the CCS debugging environment, what is the specific operational procedure for opening a bin file on the development board using the fopen function?

Part Number: TDA4VM

Tool/software:

In the CCS debugging environment, what is the specific operational procedure for using the fopen function to open a bin file on the development board? Currently, it is known that using fopen to open /mnt/data.bin actually accesses the file on the computer side. If the goal is to open the data.bin file located in the /mnt directory on the development board(TDA4VM), how should this be done?

  • Hi,

    In the CCS debugging environment, what is the specific operational procedure for using the fopen function to open a bin file on the development board? Currently, it is known that using fopen to open /mnt/data.bin actually accesses the file on the computer side. If the goal is to open the data.bin file located in the /mnt directory on the development board(TDA4VM), how should this be done?

    You need to connect to the required core and load the binary image built for that core.
    Kindly refer to the RTOS SDK documentation on how to set up and load images through CCS.
    https://software-dl.ti.com/jacinto7/esd/processor-sdk-rtos-jacinto7/11_00_00_06/exports/docs/psdk_rtos/docs/user_guide/ccs_setup_j721e.html#step-3-load-rtos-baremetal-application-binaries-thru-ccs

    Best Regards,
    Sudheer

  • I followed the above user guide to load the files. I need to write code on the DSP core, so the binary image loaded is ti-processor-sdk-rtos-j721e-evm-11_00_00_06/vision_apps/out/J721E/C66/FREERTOS/debug/vx_app_rtos_linux_c6x_1.out.

  • Hi,

    I need to write code on the DSP core, so the binary image loaded is ti-processor-sdk-rtos-j721e-evm-11_00_00_06/vision_apps/out/J721E/C66/FREERTOS/debug/vx_app_rtos_linux_c6x_1.out.

    You need to integrate your DSP core applicaiton into VisionApp.
    The applicaiton loaded on C66x_1 from vision apps will be "vision_apps/platform/j721e/rtos/c66x_1/main.c"

    Post integrating your applicaiton, build vision apps and load images by following the vision apps user guide.
    https://software-dl.ti.com/jacinto7/esd/processor-sdk-rtos-jacinto7/latest/exports/docs/vision_apps/docs/user_guide/BUILD_AND_RUN.html

    If you need any support related to DSP applications, please create a new thread. A query related to how to load files using the debugger is addressed, and you were able to load images.

    Best Regards,
    Sudheer

  • Yes, I am performing file opening operations in vision_apps/platform/j721e/rtos/c66x_1/main.c. The current issue is: when running the program via CCS in noboot mode, the DSP core can normally open files on the PC side and read their contents; however, when running in SD boot mode, it fails to properly open and read files on the j721e-evm.

  • Hi,

    Yes, I am performing file opening operations in vision_apps/platform/j721e/rtos/c66x_1/main.c. The current issue is: when running the program via CCS in noboot mode, the DSP core can normally open files on the PC side and read their contents; however, when running in SD boot mode, it fails to properly open and read files on the j721e-evm.

    In case of SD Boot mode, you need to soft link the image to C6x_1 core. It will be by default when you run sdk install to the SD script.
    Note that, by default stip image will be mapped to C7x_1 core and which is loaded on the core while booting.
    The strip image will not have symbols, even while connecting the core to the debugger use a non-strip image as loading symbols (instead of load program as in noboot mode)
    software-dl.ti.com/.../ccs_setup_j721e.html

    Best Reagards,
    Sudheer

  • In case of SD Boot mode, you need to soft link the image to C6x_1 core. It will be by default when you run sdk install to the SD script.

    I executed the make linux_fs_install_sd command in the sdk_builder directory after updating my modified code.

    Note that, by default stip image will be mapped to C7x_1 core and which is loaded on the core while booting.

    How should I understand this sentence? Currently I'm booting in SD mode, will this affect my ability to open files using the ”fopen “API?

  • HI, 

    How should I understand this sentence? Currently I'm booting in SD mode, will this affect my ability to open files using the ”fopen “API?

    In case of SD boot mode or any other boot mode other than NO boot mode. 

    Some binary loaded to the cores and starts running in the core.

    You can find he binary mapped to core by connecting sd card to pc and run below command. 

    #ls -l /media/xxxx/root/lib/firmware/

    Above will list the content inside firmware repo. Where you can find binaries mapped to SOC core. 

    https://software-dl.ti.com/jacinto7/esd/processor-sdk-rtos-jacinto7/11_00_00_06/exports/docs/psdk_rtos/docs/user_guide/ccs_setup_j721e.html#debugging-with-hlos-running-on-a72-linux-qnx

    Please refer to the link shared earlier how to connect debugger when running in non no-boot mode.

    If you would like to debug your code, you need to make sure code should not run and wait at certain loop condition. Once you connected for debugger and load symbols you can found that code waiting at desired loop and then you can start  failing condition and move forward to debug the code. 

    Please refer to wait for debugger kind of code from TI SDK, where we are setting some gloabal variable and making code to reach and wait forever untill co necting debugger and updating variable to make loop breaks. 

    Best Regards, 

    Sudheer

  • HI sudheer

    Yes,I was currently loading the program via SD card, but it fails to properly open and read files on the j721e-evm via C66_1 core binary.

    My question is whether the DSP core cannot operate on files, or if file-system operations need to be performed before opening the file.

  • Hi,

    My question is whether the DSP core cannot operate on files, or if file-system operations need to be performed before opening the file

    What do you mean by file system operations.

    Do you mean loading binary for debugging? In case of CCS boot mode i.e. no-boot mode, binaries loaded on the cores via load program and continue debug.

    In case of non CCS boot mode like SD or any other boot modes program loaded by boot loaders/applications to cores. To debug these files vis CCS we need to follow steps.
    1) Connect the required core from CCS debugger.
    2) Load symbols not program as program already loaded by bootloaders/applications.
    3) Start debugging post loading symbols.

    Note: We can't read the file info was programmed into core just by connecting to the cores using CCS debugger. We must load symbols in order to know the program execution while debugging.

    If above is not clarifying what you are looking for, please share more details about your request and expectation with respect to No boot mode and SD boot mode.

    Best Regards,
    Sudheer

  • Hi sudheer

    My modified code is located at ti-processor-sdk-rtos-j721e-evm-11_00_00_06/vision_apps/platform/j721e/rtos/c66x_1/main.c. The detailed modification requirements are: open the adcdata.bin file, read the raw data from it into a specified memory address, and then process the data. The current issue is that when i  using the fopen() function to open the file, the raw data in the file cannot be correctly retrieved. My boot method is SD card boot, and I do not need to debug in CCS mode; I can add logs with SD card mode boot for debugging.

  • Hi,

    Yes,I was currently loading the program via SD card, but it fails to properly open and read files on the j721e-evm via C66_1 core binary.

    Which error are you encountering?

    My question is whether the DSP core cannot operate on files, or if file-system operations need to be performed before opening the file.

    If possible, I would recommend moving the file operations outside the DSP.

    Can you please share the code that you are using for reading the file. 

    I suggest looking into the Vision Apps example, specifically:

    vision_apps\apps\basic_demos\app_c7x_kernel. 
    This example demonstrates the structure for reading and writing files (e.g., image files), which may help clarify how to handle file operations in your use case.

    Regards,

    Sivadeep