Bug in KDS when using CMSIS in C++ - Was: Kinetis Design Studio and C++

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Bug in KDS when using CMSIS in C++ - Was: Kinetis Design Studio and C++

ソリューションへジャンプ
1,478件の閲覧回数
Masmiseim
Senior Contributor I

Hello,

 

Until know I was working with Rowley Crossworks for Embedded Development and I’m quite happy with it. But I wanted to give KDS (v3.0) a try.

I created a simple Project without using Processor-Expert or KSDK. I renamed the automatically created main.c file to main.cpp and added some includes to the CMSIS files.  You can find the resulting main.cpp File as an attachment.

 

Compiling this leads to an error in the CMSIS include File:

../Includes/core_cm4.h:1787:1: error: expected declaration before '}' token

 

It should definitely compile. Has KDS some problems with C++?

 

Thanks and regards

 

Markus

Original Attachment has been moved to: main.cpp.zip

ラベル(1)
1 解決策
1,203件の閲覧回数
Masmiseim
Senior Contributor I

Hello,

OK I fixed it on my own. It is not a C++ problem.

The CMSIS-Headerfiles delivered with KDS3.0 are rather old and seems to have some bugs which lead to the described Errors, but only when compiled as C++.

I replaced the CMSIS Files with the current Version. Now it is compiling without problems.

Regards

Markus

元の投稿で解決策を見る

0 件の賞賛
返信
3 返答(返信)
1,204件の閲覧回数
Masmiseim
Senior Contributor I

Hello,

OK I fixed it on my own. It is not a C++ problem.

The CMSIS-Headerfiles delivered with KDS3.0 are rather old and seems to have some bugs which lead to the described Errors, but only when compiled as C++.

I replaced the CMSIS Files with the current Version. Now it is compiling without problems.

Regards

Markus

0 件の賞賛
返信
1,203件の閲覧回数
ZhangJennie
NXP TechSupport
NXP TechSupport

hello Markus.

please refer Erich blog for C++ with Kinetis Design Studio:

C++ with Kinetis Design Studio | MCU on Eclipse

this article may help you.


Have a great day,
Zhang Jun

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

1,203件の閲覧回数
Masmiseim
Senior Contributor I

Hello Zhang Jun,

thanks for your feedback. I know Erich’s blog, and I like it very much.

Erich says in his blog:

“Bare Projects with C++

If using C++ with a bare project type, then everything is setup correctly. You only need to make sure that header files included for C++ files are listed in the compiler include path settings:”

This means I shouldn’t have any problems, but I do.

The only things I did was renaming main.c to main.cpp and added the include instruction

#include <core_cm4.h>

#include <core_cmInstr.h>

#include <core_cmFunc.h>

This Blog is abound Version 1.1.1. Maybe something changed to the current Version?

Thanks and regards

Markus

0 件の賞賛
返信