Not applicable
Feb 09, 2016
04:02 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Feb 09, 2016
04:02 AM
30 Replies
Not applicable
Feb 11, 2016
07:22 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Feb 11, 2016
07:22 PM
HI,
You may refer to the follow threads on mixing c and c++ in your project.
Forum threads:
http://www.infineonforums.com/threads/3234-DAVE-C-project
http://www.infineonforums.com/threads/1677-Programming-in-c?
Hints to mix c and c++:
https://isocpp.org/wiki/faq/mixing-c-and-cpp
Regards,
Daryl
You may refer to the follow threads on mixing c and c++ in your project.
Forum threads:
http://www.infineonforums.com/threads/3234-DAVE-C-project
http://www.infineonforums.com/threads/1677-Programming-in-c?
Hints to mix c and c++:
https://isocpp.org/wiki/faq/mixing-c-and-cpp
Regards,
Daryl
Not applicable
Feb 12, 2016
12:16 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Feb 12, 2016
12:16 AM
I already found these informations. But it is no help. Since I cannot configure a c++ compiler in DAVE 4.1.x. The toolchain only shows gcc and not g++.
Renaming the call to g++ from gcc is not a solution because one is missing all options to configure g++
Renaming the call to g++ from gcc is not a solution because one is missing all options to configure g++
Not applicable
Feb 12, 2016
02:04 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Feb 12, 2016
02:04 AM
Hi,
It should be possible to compile using the C++ compiler by renaming at least one of your project files from .c to .cpp extension.
Another way is to change the project settings:
Goto:
Project -> Active Project Properties -> C/C++ Build -> Settings -> ARM -GCC C Compiler.
- Under Command: "${ARM_GCC_HOME}/bin/arm-none-eabi-gcc"
- Change arm-none-eabi-gcc to arm-none-eabi-g++
Regards,
Daryl
It should be possible to compile using the C++ compiler by renaming at least one of your project files from .c to .cpp extension.
Another way is to change the project settings:
Goto:
Project -> Active Project Properties -> C/C++ Build -> Settings -> ARM -GCC C Compiler.
- Under Command: "${ARM_GCC_HOME}/bin/arm-none-eabi-gcc"
- Change arm-none-eabi-gcc to arm-none-eabi-g++
Regards,
Daryl
Not applicable
Feb 12, 2016
02:11 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Feb 12, 2016
02:11 AM
As i have written, renaming is no clever posibility, because the configs in eclipse are still expecting a gcc and not g++ and therefore the GUI config settings do not match.
Why is ARM-G++-Compiler (and linker) excluded in the ARM-GCC-Applikation toolchain of DAVE?
It is not problem to use g++ in eclipse with a proper setup toolchain.
Not applicable
Feb 13, 2016
08:03 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Feb 13, 2016
08:03 AM
Just to clear things up.
After adding a .cpp file the c++ settings show up, as you said.
Is the startup code and the linkefile able to handle c++ correct?
After adding a .cpp file the c++ settings show up, as you said.
Is the startup code and the linkefile able to handle c++ correct?
Not applicable
Feb 14, 2016
10:05 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Feb 14, 2016
10:05 PM
HI,
Yes, there is no issue with the handling.
Regards,
Daryl
Yes, there is no issue with the handling.
Regards,
Daryl
Not applicable
Feb 15, 2016
02:39 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Feb 15, 2016
02:39 AM
From what I tested, this is NOT correct!
Constuctors of global declarated Objects are NOT called.
Constuctors of global declarated Objects are NOT called.
Not applicable
Feb 15, 2016
09:46 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Feb 15, 2016
09:46 PM
Hi,
Can you share across your project for us to check on this.
Regards,
Daryl
Can you share across your project for us to check on this.
Regards,
Daryl
Not applicable
Feb 16, 2016
12:33 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Feb 16, 2016
12:33 AM
Clean DAVE-CE project.
Very simple:
And if you got some public "const static" or "static" elements in the class the compiler complains:
So i am pretty sure, that the startup files don't initialize C++ stuff correctly.
Very simple:
testing.cpp
class Try {
public:
const static int constVal = 100; // Triggers the compile warning, see below
int tryVal;
Try() {
// If you set a breakpoint here, you see that the constructor is not run.
tryVal = 10;
}
}
main.cpp
// Outside of main (global).
Try object();
int main {
// if you step here with the debugger you see that tryVal is not 10.
}
And if you got some public "const static" or "static" elements in the class the compiler complains:
main.cpp:43: undefined reference to `__dso_handle'
"ARM-GCC-49/bin/arm-none-eabi-g++" -T"../linker_script.ld" -nostartfiles -Xlinker --gc-sections -Wl,-Map,C++.map -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -mcpu=cortex-m4 -mthumb -g -gdwarf-2 -o "C++.elf" "@objects.rsp" -lm
makefile:71: recipe for target 'C++.elf' failed
arm-gcc-49/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld.exe: C++.elf: hidden symbol `__dso_handle' isn't defined
arm-gcc-49/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld.exe: final link failed: Bad value
So i am pretty sure, that the startup files don't initialize C++ stuff correctly.
Attachments are accessible only for community members.
Not applicable
Feb 18, 2016
09:48 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Feb 18, 2016
09:48 PM
Not applicable
Feb 19, 2016
10:11 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Feb 19, 2016
10:11 AM
Ok, i see. The constructor is only run, if the object is used in any way. Otherwise it will be optimized and stipped out completely.
Not applicable
Feb 20, 2016
06:04 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Feb 20, 2016
06:04 AM
Still fails, if you got DEstuctors in the class you use static or global!
-fno-use-cxa-atexit needed as g++ option.
-fno-use-cxa-atexit needed as g++ option.
Not applicable
Feb 22, 2016
06:32 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Feb 22, 2016
06:32 PM
Hi Holger,
I have filed an eticket #983215007 for this case. You can track the status of this in DAVE Problem Tracking link below.
http://www.infineonforums.com/support/dave3/index.php?option=com_maqmahelpdesk&Itemid=0&id_workgroup...
Regards,
Daryl
I have filed an eticket #983215007 for this case. You can track the status of this in DAVE Problem Tracking link below.
http://www.infineonforums.com/support/dave3/index.php?option=com_maqmahelpdesk&Itemid=0&id_workgroup...
Regards,
Daryl
Not applicable
Feb 22, 2016
11:52 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Feb 22, 2016
11:52 PM
Thank you. I will follow.
Another thing which is not as it should be.
In C++ "mode" it seems the build does not rebuild if a header file is chanced.
If I change a header.h and leave the corresponding header.cpp alone then the code is not rebuild even if header.h is included and the class used in main.cpp.
Pretty odd!
Another thing which is not as it should be.
In C++ "mode" it seems the build does not rebuild if a header file is chanced.
If I change a header.h and leave the corresponding header.cpp alone then the code is not rebuild even if header.h is included and the class used in main.cpp.
Pretty odd!
Not applicable
Feb 23, 2016
08:35 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Feb 23, 2016
08:35 AM
I changed this posting:
http://www.infineonforums.com/threads/3758-How-to-code-in-c-and-c-with-DAVE?p=11231&viewfull=1#post1...
The problem is with DEstructors. Not constructors.
http://www.infineonforums.com/threads/3758-How-to-code-in-c-and-c-with-DAVE?p=11231&viewfull=1#post1...
The problem is with DEstructors. Not constructors.
Not applicable
Feb 24, 2016
08:27 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Feb 24, 2016
08:27 AM
Clarification:
E.g. DAVE (actual) CE Project with the following code.
main.cpp:
TestClass.h:
TestClass.cpp:
If staticVal is changed in TestClass.h and the file is safed, the code is NOT rebuild if one runs "Build Active Project"!
E.g. DAVE (actual) CE Project with the following code.
main.cpp:
#include "TestClass.h"
int main(void) {
DAVE_STATUS_t status;
status = DAVE_Init(); /* Initialization of DAVE APPs */
if (status == DAVE_STATUS_FAILURE) {
/* Placeholder for error handler code. The while loop below can be replaced with an user error handler. */
XMC_DEBUG("DAVE APPs initialization failed\n");
while (1U) {
}
}
TestClass testObject = TestClass();
testObject.doNothing();
int variable = TestClass::staticVal;
/* Placeholder for user application code. The while loop below can be replaced with user application code. */
while (1U) {
variable++;
}
}
TestClass.h:
#ifndef TESTCLASS_H_
#define TESTCLASS_H_
class TestClass {
public:
const static int staticVal = 10;
TestClass();
virtual ~TestClass();
void doNothing(void);
};
#endif /* TESTCLASS_H_ */
TestClass.cpp:
#include
TestClass::TestClass() {
// TODO Auto-generated constructor stub
}
TestClass::~TestClass() {
// TODO Auto-generated destructor stub
}
void TestClass::doNothing(void) {
}
If staticVal is changed in TestClass.h and the file is safed, the code is NOT rebuild if one runs "Build Active Project"!
Not applicable
Feb 25, 2016
02:22 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Feb 25, 2016
02:22 AM
And a question about the ticket system:
E.g. here
http://www.infineonforums.com/support/dave3/index.php?option=com_maqmahelpdesk&Itemid=0&id_workgroup...
Is it possible to monitor a ticket? To get an email as soon as it changes or even to get a list of all monitored tickets?
E.g. here
http://www.infineonforums.com/support/dave3/index.php?option=com_maqmahelpdesk&Itemid=0&id_workgroup...
Is it possible to monitor a ticket? To get an email as soon as it changes or even to get a list of all monitored tickets?
Not applicable
Mar 02, 2016
04:48 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 02, 2016
04:48 AM
Any feedback on the "does not build although .h file changed when there are .cpp files" problem?
Not applicable
Mar 03, 2016
09:27 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 03, 2016
09:27 PM
Hi, Holger,
1. "Is it possible to monitor a ticket? To get an email as soon as it changes or even to get a list of all monitored tickets? "
- For the DAVE Problem Tracking, if you have raise the ticket, any updates in the ticket will be sent to you via the email. However, there's no feature to subscribe to the individual ticket for users.
2. "Any feedback on the "does not build although .h file changed when there are .cpp files" problem? "
- Currently we are working on this issue. I can update once it is available.
Regards,
Daryl
1. "Is it possible to monitor a ticket? To get an email as soon as it changes or even to get a list of all monitored tickets? "
- For the DAVE Problem Tracking, if you have raise the ticket, any updates in the ticket will be sent to you via the email. However, there's no feature to subscribe to the individual ticket for users.
2. "Any feedback on the "does not build although .h file changed when there are .cpp files" problem? "
- Currently we are working on this issue. I can update once it is available.
Regards,
Daryl
Not applicable
Mar 04, 2016
01:02 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 04, 2016
01:02 AM
Thanks for the feedback.
1. Would be nice. I could check if a "stopper" is removed without constantly checking it.
2. Thank you. I am looking forward.
1. Would be nice. I could check if a "stopper" is removed without constantly checking it.
2. Thank you. I am looking forward.
Not applicable
Mar 14, 2016
02:59 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 14, 2016
02:59 AM
Daryl Neo wrote:
2. "Any feedback on the "does not build although .h file changed when there are .cpp files" problem? "
- Currently we are working on this issue. I can update once it is available.
You have seen this?
http://www.infineonforums.com/threads/3895-Solution-for-recompile-problem-in-c?p=11538&viewfull=1#po...
Mar 14, 2016
09:32 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 14, 2016
09:32 PM
Hi Holger,
Please replace the existing contents of ARM-GCC C++ Compiler "Command Line Pattern"
From:
${CCACHE} ${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}
To:
${COMMAND} ${FLAGS} -MMD -MT ${OUTPUT_PREFIX}${OUTPUT} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}
As shown in the image C++Settings.png
Let me know your feedback
Best Regards
Ningareddy
Please replace the existing contents of ARM-GCC C++ Compiler "Command Line Pattern"
From:
${CCACHE} ${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}
To:
${COMMAND} ${FLAGS} -MMD -MT ${OUTPUT_PREFIX}${OUTPUT} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}
As shown in the image C++Settings.png
Let me know your feedback
Best Regards
Ningareddy
Not applicable
Mar 15, 2016
12:29 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 15, 2016
12:29 AM
🙂 This is exactly what I have written in this post:
http://www.infineonforums.com/threads/3895-Solution-for-recompile-problem-in-c?p=11539&viewfull=1#po...
Well, nice to see that my solution is correct. I hope to see this in the next release.
What about the same line for C and ASM? I quess it does not hurt.
http://www.infineonforums.com/threads/3895-Solution-for-recompile-problem-in-c?p=11539&viewfull=1#po...
Well, nice to see that my solution is correct. I hope to see this in the next release.
What about the same line for C and ASM? I quess it does not hurt.
Mar 15, 2016
07:49 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 15, 2016
07:49 AM
We will add this in our next DAVE release.
You are right, adding for C and ASM should not hurt. I will check and update
You are right, adding for C and ASM should not hurt. I will check and update
Not applicable
Apr 13, 2016
04:15 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Apr 13, 2016
04:15 AM
how is the state now? Are there any start-up und linker script for c++ programming?
Not applicable
Apr 13, 2016
04:28 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Apr 13, 2016
04:28 AM
C++ works for me. All summed up above. A special option on g++ to allow global instatiation of classes with destructors. Some command line changes to get partial compiling.
Works flawless as long as you keep it single-threaded even if you use dynamic memory, which should be last resort anyways in C++ nowadays.
As soon as you want multi-threading with any RTOS you should be alert on malloc/new and everything in STL without a self written allocator and proper locking on everything which is not reeentrant (basically everything), because you will shoot youself in the feet.
The compiler and libs are compiled in process-model "single" which means there are no internal countermeasures for atomics, threads, ...
You really need to know what you do if you want to go this way.
Works flawless as long as you keep it single-threaded even if you use dynamic memory, which should be last resort anyways in C++ nowadays.
As soon as you want multi-threading with any RTOS you should be alert on malloc/new and everything in STL without a self written allocator and proper locking on everything which is not reeentrant (basically everything), because you will shoot youself in the feet.
The compiler and libs are compiled in process-model "single" which means there are no internal countermeasures for atomics, threads, ...
You really need to know what you do if you want to go this way.
Not applicable
Apr 13, 2016
06:23 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Apr 13, 2016
06:23 AM
🙂 good to hear that.
Not applicable
Apr 25, 2016
12:39 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Apr 25, 2016
12:39 AM
HRusch wrote:
Still fails, if you got DEstuctors in the class you use static or global!
-fno-use-cxa-atexit needed as g++ option.
After some investigation I can say that -fno-use-cxa-atexi is not needed, but ...
The symbol __dso_handle is missing in the Infineon startup code.
Easy fix:
void *__dso_handle;
@Daryl Neo you may alter the ticket, I cant do it.
Not applicable
Apr 25, 2016
03:17 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Apr 25, 2016
03:17 AM
HI Holger,
Thanks for the investigation. I have alter the eticket. 🙂
Regards,
Daryl
Thanks for the investigation. I have alter the eticket. 🙂
Regards,
Daryl
Not applicable
Apr 25, 2016
06:19 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Apr 25, 2016
06:19 AM
Thank you.
PS: I would love to see infineon being active on this: https://community.arm.com/groups/tools/blog/2016/03/11/cmsis-a-proposal-for-a-future-cmsis-written-i...
Or driving something into the same direction.
PS: I would love to see infineon being active on this: https://community.arm.com/groups/tools/blog/2016/03/11/cmsis-a-proposal-for-a-future-cmsis-written-i...
Or driving something into the same direction.