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.

different results when running code from release and flash

Genius 5910 points
Other Parts Discussed in Thread: CONTROLSUITE

My program is to big to run from memory. So in both release and flash my code is runs form flash (and copied to memory in the code). Only my code works if I run it in release and doesn't in flash. I think it is a timing issue. because I noted that my code runs slower in Flash.

So any suggestions what can be the cause? Interrupt handling??   And how to debug this issue.

I"m using the 28069M with CCS 6.1.1. and  compiler 6.4.11

Thanks!

  • Hi EVS,

    Did you refer to this example for the flash configuration: C:\ti\controlSUITE\device_support\f2806x\v151\F2806x_examples_ccsv5\flash_f28069
    I doubt the linker section.

    Regards,
    Gautam
  • Gautam Iyer said:
    Hi EVS,

    Did you refer to this example for the flash configuration: C:\ti\controlSUITE\device_support\f2806x\v151\F2806x_examples_ccsv5\flash_f28069
    I doubt the linker section.

    Regards,
    Gautam

    Thanks for the reply.

    Yes I looked at that. It isn't that complicated. And maybe there a linker difference between release and Flash but in CCS it is really user unfriendly to compare both properties. I always wonder if I'm the only one who hate eclipse because they really tried to make everything over complicated. 

  • evs said:
    Yes I looked at that. It isn't that complicated. And maybe there a linker difference between release and Flash but in CCS it is really user unfriendly to compare both properties.

    Try to replicate the linker settings from example code and let us know what you observe.

    evs said:
    I always wonder if I'm the only one who hate eclipse because they really tried to make everything over complicated. 

    Hehe :) It does feel sometimes!

  • Linker output Flash:
    'Building target: Servo_controllerV3.out'
    'Invoking: C2000 Linker'
    "C:/ti/ccsv6/tools/compiler/c2000_6.4.11/bin/cl2000" -v28 -mt -ml --tmu_support=tmu0 --float_support=fpu32 --cla_support=cla0 --vcu_support=vcu0 -O2 --opt_for_speed=2 --fp_reassoc=off --fp_mode=strict --advice:performance=all -g --define=FAST_ROM_V1p6 --define=FLASH --define=QEP --display_error_number --diag_warning=225 --diag_suppress=2615 -k --src_interlist -z -m"Servo_controllerV3.map" --stack_size=0x2000 --heap_size=0x2000 --warn_sections -i"C:/ti/ccsv6/tools/compiler/c2000_6.4.11/lib" -i"C:/ti/ccsv6/tools/compiler/c2000_6.4.11/include" --priority --reread_libs --disable_auto_rts --define="MATH_TYPE" --diag_suppress=16002 --xml_link_info="Servo_controllerV3_linkInfo.xml" --rom_model -o "Servo_controllerV3.out" "C:/ti/controlSUITE/libs/math/CLAmath/v4_00_01_00/lib/cla0_math_library_fpu32.lib" -l"rts2800_fpu32.lib" "I:/workspace/sw/modules/iqmath/lib/f28x/float/IQmath_fpu32.lib" "I:/workspace/sw/modules/fast/lib/32b/f28x/f2806x/2806xRevB_IQmath_BootROMSymbols_fpu32.lib" "I:/workspace/sw/modules/fast/lib/32b/f28x/f2806x/2806xRevB_FastSpinROMSymbols_fpu32.lib" "I:/workspace/sw/modules/spintac/lib/32b/SpinTAC_fpu32.lib" "./CodeStartBranch.obj" "./Servocontroller.obj" "./Servodriver.obj" "./Intraspin/clarke.obj" "./Intraspin/cpu_usage.obj" "./Intraspin/enc.obj" "./Intraspin/filter_fo.obj" "./Intraspin/filter_so.obj" "./Intraspin/ipark.obj" "./Intraspin/memCopy.obj" "./Intraspin/offset.obj" "./Intraspin/park.obj" "./Intraspin/pi.obj" "./Intraspin/pid.obj" "./Intraspin/slip.obj" "./Intraspin/svgen.obj" "./Intraspin/traj.obj" "./Intraspin/usDelay.obj" "./Driver/adc.obj" "./Driver/clk.obj" "./Driver/cpu.obj" "./Driver/flash.obj" "./Driver/gpio.obj" "./Driver/osc.obj" "./Driver/pie.obj" "./Driver/pll.obj" "./Driver/pwm.obj" "./Driver/pwr.obj" "./Driver/qep.obj" "./Driver/sci.obj" "./Driver/spi.obj" "./Driver/timer.obj" "./Driver/wdog.obj" "./Core/CLA_Tasklist.obj" "./Core/CLA_interface.obj" "./Core/CMD_LINE.obj" "./Core/CO_CIA402.obj" "./Core/CO_homingmode.obj" "./Core/Can_driver.obj" "./Core/Datalogger.obj" "./Core/F2806x_usDelay.obj" "./Core/Motionprofile.obj" "./Core/SCI_driver.obj" "./Core/Spi_Eeprom.obj" "./Core/UI_cmd.obj" "./Core/ctrlQEP.obj" "./Core/hal.obj" "./Core/user.obj" "./CAN/CANopen.obj" "./CAN/CO_Emergency.obj" "./CAN/CO_HBconsumer.obj" "./CAN/CO_NMT_Heartbeat.obj" "./CAN/CO_OD.obj" "./CAN/CO_PDO.obj" "./CAN/CO_SDO.obj" "./CAN/CO_SDOmaster.obj" "./CAN/CO_SYNC.obj" "./CAN/CO_driver.obj" "./CAN/CO_eeprom.obj" "./CAN/crc16-ccitt.obj" "C:/ti/ccsv6/tools/compiler/c2000_6.2.10/lib/rts2800_fpu32.lib" "../Core/F28069M1.cmd" -l"C:\ti\controlSUITE\libs\math\CLAmath\v4_00_01_00\lib\cla0_math_library_fpu32.lib"
    <Linking>

    Linker output Release:
    'Building target: Servo_controllerV3.out'
    'Invoking: C2000 Linker'
    "C:/ti/ccsv6/tools/compiler/c2000_6.4.11/bin/cl2000" -v28 -mt -ml --tmu_support=tmu0 --float_support=fpu32 --cla_support=cla0 --vcu_support=vcu0 -O2 --opt_for_speed=2 --fp_reassoc=off --fp_mode=strict --advice:performance=all -g --define=FAST_ROM_V1p6 --define=FLASH --define=QEP --display_error_number --diag_warning=225 --diag_suppress=2615 -k --src_interlist -z -m"Servo_controllerV3.map" --stack_size=0x2000 --heap_size=0x2000 --warn_sections -i"C:/ti/ccsv6/tools/compiler/c2000_6.4.11/lib" -i"C:/ti/ccsv6/tools/compiler/c2000_6.4.11/include" --priority --reread_libs --disable_auto_rts --define="MATH_TYPE" --diag_suppress=16002 --xml_link_info="Servo_controllerV3_linkInfo.xml" --rom_model -o "Servo_controllerV3.out" "C:/ti/controlSUITE/libs/math/CLAmath/v4_00_01_00/lib/cla0_math_library_fpu32.lib" -l"rts2800_fpu32.lib" "I:/workspace/sw/modules/iqmath/lib/f28x/float/IQmath_fpu32.lib" "I:/workspace/sw/modules/fast/lib/32b/f28x/f2806x/2806xRevB_IQmath_BootROMSymbols_fpu32.lib" "I:/workspace/sw/modules/fast/lib/32b/f28x/f2806x/2806xRevB_FastSpinROMSymbols_fpu32.lib" "I:/workspace/sw/modules/spintac/lib/32b/SpinTAC_fpu32.lib" "./CodeStartBranch.obj" "./Servocontroller.obj" "./Servodriver.obj" "./Intraspin/clarke.obj" "./Intraspin/cpu_usage.obj" "./Intraspin/enc.obj" "./Intraspin/filter_fo.obj" "./Intraspin/filter_so.obj" "./Intraspin/ipark.obj" "./Intraspin/memCopy.obj" "./Intraspin/offset.obj" "./Intraspin/park.obj" "./Intraspin/pi.obj" "./Intraspin/pid.obj" "./Intraspin/slip.obj" "./Intraspin/svgen.obj" "./Intraspin/traj.obj" "./Intraspin/usDelay.obj" "./Driver/adc.obj" "./Driver/clk.obj" "./Driver/cpu.obj" "./Driver/flash.obj" "./Driver/gpio.obj" "./Driver/osc.obj" "./Driver/pie.obj" "./Driver/pll.obj" "./Driver/pwm.obj" "./Driver/pwr.obj" "./Driver/qep.obj" "./Driver/sci.obj" "./Driver/spi.obj" "./Driver/timer.obj" "./Driver/wdog.obj" "./Core/CLA_Tasklist.obj" "./Core/CLA_interface.obj" "./Core/CMD_LINE.obj" "./Core/CO_CIA402.obj" "./Core/CO_homingmode.obj" "./Core/Can_driver.obj" "./Core/Datalogger.obj" "./Core/F2806x_usDelay.obj" "./Core/Motionprofile.obj" "./Core/SCI_driver.obj" "./Core/Spi_Eeprom.obj" "./Core/UI_cmd.obj" "./Core/ctrlQEP.obj" "./Core/hal.obj" "./Core/user.obj" "./CAN/CANopen.obj" "./CAN/CO_Emergency.obj" "./CAN/CO_HBconsumer.obj" "./CAN/CO_NMT_Heartbeat.obj" "./CAN/CO_OD.obj" "./CAN/CO_PDO.obj" "./CAN/CO_SDO.obj" "./CAN/CO_SDOmaster.obj" "./CAN/CO_SYNC.obj" "./CAN/CO_driver.obj" "./CAN/CO_eeprom.obj" "./CAN/crc16-ccitt.obj" "C:/ti/ccsv6/tools/compiler/c2000_6.2.10/lib/rts2800_fpu32.lib" "../Core/F28069M1.cmd" -l"C:\ti\controlSUITE\libs\math\CLAmath\v4_00_01_00\lib\cla0_math_library_fpu32.lib"


    I didn't find any difference:
    I also checked the compiler difference and changed the link order. and you have to manual change it first before it is included in the compiler --opt_for_speed=2 and I think that solved it.



    Now my program works fine in flash when I upload it and start it from CCS. But doesn't work correctly when the debugger is removed. How strange. But first I have to rule out that it isn't a hardware issue somehow.
  • evs said:
    Now my program works fine in flash when I upload it and start it from CCS. But doesn't work correctly when the debugger is removed.

    Are you sure the code is getting loaded to flash? Can you see the long erase operation?

    evs said:
    But first I have to rule out that it isn't a hardware issue somehow.

    Yup yup... do check that too.

  • Yes the code runs but the code doesn't work correctly. At this point I got different results when I run standalone in flash or with the debugger connected.
  • That's strange. Also, have you set the heap and the stack size to 0x2000?
  • I don't think that it is a hardware issue. Maybe a Spintac library issue.

    If I run my flash program with the CCS and the programmer attached. The program works fine.
    If power cycle and I remove the programmer the program runs ,I have I/O but my servo motor won't work.
    How strange and nearly impossible to debug?
    So when the debugger environment is loaded what is copied to RAM in the 28069?
  • evs,

    You could try debugging something like this:

    • power cycle
    • connect the debugger
    • load symbols only - this will not load the program, but only symbols so now you can debug

    In this case you may be able to see what is going wrong.


    Another thing to check is the .map file.  Make sure no initialized sections are in RAM.

    -Lori

  • Hi Evs,

    Has the problem been resolved? Can I close the post?

    Lori
  • I asked the question again at TI C/C++ Compiler Resources in the hope to get some more sophisticated answer than: power cycle or connected the debugger.

     

  • Moderator note:

    Thread was resolved in the compiler forum - please refer to this thread:
    e2e.ti.com/.../535988

    Closing.