Regd Adding Cpp Application files

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.wsdof.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
11 posts / 0 new
Last post
sandeep.kelasangada
Offline
Last seen:6 months 3 weeks ago
Joined:2019-08-09 09:30
Regd Adding Cpp Application files

Hi,

This is regarding to DA14695. I have an application written in C++ and driver writen in C for another MCU, now i have port the same application on Dailog MCU environment.

When i try to create a C++ project I'm not able to see the SDK folder as it is available in the built-in examples like ble_adv, ble_cli.

When i take the base project as ble_adv, and try to add my Cpp application, i'm not able to add the cpp files.

请告诉我如何使用Freertos部分创建CPP项目,或者如何修改像BLE_DEV示例等漏油项目。

regards

Device:
MHv_Dialog
Offline
Last seen:2个月6天前
Staff
Joined:2013-12-06 15:10
Hi,

Hi,

I have escalated this issue to our internal support team. We should receive a reply in the next day or two.

/ mhv.

MHv_Dialog
Offline
Last seen:2个月6天前
Staff
Joined:2013-12-06 15:10
Hi,

Hi,

我收到了我们内部支持团队的以下提示:

"

In order to get the C++ to coexist peacefully with the C, it is required to have all C header decorated with the following pattern:

#ifdef __cplusplus
extern "C" {
#endif

#ifdef __cplusplus
}
#endif

"

I hope that helps you resolve the problem.

/ mhv.

sandeep.kelasangada
Offline
Last seen:6 months 3 weeks ago
Joined:2019-08-09 09:30
hi,

hi,

The question was regarding to create a projec C++ .

当我们尝试创建一个C ++项目时,我们没有看到像BLE_ADV,BLE_PERITELAL这样的示例项目中看到的任何文件夹。没有看到SDK文件夹。

my requirement is to create a project with FreeRTOS support and the project has C source files as well as C++ source files.

Kindly shared details regarding this. How to create a project for a ble_peripheral with support for FreeRTOS and has C and C++ source files.

regards

Ben.laure
Offline
Last seen:2个月2周前
Staff
Joined:2015-11-24 10:20
嗨Sandeep,

嗨Sandeep,

I think the best approach would be to convert an existing project from C nature to C++. There's an integrated tool in Smartsnippets studio. you need to "File->New Project -> Convert to a C/C++ project" and then follow the wizzard.

Then you start to make sure all the headers you include are correctly decorated.

sandeep.kelasangada
Offline
Last seen:6 months 3 weeks ago
Joined:2019-08-09 09:30
Hi,

Hi,

The steps mentioned by you work only partially. I have taken a demo project from sdk folder. ble_peripheral. perform clean and build it build successfully.

Now as mentioned by you i try to Open new project and select the option to convert to C/C++ project. In the wizard i can see the ble_peripheral project i select it and select ARM_CROSS_GCC. I have not added any new C++ files yet.

Now again i perform clean and perform build. The build invokes C++ compiler and gives below errors. Kindly advice.

