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.

Compiler: how to change app_c7x_kernel demo code

Tool/software: TI C/C++ Compiler

Hi   :

     i  am    using  J7  evm    psdk_rtos_auto_j7_06_01_00_15

    i  have   build   and  run   (psdk_rtos_auto_j7_06_01_00_15\vision_apps\apps\basic_demos\app_c7x_kernel  )  demo 

   i    change  VXLIB_add_i8u_i8u_o8u_cn  code    like  follow    i  think   the  output  img   should  change    same to  img_2.bmp.

 but   it    also  the  same ,    how  to  make  my  change   Take effect

thanks 

shuai

  • Did you change the file: vision_apps/apps/basic_demos/app_c7x_kernel/VXLIB_add_i8u_i8u_o8u_cn.cpp?

    If so, then all you should need to do is a "make sdk" at the top level, and the change should be pulled in.  Is that what you did?

    Jesse

  • Sometimes when you do make, it is easy to miss the build errors.  You may need to scroll up in the log to see if there are any build errors due to your change.  If so, then the change doesn't take effect until the build errors are fixed.

    If you still can't solve the problem, try making a small whitespace change, and copy the build log to a file to see that this file was properly recompiled.

    Jesse

  • Hi  :Jesse

          if    i    change     app_c7x_kernel/VXLIB_add_i8u_i8u_o8u_cn.cpp     i    have   to     make   sdk      make   vision_apps    then   copy   vx_app_c7x_kernel.out    to    SD   cover  old  one  ?       anyothers   to  do ?

    thanks

    shuai

  • Hi  :Jesse

          in   this   app     i     change    main.c    ,i   test    app_run_graph   usetime   like   follow  ,   this  change   is  effect,      but   change  of   app_c7x_kernel/VXLIB_add_i8u_i8u_o8u_cn.cpp      dose  not   effect.     i    make   sdk      make   vision_apps    then   copy   vx_app_c7x_kernel.out    to    SD   cover  old  one .

    #ifdef test_time
        gettimeofday(&first_time, NULL);
    #endif

        app_run_graph(obj);

    #ifdef test_time
        gettimeofday(&second_time, NULL);
        time_val = (second_time.tv_sec - first_time.tv_sec) * 1000000 + second_time.tv_usec - first_time.tv_usec;
        printf("time_EMOTION(ms) = %lf\n", time_val / 1000.0);
    #endif    

  • I understand now.  After building the updates, you have only replaced the A72 side executable.  However, the change you have made is on the C7x DSP, so what you have missed is updating the C7x dsp image file in the filesystem which gets loaded to the DSP upon boot.  You can use (or refer) to the following command (when the SD card is mounted on the PC) to load all of the linux A72 side programs AND all of the remote core images (R5F, C66, C7x, etc) to the file system:

    From vision_apps directory:

    "make linux_fs_install_sd" (This loads the release versions of all the files)

    make linux_fs_install_sd PROFILE=debug (This loads the debug versions of all the files in case you want to use gcc (linux) or CCS to debug the programs)

  • Hi  :    Jesse

           Please tell me which files need to be copied. I want to copy them manually,

         thanks

    Shuai

  • You can refer to the "linux_fs_install_sd" rule inside of vision_apps/makerules/makefile_linux_arm.mak for all that this command is doing.

    Specifically, the remote core firmware is updated using this line: cp $(LINUX_FS_PATH)/lib/firmware/j7-*-fw $(LINUX_SD_FS_ROOT_PATH)/lib/firmware/

    LINUX_FS_PATH is pointing to the workarea/targetfs folder, so workarea/targetfs/lib/firmware/j7-c71_0-fw is the file that needs to be copied to the lib/firmware path on the SD card for C7x firmware.  All the other images in this firmware directory also may need to be compiled if they are updated as part of your code changes.

    Jesse

  • Hi : Jesse

           i   try    the  same    in   PC emulation MODE  , output  img  is  change   so  i  think  the  change of   code  is  effect.

          in    target  mode   i    delete   ( workarea/targetfs/lib/firmware/j7-c71_0-fw)   the  progranm  also  run  the  same result , 

    thanks

    Shuai

  • shuai wang32 said:
    i   try    the  same    in   PC emulation MODE  , output  img  is  change   so  i  think  the  change of   code  is  effect.

    For PC mode, ALL the code changes take effect in a single binary file which is compiled for X86 PC compiler/linker.  This is why you see the effect from this output file.

    In Target mode, different binaries are compiled which go on different core architectures (A72 program, C7x binary, R5F binary, etc).  When you updated the A72 file, it didn't take effect since your code changes were actually on C7x core of target.

    shuai wang32 said:
       in    target  mode   i    delete   ( workarea/targetfs/lib/firmware/j7-c71_0-fw)   the  progranm  also  run  the  same result , 

    Can you please elaborate?  Are you saying that you deleted ( workarea/targetfs/lib/firmware/j7-c71_0-fw), and recompiled using "make sdk", and copied the firmware workarea/targetfs/lib/firmware/j7-c71_0-fw to the sdcard: /lib/firmware/j7-c71_0-fw, and it STILL doesn't take effect?  Or it does work now (not sure what "same result means", same as PC (working as expected), or same as before which is not working).

    Here is the breakdown of the commands I do when I am changing code:

    1. Change code

    2. Recompile using following command in vision_apps folder: "make sdk"

    3. Check that there are no compiler/linker issues.

    4. With SDCARD mounted on PC, run command from vision_apps folder: "make linux_fs_install_sd"

    5. Unmount SDCARD, load in board, and boot and run program.

    I recommend running this sequence.  If it works, then later you can manually do step 4 to copy files over if you don't want to use this command.

    Please let me know if this works.

    Regards,

    Jesse

  • Hi  :   Jesse

             i     find     delete    some   file   in  sd    card    then    i   connect   sd   card   to   virtual machine   again     that   file      still exist  .

       copy file delete file and other operations for SD card  is     Invalid

    thanks

    Shuai

  • It sounds to me that you may have a defective SD card.  Perhaps reformat, or try a different SD card.

    Regards,

    Jesse