Hi Everyone !
Let me tell you more about my project, this is an circuit system that receives data from temperature sensor show it to 4digit 7-segment display, respond by buzzer . For heating up-down 6 push button key is used. Looking at the algorithm, I have use GPIO interrupt, SPI, timer etc choosing from cubemx. At it has several states, so we use state-machine,utilities and user driver those are very useful during operation. All system is helping on HAL driver, CMSIS, global c and h files and this comdef.h
I am using ARMCC and target option and including paths, all followed from example cubemx project, from install pack I have updated all.
I am getting following errors.
\states\main_state.h(22): error: #5: cannot open source input file "comdef.h": No such file or directory
Usually it comes with Visual C++, I am not sure why my project is not supporting this file in KEIL.
This code was build in Coo-cox environment, I have modified some of its part after changing its main MCU pin-out in cubemx.
2. What I have modified is, its tim.h. spi.h, gpio.h, files combine in one main.c file. Remove I2C h file. some time I did #include #define.
3. Make changes in mxconstant.h file, as we changes GPIO in cubemx,
4. I think, HAL files some how conflicts in for minor changes.
5. Somehow, state files cannot recognized by HAL drivers. Take a look here, http://www.keil.com/support/docs/1868.htm 6. Problem to include header reference, http://www.keil.com/forum/3775/
Kindly, tell me more possible reason thus I can work for that.
"Usually it comes with Visual C++, I am not sure why my project is not supporting this file in KEIL."
Maybe because Visual C++ is a compiler for creating Windows applications, while Keil MDK-ARM is a compiler for creating embedded applications. Do you really plan to use COM in your embedded project?
Note that the M$ COM is not a serial port interface but a binary interface for interprocess communication. en.wikipedia.org/.../Component_Object_Model
Dear Sir Westermark,
Its a nice point you figure out! As a newcomer I am really drifting here! Your reference tells that,Component Object Model (COM)is basis for several other Microsoft technologies and frameworks.
If it Visual C++ based application and doesn't support mdk-keil compiler, then I should think other way.
But, my state files are completely comdef.h/global.h dependent.
An expert says in this way, he believes its not a problem of compiler , my.st.com/.../Flat.aspx
Kindly Suggest me what to do.
Regards Hasan
Note that comdef.h is not a standard header file of the programming language.
So while Microsoft might have their comdef.h that is related to interprocess communication, an embedded compiler or a library for embedded processors might also introduce a comdef.h file - but possibly relating to UART communication.
So if you cut and paste random code and get a compilation error that you miss comdef.h, then you must go back to where you did copy your code and figure out what specific comdef.h file that environment did use. And then you need to figure out if that specific file is relevant for your own project.
One requirement when doing copy/paste is that you do need to understand the code you copy - else you can't modify it to suit your needs. And you can't understand how to debug it.
Yes, I worked before UART for communication between 2 MCU or DSP. I dodnt understand why previous project that developed in Coo-cox has been used COM!
Now looking at the code in comdef.h you will find global constants those are used for data types and buffer-size! i.e typedef unsigned short uint16; /* Unsigned 16 bit value */
Yes, I did copy pest, but I minimized build after getting idea from build output.
Types might be defined in multiple places depending on what include files are pulled in !
Recently, an expert says,
"If you have a lot of conflicting definitions you need to clean up things so there is the consistent application of one or two include files containing unique types that bridge the gap between what the standard include files are pulling in, and what you need to get closure in the rest of your code base."
So, isnt the issues are not relating to library for embedded processors ?
The previous project need not have used COM. I mentioned COM just because you requested a file with a specific reference to M$.
Note that there exists many different files in this world with this specific name. Since the file name isn't part of the language standard, you must go back to the original environment and verify the existence of this file. And check if it's a file that you have a valid license to make a copy of when moving to Keil.
I got it what you wanted to explain. Undoubtedly its helpful information. Still its a problem why ARMCC does not talk with comdef.h.
As I mentioned earlier, my states files are mostly depend on it.
Another issue, following example code in Keil, I have kept things same (HAL library,inc,CMSIS) in include path, but if I add state files in includes, error out puts says, ../Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_rcc_ex.h(2051): error: #20: identifier "HAL_StatusTypeDef" is undefined
One ARM expert says, "CubeMX which is causing this error".
Without comdef.h and related dependencies, how could I implement my application? Its a complex algorithm !
No - it's not a problem why Keil doesn't distribute the file. It's a problem why you have copied only some of the files needed for your project. And if you even have the license rights to copy this specific file.
If all you need is data types, then the data types can be defined from data types available in the header files distributed by the Keil compiler.
Dear Sir,
<"It's a problem why you have copied only some of the files needed for your project.">
I have use the HAL driver and libraries mostly from STM32Cube_FW_F0_V1.6.0 and cubemx generated code ! and what I did is try to adapt previous co-coox project in this mdk-keil. Mdk-keil also provide auto generated HAL driver if you open cubemx in Keil. Kindly make me clear what do you feel on "copy" or "pest" and licence?
<"If all you need is data types, then the data types can be defined from data types available in the header files distributed by the Keil compiler.">
Kindly give me an example.I have now a problem on data field where HAL_LockTypeDef is used.
So have you revisited the system where the source code was originally written, and on that system located the specific file?
Have you verified the copyright information and any licensing it is covered under? That should tell you if you can just copy the file from that system.
<So have you revisited the system where the source code was originally written, and on that system located the specific file?>
My HAL driver,include, source files are completely untouched! Its same as it was before for sure. If you would use cubemx, you will able to understand there is some space fallen to write user code! With dependencies and other user code like state files, system compiles you know very well. As I mentioned earlier, keil makes HAL library automatically !
What I did is just make changes to my main.c! Its a different application in a custom board not a evaluation board from ST!
<Have you verified the copyright information and any licensing it is covered under?>
I dont understand why you are arising copyright ! My question was related to KEIL setting with HAL, and might be f goes to C/C++ related.
But that other system does have a file that your current system do not have.
The possible solutions then are: - copy the file (if allowed) - find a replacement for the file - rewrite the code to not need the file
So the open question is still: have you verified who wrote that file? Where did it originate from?
mdk-keil does not support comdef.h for compliler.
This is the last finding.
mdk-keil does not support comdef.h for compiler.
That makes no sense at all!
To prove the point, I just created a file called comdef.h and included it in a project. Not too surprisingly it worked correctly.
So, would you like to rephrase your statement and indicate what part of the content of your file comdef.h is causing a problem?
He has just arbitrarily expected that Keil should be shipped with a file with this name - and with the specific contents needed for the code he has copied from somewhere to correctly build.
In the end, Keil comes with the header files needed for the libraries shipped with the Keil compiler.
If any other library or code is used, then it's the end-users responsibility to make sure that the compiler gets access to any other header files that the library or project might need.
Since the Keil compiler isn't a compiler designed to produce Windows binaries, it should be expected that it isn't shipped with header files intended specifically for the Windows platform.
"In the end, Keil comes with the header files needed for the libraries shipped with the Keil compiler."
Could you kindly explain in detail?
"Since the Keil compiler isn't a compiler designed to produce Windows binaries, it should be expected that it isn't shipped with header files intended specifically for the Windows platform."
Do you mean there is some limitations using in Windows?