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.

TMS320F28388S: CLA Task Code Missing

Part Number: TMS320F28388S
Other Parts Discussed in Thread: C2000WARE

Tool/software:

Greetings,

I am building CLA code without any errors or warnings.  The cmd file for the project stores the code in flash, and runs it from RAM.  But when I look at the map file for the project, it is storing the code in RAM and executing from the same address.  And the length is 0.  The LOAD value in the cmd file is the same one we use for the rest of the code.  So two questions:

Why is it using the RAM value for both the LOAD and RUN addresses?

Why is the length 0?

Thank you,

Ed

  • Hi Ed,

    Are you using the 2838x_FLASH_CLA_lnk_cpu1.cmd file from C2000ware (without modifications)? Also just to verify, you have switched your project to the flash build, correct? You can do this by right clicking on the project >> Build Configurations >> Set Active >> CPU1_FLASH. 

    Where in the map file is it showing that? When you build a CLA project using a flash build, the Cla1ProgLoadStart should be a location in flash and the Cla1ProgRunStart should be a location LSRAM, like below:

    Best Regards,

    Delaney

  • Hi Delaney,

    This is happening in our product’s project, not the sample projects.  I have used the sample projects as a reference for ours, and copied appropriate cmd file items to our cmd file.  I don’t think it matters, but we are using the COFF output.  So for Cla1Prog, from the cla_ex1_asin sample project, we are using:

     

       Cla1Prog         :   LOAD = FLASH4,

                            RUN = RAMLS5,

                            LOAD_START(_Cla1funcsLoadStart),

                            LOAD_END(_Cla1funcsLoadEnd),

                            RUN_START(_Cla1funcsRunStart),

                            LOAD_SIZE(_Cla1funcsLoadSize),

                            ALIGN(8)

    and have modified it to:

     

       Cla1Prog         :   LOAD = <our_code_area>,

                            RUN = RAMLS6,

                            LOAD_START(_Cla1funcsLoadStart),

                            LOAD_END(_Cla1funcsLoadEnd),

                            RUN_START(_Cla1funcsRunStart),

                            LOAD_SIZE(_Cla1funcsLoadSize),

                            ALIGN(8)

    where our_code_area is in the flash space which contains the rest of our code.

    In the sample projects I don’t see a Cla1Prog section statement in the .cla file.  As a result, I don’t see how the cla code is associated with the Cla1Prog section other than the Compiler User’s Guide which suggests that it is automatically given the Cla1Prog section.

    Thank you,

    Ed

  • Hi Ed,

    Just for reference, all the given/recommended linker cmd files in C2000ware for each device are located in the file path: [C2000ware install]/device_support/f2838x/common/cmd/.

    DATA_SECTION pragmas should only be defined in C files and are only needed for specific variables that you want to place in shared memory (this has to be done by the main CPU). If you have included the Cla1Prog statements in the linker cmd file, you do not need to add DATA_SECTION pragmas to allocate the CLA program to the correct memory. The CLA compiler knows to look for the Cla1Prog section in the linker cmd file, that's why it doesn't need to be defined anywhere else.

    To have a CLA supported linker cmd file, you also need to add in section definitions for bss_cla, const_cla, scratchpad sections. if you haven't already. If you already have these, please send your linker cmd file here (as a file) and I will take a look to see if anything else needs to be added.

    Please also verify that you have cla_support enabled in your project properties.

    Best Regards,

    Delaney

  • Hi Delaney,

    Thank you for the reference.  I have been using the cla_ex1_asin project from that area as my reference.

    I had a feeling that the Cla1Prog section was automatic like the .text is, but couldn’t find anything to verify it in the documentation.

    I have all of these except the .const_cla because I haven’t needed it yet.  (It will be needed later as the code is developed.)  I have attached a version of the cmd file with our IP stripped out.  I gave it the extension .txt.

    And cla_support is set to cla2.

    Thank you,

    Ed

    -a -c -w
    -stack 0x500
    -heap  32
    
    
    MEMORY
       {
       PAGE 0 :
          CODE_FLASH_SPACE     : origin = 0x089000, length = 0x37000
    	                               
       PAGE 1 :
          RAMLS6               : origin = 0x00B000, length = 0x000800
          RAMLS7               : origin = 0x00B800, length = 0x000800
    
          CLA1_MSGRAMLOW       : origin = 0x001480, length = 0x000080
          CLA1_MSGRAMHIGH      : origin = 0x001500, length = 0x000080
       }
    
    SECTIONS
       {
       Cla1ToCpuMsgRam  : > CLA1_MSGRAMLOW,  type=NOINIT
       CpuToCla1MsgRam  : > CLA1_MSGRAMHIGH, type=NOINIT
    
       Cla1Prog         :   LOAD = CODE_FLASH_SPACE,
                            RUN  = RAMLS6,
                            LOAD_START(_Cla1funcsLoadStart),
                            LOAD_END(_Cla1funcsLoadEnd),
                            RUN_START(_Cla1funcsRunStart),
                            LOAD_SIZE(_Cla1funcsLoadSize),
                            ALIGN(8)
    
       .scratchpad      : > RAMLS7
       .bss_cla		    : > RAMLS7
       }
    

  • Hi Delaney,

    Some additional information which might help.

    The main project is in C++ with C files treated as C++.  The properties of the CLA file were changed to make it look like a C file to the compiler.  Also we are using the COFF output.  I don't know if the mixture of these is causing the cla code to not appear in the output.

    Thanks,

    Ed

  • Hi Ed,

    Delaney is currently out of office until after the holidays. Please expect a delay in response. Thank you for your patience.

    Best Regards,

    Aishwarya

  • OK.  Thanks for the heads up.

    Ed

  • Hi Delaney,

    Hope you had a great holiday.

    Three things:

    I have reduced the project to something which is very small and contains none of our IP, but still duplicates the issue.  If it would help, I can zip it up and send it to you.

    As an experiment, I created an assembly file for the CLA, and put a function with an instruction in it.  That showed up in the map file with the expected size and reasonable addresses for load and run.  So there must be something else I need to do in the cla file or in the options for the cla file to get the compiler/linker to put that code into the output.

    As an additional experiment, within the assembly file, I also created a function called _Cla1Task1 and made it global.  That resulted in a link error which means that the linker sees the routine in the cla file.  But something is preventing it from being placed in the final code.

    Thank you,

    Ed

  • Hi Ed,

    I apologize for the delay. You can send your project over and I will take a look.

    Another thing to verify, are you copying the CLA program from Flash to RAM at runtime? For a Flash build you will need code like the below in your main CPU initialization code.

    Best Regards,

    Delaney

  • Hi Delaney,

    I have attached the file.  You will need to rename it to give it a zip extension.

    I have not yet written the code to copy it to the LS RAM because the length is zero in the map file.  But two things are of interest here.  The first is that the lst file shows the code and with a non-zero length.

    The second is when I write some CLA code in assembly, it does show up in the length field in the map file.

    Thank you,

    Ed

    PK�yY�i;�.CLA/.ccsprojectmQ�N�0=���z�4K������@j�MYꍠ4���bOF�n Nq�޳��l���i�
    ��h�p4�u-�!��hq�F��|�-8��џ��o�쁗����On�:�aÌ`��<B�u��$iU�$M�t�M�!O�dI0�����j-7��@"t��i��>�}�M���{&-�8;d}HR�����$Ů�d�9(%��5L6*�A�JO�h�	qQ�\7�	�F+ԯ�
     /s���pk&�k��)3pk��L�c�k���j��)v?�z_6�Oժ�a�%ەv��!�s�,�{�oPKl�yYZ��0|
    CLA/.cproject�]��F���� t�n�]s�~lf6�P�1/z)��.
    ՚�"�$e�7�����oI�5"���00��]U�����~]����8I�8��,7`p��� z�,�w���f^���8�7�(�������WA����1˱܏��7I�����8�1�>m0
    �7�8yd����2c�8��u8�?��O�M���� ��uQ�8^nC��q�
    z�`z3̚�d�D��DIiu�\�yۄ����x�f��i�]1��
    ����(�TXS�8���#�ʺ�I��W������fx}���A�%-����?C/���<���Ѡ0���6��"}s��3�D^����?D����M��an��K>m�$q�x���?�&��3��ҏ��WGR�I'
    By>�Z��)�FA��bČt�+��ޯ�����]M��ju�����Y����I��:Q3S�i�+{I�<?�J�7�4�|?����/������7�`0'�����꒔6�9��	2�C�bY�)R�Cmv<��_Rib��x�8�<��f��1 ���:q^�Q
    ^$���	>�q�,3��iKfG��t,�����4�&>�y�S��7�Y����d#A`?����I� �'�"_R�ۅ̤�L�A��`���l�ͨf�[P3�Ҵ+��y�#�ȋ�����I��s���0}sS�dl�.��ܞ k<��|3Xya��7�ha�>
    T�ߧ�9��.˫�0ʊ�BlZ�@���-���p3H��m�YC�o�Cx1�r�!ei���b��}�zc�2��;�~�s{:A��f>vE�3��;6��N�DMsk�x
    �"�C���Ȝ-�.�Y��mL&��ބA����ʦ��l1GwSgl�o����I�8���[�]�fSg�F��c8?g>�T�̙�ܽ��5�3E��p�����I����Ʒ�,���Y��Sjٓ�,4a<6&Ctg��{�d�!{f��,�6X�<���5�?Ϭ���6�ڊq}��������lN�ֽ5)!ae^�DM��<�x�g?)�S;��JTj�xv4?dZ�s��*N��ɹc?�U�vT�e��TM)%.~��_&Ւ�~��~���D� ��(N>�z�mޡ\ԜKNj
    /����~��Ɗ>I���#J��r����O��n4�h7$�}'I�����Ȝ&�:�
    U%��Ra�1�"���9�6�(���=1G���f��5+躪h�ZuPc�d�A�d1�_A��%�K�'p-�'�W��׈<��ye:6�a��wrD���m����c��O7��Q��j8�m���*���O�#�L��_�
    ��yϤ����dۭ��֝=�X	�-8Yje��jI>���[�Q�Gh�a?͙Sn5dNB��q�� �Aԑ��[hl����h�Èx�������m!��(��2��3(w�<|�W+of���Z��k0�BI,�\�٬�*o�``� ����ľ��a��Ѳ��Ε -�`�%�#@��o
    LY?h�Y�8�=��ɯ�Q�DNx��(4p�+���aA*^�Ac��
    �~�c��)��k��N�7�w��1/�~��^����%������
    c���Ap'��_P�p[Lu��-�j��ak������
    ��,j��^�X6��dS��R0���n11���k�$�w���8	�[�(C�����F~N5b<56a�|Hq� ��#D
    ��uJ�e���� ��E���ojK��$���*t���08z�"�'��b�e�!Hs���_Uo2�ꖰ(�#|!���E�s��i��P�i5���_(\tE�)��]G��fI%Q��{c�w �8�'��b&+b9��b���G�O�G��1���2��A0��~�κbJ����
    x��o̺!
    �d]��]��BM������
    &�"ؔ���XF�a#�
    <����D�����8$ MD`l��c�DWki��w7u�;��!�����	<PDl>�,����xK�
    �IZ"	�JI!2ү����Hk/�݌Ʒ,����r|��+����I�M��
    �������R���3`t1��pݩɪ��I��U=���#�`'���c�+�n�xI�=�q��E��-x��R:�F/����٪s�t�XEF��eMD^w�&�Lf�IR��&�ׯ���f��TA�J�'�E���m���L�U�-��}�K��쀷1�ӗhf9t�qb��9]�T�1���hb���+���.��S�s��m��Z�̙����9�j��!�7^��n6������ޞ��O�5N�3t��^�����]mî��c�
    ��[ù{���%���������׈2�X&�d��q���oÐ8�L���EHqDts�,	��wC��i̭����@�C�\#Z�8Q?�y���mr��%L4���e��(�*Wg�Lfx!��^��u���������j�DQ��S+M5����B��U3n�F�����62&����䎪&H0�\n�ȋ�$f'���Z���f߱F�;k���k_?s6{pg,FsVRU�:����1&u�R�K����Io6`��X��c?֯�P�&��9�)xt�����h�.���3�ر���d.2��K���
    ���,k��C���|�:�H�����9ƻ��g��d�̱'�*'#	I��Q#���zY��J}/ZU٦�s$�ԫ'��<������k(��—}��
    L�=�n��]NUU]S���X�c�$��C��,���@�G/�H�!��*���l���~����}we��a�������{ǘ��ʁ7���m�m�Юq����hB�>1.��v-�� _��Y�3u�d1����9EN�L��Z�
    �i���	�=�6݄�'Dw`�����'������c���#�H�E��z�Q�7Y{�8��&x����|n��?��m�y�d���	B��8\~���{%��?zA��tY���݄���J�]U^�E�W�]�|�����&���r�)$eP��W�SG�e�k��Rx�5�������'�}mM�=�tR�N�.H%�^�0�9�t����?����Y%��3$k٪U��'�D�!�B����>��Ż�;����ʁ�t���~C�(ʜ\%�H��Y�0�DqF�ّU�^�q�.	�1%02���,M����O�R
    �埑	�8��s\ʟ,k�a��0-i*'V��'�74��H'�I`��C��	���;�K��W�g�*���z�P%hB�s�;5I�$
    �)��/ a��E,`	Ȏ�w���Ӳ�/���.ӂ�>���肨+z��p�N�|����w�v5�{b���W��ә�.r�;˱��$I�$+���W~�)8'+��|n�_�=��{�G�vx����m�1��pɺ`^xIչ�W��A�x�Lq�di�c7T�i_��Q��Պl��n��~�j��U;w�����t2'�X����A"1�&�3
    %~UBⅸ����{�n?�W�_w���0g�1޲�$H���9�|�.�x�&�6	+C@�zz�A��4�4���(i��򺬨��k�$�`�Z��@!�*=��&g�,d	�=����,C�&��F9���8L�~)]
    ��k�H���'���ī�)
    �d�k�l�}\�6�@AH���f�*2x.+p2��V�0���I�c�O��f�L�.�"j�����U�<�X�9�b)�j�P;�F��E���er�dA�%Q��	'�Iw}Ev�6�O��z��RIAfD?]��Ǟל<�<,�1_�^yI���;^���2H�ieZbg�k�X�{�r�k-�
    ��-��]�������k�k�.Ε xd]WD�J����*�D��8!���\�bx&�g��@�}�8t����i�z�،���j���Oȵ�f�<�SU�Ϸq1��O�qJ�07�}�,�f��	�'@�>�`�M�ùR�ͱ1��p��K� �>01�-������������VԘ��� �Ly�H�\G�������b�湑*�!`���VZ57V�^�y�@�������J`��;�KÂը�3�ΌG=S��‹�U�¹g^��8)8 ˙g]͹j��H<D��\�A���j�X0n��h1����
    ��+:�U�@�[���4���g�0�=S3ח��+:�RFP��4�@���z7!r�R��"q�4��X:ę,�pנ/��{����5^��|SF��>@kq�yO����X��HczdJ���r<�##^����9Ih������w)���oR?��E�GR��&�	�ˈ��.#��%r��BYE�z�}5�xiK>��w��3+q� ɚRY�<�}���E�A��tq��C��)l�`˚����uI�e�1�EԈ:q�$S��f�ѿe&T[�
    ߚU�K0綸��-R'�A��m4w�D%��>J�֟#tkO�gj:IY�[(�i?�����|�#=9�|w}U��Z�#�e�c\�w���iJ�;������1!&�R#�z�@���>z���ѯ{�1�ylG��/T��86��yUWyQvΚ}/!�2cfQ�t]���*���N���0�ѕI�+����a^�#�A���
    ^U%M��2�_������>KI���/�*�J�p�b3C}TNI�.B+�	̋N�,U5/㗬k�,��C��VD
    �*^�/&�^P�;R�a�ߦY��%��g�׶��Il���)�*�b��)FVƤ�G����E�Hb�>W]#yW���M���V���K�������-%��-q��)h���S��4�m��H��t<DX��w�x�GL��\s�Vx\՛�>+ʒ��gt)3��ɈE�d1"��6�A�ҧE�@�������3��kF�����#����4jfz��[>濝:?�3��q��c����D(��v�J�k����|}պ�!�� �4�{-I��ۧ���8tUN"ˢ��3�Z�z���K����R�p��^���Sh����������'2�^���(��,�@��>���i��抖����+���6`,Mj{�xX��nb}-���\`t`�i'/�Ũ����D���O�mh���]8��,/ЬLA��s�cE�xU��K�\:t¥@5�|&��ׁ�r��%
    �>��tEPE�FQ_��@�>l'���r��w`�_�C��jvwyر������*��n���NT$IP��l��몛��
    ��6�:J�+�L�{V����I��]����f�����j]�E�������F�_���
    ���^F�<⨤U��N~�uy�+iYc�I���qM����i�D�DYU�je-BF��̱�Ӭ��+��V\��nC�^K�W�����&�,{E�A�oL�]���(��^����j3�>���6�q�Х��Lj�{4��E6��>#G�q^6����c6;+#�#�����!�}I_I����ST�aB��ۖs*���4)j��}}�t;u]��o�[��3�ozv]u1T>&]�6�6�}�[�=�:�
    g`�%$#��c���,���`}�AU��d��������̇�/э�a��hxѬ����b������̜J�:`�B�PK�yY�,�YACLA/.project�S�R� =���ɹ�y��hO����eP�d�8~�@H5�mo����,��?;��@絥Uuͮ�X�I����˛j�\����7�p���C���'�a�>��:W��uH���T%��}����M��P�m�
    ��).�)�`t,��B���1��B��;�;T<C85�4��zN�z���$D�ZK[���	N+��lc���aJ#̒׻ޑ�3�4���2=�&^��0Hm��=�v���~J~�(��-�pyE��>�|vK��S�6��i�O�PK�BzYmqi$n�CLA/cla_project.cla+�+�L�KMQ(��/*Qp)�ͭḴ���劏��+I-**-(Q(��LQp�I4I,�6TЀh�rU�r)(��)�*T�
    ��k�����؄Ŧ�(6#E�9)�-0PKR�yY�\(
    �bCLA/cla_project.cmd�SMo�@=���0ǚ`�j?L�6��jM@�{![�*Q��mjk���E����s ;����l�A3��G��L�V��l��@�]��k�lw\��:{:�O�]��p	%���$���K�N��ӑM�,{�T�s
    k��LL�|�`����*�E�6R^��ZK�2�M�%�3�CKRE!//�=�I���q�MNO��/���@����?d&رF��j
    ��WZYs$t�ZD��
    �!-L���#������JR
    �9�ϯ��u~�|%~� �Ÿl���E�S.Jr��hp{9o쨓���,�%M���D�v,�]��`-5�B�icCb����m��嶏�
    %x�X0E�S�޹�T'�Q��1{��%��[%�:�VUI[Gr�{�75:x&e������@��D����L}�MCމ|��PKomyY~ѣCLA/main.cpp+��LQ�M���(�4y���d-/PK��yYCLA/targetConfigs/PK��eY�E;v&CLA/targetConfigs/readme.txt�R�n�0�
    ��,i����E�N2d�ȴ�V����/e;I$@W����
    �ZL�Q�=WT�5Tޕ�zCa����F�3<֞Z�9�0��V��qn�uK8��e�)BT��#Y�e�g�WD�:B��RE
    #�����u
    �.��Fx��I�Agj,�,�vU
    �광�r�u�ְ�[dـm��,~�Z�������$�h}Iը�'��|�D��nR��>n�Ar�O�bI���i��5㥂yzTz}�%nM�)rJrٮ�7'X��F�9�l�do�?v���K;��9IP�g�|)�5�g�
    f�~��M؟d����A�5hR�����v�S�ݥ�����s��I]k~|\�PK�yY9
    Bz� %CLA/targetConfigs/TMS320F28388S.ccxml�Ymo�0�^������vZ>�Ui�h��t�J���z�M6T����B��v������w&Q�"��P���� ��,�.�y��
    �2l�E�z�����bz�/Bb�#/�'}m���<H�!�	
    �k���YD&)��H2��;��LT`���9�S���r摡֕���}C4`B����yb����1�t�B�C/���i[�����g։u��]|#x�Y�Cx/��$�{p�þ"��ڵx<-�c��Ȣ��=l"��t3���P)4
    �
    �OX�D�hs�f�U3�P�M�6zdS�e�����mK�py�-����.��G��/���l���N�9���m#�{�))�����D��=b=���j����^������wV3�4O�t혔G'Á���!ǯHD��hn$��G'�n�X�+�� ���7H�Ζ�b'�
    ޑ���")���V!^ ������g#�~�T�G�>��k�.�7R��<U$�3�ۢ�p�������d�5�kU|���`���/�쭅`s��mA�۰C���n��&�T�_�3C$YHVNu�TW���Ik퍫j���$�k�*ݲ��o�m 򻖟�nρ���Y�&J1���K|��o�:y��⢬aVK�M\s4e�n�9G�o����@nf�9�Q���)��y��>"����+;���OEL�%���:�,��h�x�b�Y��"��M�"�}qf^���
    �"-���7)��U����g��r�0ձ�NK�tk��0/�U�d�U,�z5�׏���7��]�_����//�p�T[��`����Ki�uX�6�_�d���������Dm�PO�H<�lr~4�'EZ��������;�5�t���k2T��}�h�W�����PK�yY�i;�. CLA/.ccsprojectPKl�yYZ��0|
     [CLA/.cprojectPK�yY�,�YA |CLA/.projectPK�BzYmqi$n� �CLA/cla_project.claPKR�yY�\(
    �b ZCLA/cla_project.cmdPKomyY~ѣ *CLA/main.cppPK��yYnCLA/targetConfigs/PK��eY�E;v& �CLA/targetConfigs/readme.txtPK�yY9
    Bz� % NCLA/targetConfigs/TMS320F28388S.ccxmlPK		K!

  • Hi Ed,

    I am having issues extracting the zip after downloading the .txt and renaming to zip. E2E should allow you to attach a zip file to a response using Insert >> Image/video/file>Upload, can you try that?

    Also, after looking at your linker cmd file more, I believe you want to still add a SECTIONS directive const_cla just in case the linker considers part of your CLA code to be belonging to one of these sections. If the linker doesn't know where to place it, it could cause some weird behavior. 

    Also, I think I mentioned this before but just wanted to make sure, you are switching to Build Configurations >> Set Active >> CPU1_FLASH before building, is that correct?

    Best Regards,

    Delaney

  • OK.  Here is a second attempt at the sending the zip file.CLA.zip

    It seems to have done it.

    Ed

  • Sorry.  Didn't address the other items.

    I reduced the cmd file to use only those things which were needed at the time.  The const_cla isn't needed yet because I haven't implemented that part yet.

    I don't understand the Build Configurations question.  Our project has the default (Debug) configuration only.

    Thank you,

    Ed

  • Hi Ed,

    In the linker cmd file you sent, the run setting for Cla1Prog is using APP_CODEAREA, but I don't see where this is defined in the file. You want to use your MY_FLASH_SPACE memory range instead so that it will load to flash and run from LSRAM6.

    Best Regards,

    Delaney

  • Hi Delaney,

    Yes.  You are right.  I missed that when I pared down the project to send to you.  But even with that change, Cla1funcsLoadSize is still 0.

    Thank you,

    Ed

  • Hi Ed,

    It looks like your compiler optimizations are set to level 4. I'm thinking the compiler may be optimizing out your CLA code - can you try turning off optimizations and see if that fixes the issue? You can do this by right clicking on the project >> Properties >> Build >> C2000 Compiler >> Optimization.

    Best Regards,

    Delaney

  • Hi Delaney,

    I tried all of the optimization settings, and also simply turned them off as you suggested.  The result is the same.  The code is 0 length.

    Thanks,

    Ed

  • Hi,

    Delaney is out of office until next week, please expect a delayed response.

    Best Regards,

    Ben Collier

  • Hi Ed,

    Just to update, I am currently looking into this. I am still having trouble narrowing down exactly what is causing the Cla1funcsLoadSize to be zero in your code. Out of curiosity, if you aren't experiencing any build errors, are your CLA tasks able to execute when you connect to the debugger (for your full code)? It's difficult for me to try this out with the cut down project since there is no C28x code initializing the CLA and giving permissions (as well as no driverlib support etc.).

    Best Regards,

    Delaney

  • Hi Delaney,

    Thank you for staying on this.

    We are not experiencing build errors.  I didn’t try to execute the C code because the length was 0 (nothing to copy into the CLA RAM).

    But given that condition, I have written some assembly code which does have a length and reasonable values.  And a few minutes ago, I was able to execute my first instruction using a SW start of the task.  That instruction was just an MSTOP, so I haven’t done much yet in the realm of execution.

    Sorry I don’t have more to offer.

    Thank you,

    Ed

  • Hi Ed,

    Has this issue been resolved at this point then? If so, I will close this thread.

    Best Regards,

    Delaney

  • Hi Delaney,

    It has not.  But I have been moving ahead by writing the code in CLA assembly which does show up, as expected, in the output.  It would be nice to figure this out so that I could move it back to C at a later time.

    Thank you,

    Ed

  • Hi Ed,

    I am still looking into this issue. To verify, in this project, are you using the solution provided in this thread for the compiler options: (+) TMS320F28388S: Can CLA Files be Built in a C++ Project? - C2000 microcontrollers forum - C2000Tm︎ microcontrollers - TI E2E support forums to compile C++ code for the CLA?

    Best Regards,

    Delaney

  • Hi Delaney,

    Thank you for keeping on this!

    To move forward, I have been developing the code using the CLA assembly language.  For performance reasons, I believe I will keep it in that language.

    Still, in the future, we may have other things which we want to run on the CLA, and it would be nice to not need to write those in assembly.

    But back to your question, the project I gave you will not have that change in it.  It would cause other issues in our builds.  But I think that if that was a fix, we could modify the appropriate files so that the option would no longer be needed.

    I'm sorry I can't be of more help to you.

    Regards,

    Ed

  • Hi Ed,

    Ok, I see. I was trying to narrow down if the C++ compiler option was the root of the issue. Do you still see the empty map file when compiling in regular C? If not, I would recommend asking further questions on the other thread so the compiler expert can answer, since I am not familiar with that workaround (or any issues it may cause).

    Best Regards,

    Delaney

  • Hi Delaney,

    I can’t compile in C because our code is written in C++.  And I tried to bring in the older code where the CLA code was written in C, but there are too many conflicts with the new code which is in CLA assembly.  So unfortunately, getting it to build with our latest code isn’t feasible right now.  But I would expect it to still fail.  And the small project I sent you does duplicate the issue.

    You mentioned another thread.  Which thread was that?

    Sorry I don't have more info for you,

    Ed

  • Hi Ed,

    I was talking about this thread here: (+) TMS320F28388S: Can CLA Files be Built in a C++ Project? - C2000 microcontrollers forum - C2000Tm︎ microcontrollers - TI E2E support forums . After looking into it again, I realized I misunderstood that thread. The instructions from the compiler expert are allowing you to build everything in C++ except the CLA file, which you can write (and compile) in C.

    I still suspect that these compiler configurations could be the cause of the empty CLA code. Can you ask about this/link the example code on that thread so the compiler expert can weigh in?

    Best Regards,

    Delaney

  • Hi Delaney,

    That thread seems to be locked as I am unable to add to it.

    But I have attached the simplified project to this thread.  I hope there is a way to get it to the other thread.

    Thank you,

    Ed

    CLA Code Has Lenght 0.zip

  • Hi Ed,

    Let me see if I can loop in the compiler expert directly to this thread instead then.

    Best Regards,

    Delaney

  • Hi Ed,

    Just to update, I have been working with the compiler expert, and I was able to fix the issue in the cut down project you sent. Since there are no references to the CLA task symbols in the main.cpp file, the linker is essentially throwing the function definitions out. To fix the issue in the cut down project, you can do the following:

    • Add a header file with the function prototypes of the CLA tasks and include this header file in both main.cpp and the cla_project.cla files.

    • Make a reference to the CLA task names in the main.cpp file. For example, I did the following in main.cpp:

    Do you have these references in the main.cpp of your regular project? In order to set up the CLA properly you would have to reference the symbols in this way, so if you do, this wouldn't be your issue. However, if you haven't added all your CLA configurations to the main.cpp file yet, that would be the reason the map file is missing your CLA program code.

    Best Regards,

    Delaney

  • Hi Delaney,

                    I apologize for the tardy response.

                    I found an old version of the project which I had archived and forgotten about.  Sorry I didn’t find that sooner.  It has the .cla file and the beginnings of the asm file I created for the CLA.  With the asm file included in the build, I can see a code size.  If I exclude it so that the cla file is the only file being built, the size is 0.

                    So I have excluded the asm file and modified the system so that the code assigns Cla1Task1 to MVECT1.  I also tried assigning it to a temporary variable as you did.  The result is the same as before – the length 0.  Something I didn’t notice before is that the values for LoadStart and LoadEnd are in the RAM, not the flash.  With the assembly file, LoadStart and LoadEnd are in the flash and RunStart is in the RAM.  That may be a clue.

    Thank you,

    Ed

  • Hi Ed,

    I believe if the CLA program size is considered 0, the linker will place the LoadStart and LoadEnd in a default location, which could be in the RAM even if you designated the CLA code to load to flash. If you search in the map file for the "Cla1Task" symbol, does it show up? If not, then the issue would still likely be that the compiler is throwing out the symbol since for some reason. 

    Are there any differences to the compiler flags being used in the archived project? Are you able to send the project to me over E2E messenger with the issue? Or a cut-down version of the new archived project?

    Best Regards,

    Delaney

  • Hi Delaney,

                    I have taken the project I found, and pared it down to the minimum, where it duplicates the issue using the main code which you suggested.  It still doesn’t put a Cla1Task1 in the map file.

                    So under the assumption that the compiler optimized away the one main instruction, I changed main to return the address of Cla1Task1.  That results in a link error because it is unable to find Cla1Task1.  But Cla1Task1 now shows up in the map file, but as UNDEFED.  I have attached a zip file of the new project.  I hope it helps.

    Thank you,

    Ed

    Missing_Task1.zip

  • Hi Ed,

    Delaney is currently out of office but will get back to you as soon as she can after her return.

    Best Regards,

    Allison