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.

DELAY_US() function use problem

Other Parts Discussed in Thread: TMS320F28027, DRV8301

Hi,

Anybody know why the program always run into the ISR_ILLEGAL() function once I use DELAY_US() function in debugging.  thanks very much!

my compiler version: C2000 v6.2.0

target chip: tms320f28027

the project is build no has not any issue and warning

below is the build information:

**** Build of configuration Debug for project Test_drv8301 ****

"D:\\ti\\ccsv5\\utils\\bin\\gmake" -k all
'Building file: ../DRV8301_SPI.c'
'Invoking: C2000 Compiler'
"D:/ti/ccsv5/tools/compiler/c2000_6.2.0/bin/cl2000" -v28 -ml -mt --include_path="D:/ti/ccsv5/tools/compiler/c2000_6.2.0/include" --include_path="E:/software workspace/motor control/Test_drv8301/Device_headers/f2802x_common" --include_path="E:/software workspace/motor control/Test_drv8301/Device_headers/f2802x_headers" --include_path="E:/software workspace/motor control/Test_drv8301/Device_headers/f2802x_Peripheral" -g --gcc --diag_warning=225 --display_error_number --diag_wrap=off --preproc_with_compile --preproc_dependency="DRV8301_SPI.pp"  "../DRV8301_SPI.c"
'Finished building: ../DRV8301_SPI.c'
' '
'Building file: ../Device_Init.c'
'Invoking: C2000 Compiler'
"D:/ti/ccsv5/tools/compiler/c2000_6.2.0/bin/cl2000" -v28 -ml -mt --include_path="D:/ti/ccsv5/tools/compiler/c2000_6.2.0/include" --include_path="E:/software workspace/motor control/Test_drv8301/Device_headers/f2802x_common" --include_path="E:/software workspace/motor control/Test_drv8301/Device_headers/f2802x_headers" --include_path="E:/software workspace/motor control/Test_drv8301/Device_headers/f2802x_Peripheral" -g --gcc --diag_warning=225 --display_error_number --diag_wrap=off --preproc_with_compile --preproc_dependency="Device_Init.pp"  "../Device_Init.c"
'Finished building: ../Device_Init.c'
' '
'Building file: ../F2802x_CodeStartBranch.asm'
'Invoking: C2000 Compiler'
"D:/ti/ccsv5/tools/compiler/c2000_6.2.0/bin/cl2000" -v28 -ml -mt --include_path="D:/ti/ccsv5/tools/compiler/c2000_6.2.0/include" --include_path="E:/software workspace/motor control/Test_drv8301/Device_headers/f2802x_common" --include_path="E:/software workspace/motor control/Test_drv8301/Device_headers/f2802x_headers" --include_path="E:/software workspace/motor control/Test_drv8301/Device_headers/f2802x_Peripheral" -g --gcc --diag_warning=225 --display_error_number --diag_wrap=off --preproc_with_compile --preproc_dependency="F2802x_CodeStartBranch.pp"  "../F2802x_CodeStartBranch.asm"
'Finished building: ../F2802x_CodeStartBranch.asm'
' '
'Building file: ../F2802x_GlobalVariableDefs.c'
'Invoking: C2000 Compiler'
"D:/ti/ccsv5/tools/compiler/c2000_6.2.0/bin/cl2000" -v28 -ml -mt --include_path="D:/ti/ccsv5/tools/compiler/c2000_6.2.0/include" --include_path="E:/software workspace/motor control/Test_drv8301/Device_headers/f2802x_common" --include_path="E:/software workspace/motor control/Test_drv8301/Device_headers/f2802x_headers" --include_path="E:/software workspace/motor control/Test_drv8301/Device_headers/f2802x_Peripheral" -g --gcc --diag_warning=225 --display_error_number --diag_wrap=off --preproc_with_compile --preproc_dependency="F2802x_GlobalVariableDefs.pp"  "../F2802x_GlobalVariableDefs.c"
'Finished building: ../F2802x_GlobalVariableDefs.c'
' '
'Building file: ../F2802x_usDelay.asm'
'Invoking: C2000 Compiler'
"D:/ti/ccsv5/tools/compiler/c2000_6.2.0/bin/cl2000" -v28 -ml -mt --include_path="D:/ti/ccsv5/tools/compiler/c2000_6.2.0/include" --include_path="E:/software workspace/motor control/Test_drv8301/Device_headers/f2802x_common" --include_path="E:/software workspace/motor control/Test_drv8301/Device_headers/f2802x_headers" --include_path="E:/software workspace/motor control/Test_drv8301/Device_headers/f2802x_Peripheral" -g --gcc --diag_warning=225 --display_error_number --diag_wrap=off --preproc_with_compile --preproc_dependency="F2802x_usDelay.pp"  "../F2802x_usDelay.asm"
'Finished building: ../F2802x_usDelay.asm'
' '
'Building file: ../main.c'
'Invoking: C2000 Compiler'
"D:/ti/ccsv5/tools/compiler/c2000_6.2.0/bin/cl2000" -v28 -ml -mt --include_path="D:/ti/ccsv5/tools/compiler/c2000_6.2.0/include" --include_path="E:/software workspace/motor control/Test_drv8301/Device_headers/f2802x_common" --include_path="E:/software workspace/motor control/Test_drv8301/Device_headers/f2802x_headers" --include_path="E:/software workspace/motor control/Test_drv8301/Device_headers/f2802x_Peripheral" -g --gcc --diag_warning=225 --display_error_number --diag_wrap=off --preproc_with_compile --preproc_dependency="main.pp"  "../main.c"
'Finished building: ../main.c'
' '
'Building target: Test_drv8301.out'
'Invoking: C2000 Linker'
"D:/ti/ccsv5/tools/compiler/c2000_6.2.0/bin/cl2000" -v28 -ml -mt -g --gcc --diag_warning=225 --display_error_number --diag_wrap=off -z -m"Test_drv8301.map" --stack_size=0x300 --warn_sections -i"D:/ti/ccsv5/tools/compiler/c2000_6.2.0/lib" -i"D:/ti/ccsv5/tools/compiler/c2000_6.2.0/include" --reread_libs --display_error_number --diag_wrap=off --xml_link_info="Test_drv8301_linkInfo.xml" --rom_model -o "Test_drv8301.out"  "./main.obj" "./F2802x_usDelay.obj" "./F2802x_GlobalVariableDefs.obj" "./F2802x_CodeStartBranch.obj" "./Device_Init.obj" "./DRV8301_SPI.obj" "../cmd/F28027.cmd" "../cmd/F2802x_Headers_nonBIOS.cmd" -l"libc.a"
<Linking>
'Finished building target: Test_drv8301.out'
' '

**** Build Finished ****

  • Hi XB,

    Anybody know why the program always run into the ISR_ILLEGAL() function once I use DELAY_US() function in debugging

    This should not happen. Also, did you check multiple times after excluding the delay function for the ISR_ILLEGAL() display?

    Regards,

    Gautam