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.

Problem implementing assembly language functions in C, CCSv5

Other Parts Discussed in Thread: TMS320F28069

I'm evaluating the TMS320F28069 using the controlStick, and I've been using some of the example projects that are written in C.  For our application, we will need to implement some functions in assembly, so I've begun to build a function in assembly, based on the http://www.ti.com/lit/an/spra806/spra806.pdf  document which explains how to do it.  When I follow those instructions to make my function, the program ends up in the illegal instruction ISR trap as soon as I run it.

Can anyone tell me if the procedure is different for CCSv5?  That instruction document details how to do this for CCSv4.  I'm wondering if this is the reason why I'm having trouble.

Thanks,

Justin

  • Justin,

    The document uses CCS3.3, but you should be able to follow the same instructions in order to make this work in CCSv5.  The only difference is that the context menus to get to the build options, etc may be different.

    Did everything work as you were going through the steps?  (ie no compile issues, no warnings, etc)

    If there were no errors I would attempt to run the code at step 2.4.  If that goes well, I'd just make sure that you're following the instructions correctly.

    Let us know if you have any other questions.


    Thank you,
    Brett

  • Brett,

    I solved the problem with the help of John Walker.  It turns out that by following the steps in the tutorial, the compiler gave me a function that did not work once I made it into a stand-alone function.  The two problems that it had were:

    1) the assembly code did not have an LRETR instruction at the end of the function

    2) the compiler-generated assembly code added 4 to the stack pointer at the beginning of the function, but never restored it before it returned. 

    Anyway, it works now, and in the future I know what to look for.

    Thanks,

    Justin