Thread: struct "ECAN_MBOXES" has no field "MailBox"

  1. #1
    Registered User
    Join Date
    Aug 2021
    Posts
    12

    struct "ECAN_MBOXES" has no field "MailBox"

    My project is running on ccs 10.3.1.
    At this moment at project > C2000 compiler > Include option, I am using 2 path(include_path,-l) like
    C:\ti\c2000\C2000Ware_3_04_00_00\device_support\f2 806x\common\include
    C:\ti\c2000\C2000Ware_3_04_00_00\device_support\f2 806x\headers\include


    My code is kind of customized from parent F2806x_ECan.c and F2806x_ECan.h.
    My one is like eCAN.c and eCAN.h.

    I have piping with other device so CAN_Module.h and CAN_Module.c has made for some purpose.
    For this specific error, let me give you some detail information what error console is saying,

    subdir_rules.mk:9: recipe for target 'CAN_Module.obj' failed
    "../CAN_Module.c", line 45: error #137: struct "ECAN_MBOXES" has no field "MailBox"
    "../CAN_Module.c", line 46: error #137: struct "ECAN_MBOXES" has no field "MailBox"


    Its hard to track down the actual cause, TMS320F2806: #16000: object files have incompatible formats - C2000 microcontrollers forum - C2000™︎ microcontrollers - TI E2E support forums

    One point is very significant in this problem, both 2021 and 2013 version of F2806x_ECan.h has locked mail boxes inactivate in code, MBOX0, MBOX1...MBOX31. This code is definitely supported by 2013 version because MBOX MailBox[32] array is absent in 2021. Not sure why mail box array is closed in both version while other options are open.
    Last edited by Salem; 09-15-2021 at 11:29 PM. Reason: train wreck formatting

  2. #2
    Registered User
    Join Date
    May 2009
    Posts
    4,069
    Whenever you are using an Code::Blocks custom makefile project, you need to look inside the makefile for the cause and solution of the build problems.
    Only after the build works from the command line should you look for an problem in the C::B IDE.

    Tim S.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

  3. #3
    Registered User
    Join Date
    Aug 2021
    Posts
    12
    Quote Originally Posted by stahta01 View Post
    Whenever you are using an Code::Blocks custom makefile project, you need to look inside the makefile for the cause and solution of the build problems.
    Only after the build works from the command line should you look for an problem in the C::B IDE.

    Tim S.
    Well. This code is huge one. In debug folder of this project I can see .obj file, .map file .d file, .mk file and a particular .map file.
    Map file can tell something?

    If you can look the error console is saying 'CAN_Module.obj' failed. I cant see any .obj file in my Debug folder. What do you think?

  4. #4
    Registered User
    Join Date
    May 2009
    Posts
    4,069
    You can ignore my post I was thinking you were using the Code::Blocks IDE; since what you stated you did sounded like an Code::Blocks option.

    Since, I have no knowledge about either your code or your IDE, I can not help you.

    Tim S.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

  5. #5
    Registered User
    Join Date
    Aug 2021
    Posts
    12
    Quote Originally Posted by stahta01 View Post
    You can ignore my post I was thinking you were using the Code::Blocks IDE; since what you stated you did sounded like an Code::Blocks option.

    Since, I have no knowledge about either your code or your IDE, I can not help you.

    Tim S.
    In general you arise a common technique. Its not different for any IDE.

  6. #6
    Registered User
    Join Date
    May 2009
    Posts
    4,069
    Without you posting code! I see no way anyone on this website who does not use your IDE to help you!

    Tim S.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

  7. #7
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    38,734
    > If you can look the error console is saying 'CAN_Module.obj' failed. I cant see any .obj file in my Debug folder. What do you think?
    Well you don't get an obj file if the compile step failed, so nothing unusual in that.

    > "../CAN_Module.c", line 45:error #137: struct "ECAN_MBOXES" has no field "MailBox"
    Seems simple enough, edit CAN_Module.c so it doesn't use MailBox.
    Though you probably have to replace it with something else.

    > One point is very significant in this problem, both 2021 and 2013 version of F2806x_ECan.h has locked mail boxes inactivate in code,
    It's called planned obsolescence.
    - code exists.
    - code exists, but inside a conditional compilation expression. At this point, the maintainers of CAN_Module.c should have been figuring out what to use instead of MailBox.
    - code exists, but is commented out "for reference only".
    - code is deleted, no longer used nor interesting.

    Read release notes to figure out why MailBox was removed and what the alternative approach would be.
    Then update your CAN_Module.c accordingly.

    It's fairly normal if you've just downloaded a bunch of code that hasn't been used in a while to find this kind of bit-rot.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  8. #8
    Registered User
    Join Date
    Aug 2021
    Posts
    12
    Well you don't get an obj file if the compile step failed, so nothing unusual in that.
    Fine! Nice to know that case is normal. While I get some memory problem I usually keep eyes in map file.

    Seems simple enough, edit CAN_Module.c so it doesn't use MailBox.
    Though you probably have to replace it with something else.
    All the problem above is causing for wrong selection in project>C2000 compiler> Include option
    Errors drops to 3 now by changing setting following path
    C:\F2806x_common\include
    C:\F2806x_headers\include

    code exists.
    - code exists, but inside a conditional compilation expression. At this point, the maintainers of CAN_Module.c should have been figuring out what to use instead of MailBox.
    - code exists, but is commented out "for reference only".
    - code is deleted, no longer used nor interesting.
    So kind of you, My old code was able to build previously, may be its conflicting with new version of F2806x_ECan.h.c. Now this problem shifted to as follows,

    #148 declaration is incompatible with "struct PIE_VECT_TABLE PieVectTable" (declared at line 194 of "C:/F2806x_headers/F2806x_headers/include/F2806x_PieVect.h") F2806x_GlobalVariableDefs.c
    I have been copied F2806x_GlobalVariableDefs.c from C:\ti\c2000\C2000Ware_3_04_00_00\device_support\f2 806x\headers\source
    This file is same for both version.

    If we remove from GlobalVariableDefs.c, 103 errors appears including ISR, memory and so on. If we remove it from F2806x_PieVect.h then errors remain 25 and console says "PIE_VECT_TABLE PieVectTable is not defined."

    It's fairly normal if you've just downloaded a bunch of code that hasn't been used in a while to find this kind of bit-rot.

    Well said. This problem make me heal with the same story of moneys and the balance, onside is overloaded then I eat those for balancing, same stupidity happens again.

  9. #9
    Registered User
    Join Date
    Apr 2021
    Posts
    54
    This sounds like you are missing some fundamental definitions.

    I don't know anything about the code you are using, but I suspect that there is some header file you are supposed to include to provide symbol definitions, or alternatively maybe you are supposed to provide -DX=Y on the command line (for some variable X and some value Y).

    There might be code in a header like (this is just an example!!!)

    Code:
    #if ARCH == x86
    #elif ARCH == x64
    #endif
    This sort of thing will quietly not define anything if ARCH is not defined at all. (Because the code author's didn't put "#error" in a final #else block.) And if you don't define anything, you get those missing symbol errors.

    So maybe look at old build logs you might have, to see if there were symbols on the command line that are now missing. Or maybe look at the new version documentation, to make sure there is not some symbol definition you are now required to provide on the command line or in a file.

  10. #10
    Registered User
    Join Date
    Aug 2021
    Posts
    12
    Nice insight for understanding. It is reasonable.

    So maybe look at old build logs you might have, to see if there were symbols on the command line that are now missing. Or maybe look at the new version documentation, to make sure there is not some symbol definition you are now required to provide on the command line or in a file.
    Beside the symbol definition we can also think for external declaration.

    Take a look what source and header is telling about,

    F2806x_PieVect.h

    extern struct PIE_VECT_TABLE PieVectTable;

    #ifdef __cplusplus
    }
    #endif /* extern "C" */


    F2806x_GlobalVariableDefs.c

    #pragma DATA_SECTION(PieVectTable,"PieVectTableFile");#end if
    volatile struct PIE_VECT_TABLE PieVectTable;



    The external declaration does not specify volatile, while the definition does specify volatile. Need to pick one, and declare it consistently in both places? They have to match.

    What should be write in both places?
    Last edited by Hasan2021; 09-15-2021 at 10:19 PM.

  11. #11
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    38,734
    I suppose it's too late to ask if you've got a source control system like git / perforce / cvs in place.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  12. #12
    Registered User
    Join Date
    Aug 2021
    Posts
    12
    Quote Originally Posted by Salem View Post
    I suppose it's too late to ask if you've got a source control system like git / perforce / cvs in place.
    Yes. There is lot of criteria in ccs, eclipse is more diversified. Most of them has been documented well. Depending on code type those are applicable. If you have such experience you can suggest which project setting should be performed.

    I can give you a summary of flag set,
    -v28 -ml -mt --cla_support=cla0 --float_support=fpu32 --vcu_support=vcu0 -O2 --opt_for_speed=3 --fp_mode=relaxed --fp_reassoc=off --advice:performance=none -g --diag_warning=225 --display_error_number --abi=eabi -z -m"{DEMO.map" --stack_size=0x300 --warn_sections -i"C:/ti/ccs1031/ccs/tools/compiler/ti-cgt-c2000_20.2.4.LTS/lib" -i"C:/ti/ccs1031/ccs/tools/compiler/ti-cgt-c2000_20.2.4.LTS/include" --reread_libs --display_error_number --xml_link_info="DEMO_linkInfo.xml" --rom_model

  13. #13
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    38,734
    I meant this -> Version control - Wikipedia

    If you can't track changes, have 'development' for what you're working on, 'release' for stuff that works and 'experimental' for stuff you might end up throwing away, then you're in for a hard time.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  14. #14
    Registered User
    Join Date
    Aug 2021
    Posts
    12
    Quote Originally Posted by Salem View Post
    I meant this -> Version control - Wikipedia

    If you can't track changes, have 'development' for what you're working on, 'release' for stuff that works and 'experimental' for stuff you might end up throwing away, then you're in for a hard time.
    TI describes these things here, you might indicating this issue
    Compiler Version Numbers and What They Mean

  15. #15
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    38,734
    So that's no then.

    What you're saying is that your local directories contain the ONLY copy of your code.
    You have no means of comparing two versions (one working, one not working).
    You have no means of getting back to a working version other than editing the code and a good memory for the things you did.

    Is this is your situation?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 4
    Last Post: 05-06-2015, 10:23 PM
  2. Replies: 2
    Last Post: 12-08-2014, 08:12 PM
  3. An interesting code about "struct" in "union"
    By meili100 in forum C++ Programming
    Replies: 3
    Last Post: 04-08-2008, 04:37 AM
  4. "itoa"-"_itoa" , "inp"-"_inp", Why some functions have "
    By L.O.K. in forum Windows Programming
    Replies: 5
    Last Post: 12-08-2002, 08:25 AM
  5. "CWnd"-"HWnd","CBitmap"-"HBitmap"...., What is mean by "
    By L.O.K. in forum Windows Programming
    Replies: 2
    Last Post: 12-04-2002, 07:59 AM

Tags for this Thread