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.

CCS/LAUNCHXL-CC3235SF: Issue flashing CC3235SF under Linux

Part Number: LAUNCHXL-CC3235SF
Other Parts Discussed in Thread: CC3235SF, CC3220SF, UNIFLASH, CC3235S

Tool/software: Code Composer Studio

Imported the i2ctmp116 Project for the CC3235SF/tirtos/ccs everything compiled fine, went to debug it and got this message:

Cortex_M4_0: Error initializing flash programming: Failed to load /home/adam/ti/ccsv8/ccs_base/DebugServer/bin/libFlashCC3235SF.so: /home/adam/ti/ccsv8/ccs_base/DebugServer/bin/libFlashCC3235SF.so: invalid ELF header

So I uninstalled an reinstalled CCS, this time grabbing 8.3.0.0 from the usual place but I got the same error.  So I opened up a terminal and ran readelf -a -W [Name of file] and it outputs:

readelf: Error: Not an ELF file - it has the wrong magic bytes at the start

libFlashCC3220SF.so does not have the same problem.  The platform is Debian Stable AMD64.

Please advise.  Very interested in getting this processor off the ground.

  • Hi Adam,

    Adam Parker said:
    Imported the i2ctmp116 Project for the CC3235SF/tirtos/ccs everything compiled fine, went to debug it

    Are you using the stock example "as-is" (unmodified)? That example should load to SRAM, not flash. How did you launch the debugger? Did you try to debug it via the "Debug As" button? 

    Thanks

    ki

  • My wording might be off because I'm more used to other microcontrollers where you "flash" a program to debug it. I mean to say debug.

    I import the project as-is. I press build and then I press debug (just click the little button, no menus). I get the errors mentioned in the first post.

    I just fired up a Windows VM using CCS 8.3.0. This procedure with the same board works in Windows. I am able to debug the application and inspect variables.

    Furthermore to the credit of the log output I quoted in the first post the magic bytes on the .so are not ELF magic bytes but instead "CA FE BA BE" which seems to indicate that it's a Java class file.
  • Adam Parker said:
    I just fired up a Windows VM using CCS 8.3.0. This procedure with the same board works in Windows. I am able to debug the application and inspect variables.

    That is odd. I tried that same example "as-is" using CCS 8.3.0 on Debian 9.8. It loaded fine. Do you get the same error for any example you try? 

    Thanks

    ki

  • Do you happen to have an internal build or something?

    I'm downloading the latest CCS from here: processors.wiki.ti.com/.../Download_CCS
    I'm telling you. The .so that is shipped to Linux machines for flashing CC3235SF is not correct. It's not even an ELF executable.

    Just for giggles I fired up a Linux VM, did a new install of debian 9 and then downloaded CCS 8.3.0. I did the exact same procedure I did on my real machine. Same problem. Opened a hex editor on libFlashCC3235SF.so, same problem, the .so file doesn't have an elf header. For even more fun I opened a hex editor on libFlashCC3230SF.so and it's not a valid .so either.

    For science I then backed up my libFlashCC3235SF.so and copied the libFlashCC3220SF.so (which does have a valid ELF header) to be libFlashCC3235SF.so. Guess what? It works. It debugs the exact same project I've been working on this whole time. But who knows what's different about the intended .so for CC3235SF and the .so for CC3220SF so while that's a temporary band-aid it needs to get fixed.
  • Adam Parker said:
    Do you happen to have an internal build or something?

    No, I am using the same latest release of CCS 8.3.

    There are 2 questions here. The first is why you are getting the error about the CC3235 Flash lib in the first place. I am unable to reproduce the issue on Debian 9.

    The second is your questions about the libraries themselves. I'm not sure what is going on there. I will have one of our Flash programming experts to comment

    Thanks

    ki

  • Hello,

    just wanted to mention that I can confirm the problem on my machine.


    [3/22/2019, 1:14:31 AM] [INFO] Cortex_M4_0: GEL Output: Memory Map Initialization Complete
    [3/22/2019, 1:14:31 AM] [ERROR] Cortex_M4_0: Error initializing flash programming: Failed to load /home/XXX/ti/uniflash_4.6.0/deskdb/content/TICloudAgent/linux/ccs_base/DebugServer/bin/libFlashCC3235SF.so: /home/XXX/ti/uniflash_4.6.0/deskdb/content/TICloudAgent/linux/ccs_base/DebugServer/bin/libFlashCC3235SF.so: invalid ELF header


    No solution found yet.
  • Hello Norbert,
    Are you also on Debian?

    Thanks
    ki
  • Hi,

    yes I am on Debian Buster amd64 todays version.

    Yours
    Norbert
  • Thank you. I just saw your other thread.

    I realize that I was using the the wrong target when trying to reproduce (CC3235S instead of CC3235SF). I am trying to find the correct target to try to reproduce.

    Thanks
    ki
  • I reproduced the issue on both Debian 9 and Ubuntu 18. I filed a bug for this. Tracking ID: UNIFLASH-1221

    Thanks
    ki
  • Adam, Norbert,

    Adam Parker said:
    or science I then backed up my libFlashCC3235SF.so and copied the libFlashCC3220SF.so (which does have a valid ELF header) to be libFlashCC3235SF.so. Guess what? It works. It debugs the exact same project I've been working on this whole time. But who knows what's different about the intended .so for CC3235SF and the .so for CC3220SF so while that's a temporary band-aid it needs to get fixed.

    I confirmed that this is indeed a valid workaround. The reason being is that libFlashCC3220SF.so does also indeed support CC3235SF. In fact, the "correct" version of libFlashCC3235SF.so is supposed to be simply a renamed copy of libFlashCC3220SF.so. We are looking into why some corrupt copy of the file got shipped instead. 

    Thanks

    ki