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.

CC1312R: Stepping into Simplelink driver files with SDK 6.20 / TI Clang

Part Number: CC1312R

Hi,

what are steps necessary to step into driver code (say, GPIO_init() ) with SDK 6.20 and TI Clang compiler?

Using the empty project:

  • No optimization for compiler
  • I've defined, among others, DRIVERLIB_NOROM globally, just in case.
  • I also tried to add the symbols for driverlib, also just in case driverlib is being used (which I don't think it is?)

Trying to step into GPIO_init(), CCS is unable to find the C file, as shown here:

 Debugger stopped at function:

Trying to step into, breakpoint set in assembly, showing file not found:

Showing includes for project:

  • Hi Martin,

    To debug drivers code, you would need to add the source file(s) you want to debug to your project.

    Regards,
    Nikolaj 

  • Hi Nikolaj,

    in a way that is different from adding SDK paths to compiler includes? As shown in the third image above, the SDK driver files are part of the search path of the project (not sure how would it compile otherwise anyway?).

    I got to this state by simply importing one of the SDK example projects, and never encountered this issue in previous SDKs/ccs compiler.

  • Hi Martin,

    The includes shown in your third image are just the include paths used, i.e. files that can be included using the #include directive. It does not mean that all the files will be compiled.

    The default examples will use the prebuilt driver library and won't build the drivers from source. It is not possible to debug the source code when using this library. If you want to debug the source code, you need to compile and link the specific source file that you want to debug. By adding the source file (.c) to the project, CCS will automatically compile and link this file.

    To add the file to the project you can drag the file from Windows File Explorer into the project in CCS. It will ask if you want to link or copy the file (both will work)

    Regards,
    Nikolaj

  • Coming back to this, I have a library file which my project links with. If I compile the library with TI Clang, there is no way to step through source files. Linking with a CCS compiler lib allows stepping into the source for the lib from the project.

    Are there settings I need to change?

  • do not think this is a CC1312 specific question, so trying to get someone from TI Clang knowledge to answer

  • Coming back to this, I have a library file which my project links with. If I compile the library with TI Clang, there is no way to step through source files. Linking with a CCS compiler lib allows stepping into the source for the lib from the project.

    What CCS version are you using? There were known issues with TI Clang compiled output on older CCS versions. If you are using an older version (before CCS 12.x) then please update your CCS version.

    Thanks

    ki

  • I just upgraded from 11 to 12 to verify this. Recompiled both library and project, same result. "No code is associated with any loaded symbols".

  • I was able to reproduce the same issue with you using CCS 12.1 and SDK 6.20 empty example.

    GPIO_init() is coming from the drivers_cc26x2.a library. The ticlang compiled one does not contain any source debug information. The gcc compiled one does. This explains why I was not able to step in GPIO_init() when the ticlang compiled library was used. Likely this library was not built with the proper compielr options to generate the full debug symbols. This appears to be a known oversight since the ticlang compiled library from SDK 6.30 *does* contain the source debug symbols and I can step into GPIO_init() there. Please try using SDK 6.30 and see if the issue is resolved.

    Thanks

    ki

  • The answer I accepted initially is wrong after all. There should have been no need to compile library files locally. SDK 6.20, as pointed out below, does not have debug symbols in precompiled library files, which is addressed in 6.30

  • Thanks Ki, I can see that 6.30 is working, thank you! For other posters happening on this thread, locally compiled libraries should make sure to emit DWARF debug information (https://software-dl.ti.com/codegen/docs/tiarmclang/compiler_tools_user_guide/migration_guide/mapping_armcl_options_to_tiarmclang/controlling_dwarf_debug_info.html):