调用:GNU ARM Cross C ++链接器
c:/program files (x86)/gnu tools arm embedded/7 2018-q2-update/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v8-m.main/fpv5-sp/hard\libg.a(lib_a-exit.o): In function `exit':
出口:(。text.exit + 0x16):未定义引用“_exit”
./startup/DA1469x/GCC/exception_handlers.o: In function `.code_starts':
C:/diasemi/smartsnippetsstudio2.0.8/sdk_10.0.6.88/sdk/bsp/startup/da1469x/gcc/exception_handlers.s:153:未定义引用`__copy_table_start__'
C: / DiaSemi SmartSnippetsStudio2.0.8 / SDK_10.0.6.88 /sdk/bsp/startup/DA1469x/GCC/exception_handlers.S:154: undefined reference to `__copy_table_end__'
C: / DiaSemi SmartSnippetsStudio2.0.8 / SDK_10.0.6.88 /sdk/bsp/startup/DA1469x/GCC/exception_handlers.S:198: undefined reference to `__zero_table_start__'
C:/diasemi/smartsnippetsstudio2.0.8/sdk_10.0.6.88/sdk/bsp/startup/da1469x/gcc/exception_handlers.s:199:未定义引用`__zero_table_end__'
./startup/da1469x/init_da1469x.o:in函数`systeminitpre':
C: / DiaSemi SmartSnippetsStudio2.0.8 / SDK_10.0.6.88 /sdk/bsp/startup/DA1469x/init_da1469x.c:506: undefined reference to `__copy_table_start__'
C: / DiaSemi SmartSnippetsStudio2.0.8 / SDK_10.0.6.88 /sdk/bsp/startup/DA1469x/init_da1469x.c:506: undefined reference to `__copy_table_end__'
C: / DiaSemi SmartSnippetsStudio2.0.8 / SDK_10.0.6.88 /sdk/bsp/startup/DA1469x/init_da1469x.c:506: undefined reference to `__zero_table_start__'
C:/diasemi/smartsnippetsstudio2.0.8/sdk_10.0.6.88/sdk/bsp/startup/da1469x/init_da1469x.c:506:未定义引用“__zero_table_end__”
./sdk/ble/stack/da14690/src/arch_main.o: In function `cmac_update_power_ctrl_reg_values':
C: / DiaSemi SmartSnippetsStudio2.0.8 / SDK_10.0.6.88 /sdk/interfaces/ble/stack/da14690/src/arch_main.c:185: undefined reference to `cmac_dynamic_config_table_ptr'
./sdk/ble/stack/da14690/src/arch_main.o:in function`cmac_mem_ctrl_setup':
C:/diasemi/smartsnippetsstudio2.0.8/sdk_10.0.6.88/sdk/interfaces/ble/stack/da14690/src/arch_main.c:202:未定义的参考`cmi_fw_dst_addr'

sandeep.kelasangada
Offline
Last seen:6 months 3 weeks ago
Joined:2019-08-09 09:30
Hi,

Hi,

Can you guys reply to my query. The cpp file get compiled but there is a linker error. i have shown some of the errors.

have you guys tried conversion of C to C++ for any example code like ble_peripheral, bli_central

sandeep.kelasangada
Offline
Last seen:6 months 3 weeks ago
Joined:2019-08-09 09:30
Hi,

Hi,

目前我在链接器设置中进行了一些更改,并将库路径添加到链接器。链接错误减少。

currently i get only two linking error.

调用:GNU ARM Cross C ++链接器
./sdk/ble/stack/da14690/src/arch_main.o:in function`cmac_mem_ctrl_setup':
C:/diasemi/smartsnippetsstudio2.0.8/sdk_10.0.6.88/sdk/interfaces/ble/stack/da14690/src/arch_main.c:204:未定义的参考`cmi_fw_dst_addr'
C:/diasemi/smartsnippetsstudio2.0.8/sdk_10.0.6.88/sdk/interfaces/ple/stack/da14690/src/arch_main.c:204:未定义的参考`__cmi_section_end_eng__'
collect2.exe:错误:LD返回1个退出状态
make: *** [ble_peripheral.elf] Error 1

请告诉我们如何解决这个问题。

Danny_Vanderydt...
Offline
Last seen:7 months 4 days ago
Joined:2019-09-18 09:44
嗨Sandeep,你能够做到

嗨Sandeep,你是否能够在构建CPP应用程序时解决链接器问题?

我面临着同样的问题。编译工作是工作,但链接器缺少大量引用。

Could you please advise?

Thx!

JE_Dialog
Offline
Last seen:1 month 1 week ago
Staff
Joined:2013-12-05 14:02
Hi Danny, we will reach out

Hi Danny, we will reach out to you directly BR JE_dialog

JE_Dialog
Offline
Last seen:1 month 1 week ago
Staff
Joined:2013-12-05 14:02
嗨Sandeep,we are taking

嗨Sandeep,we are taking this offline onto direct communictaion. BR JE_Dialog .