Hi All,
I'm working on importing a project and converting it to a C++ project. I did this by creating a new project and then using the "Convert to a C/C++ Project" option. I've tried this on several projects and I always get the same error. It is:
make: *** No rule to make target '{WorkSpaceDir}/CPPTest/Project_Settings/Linker_Files/S32K312_flash.ld', needed by 'CPPTest.elf'. Stop.
I've tried adjusting file paths and build paths but I can't seem to sort out the problem. Is there a specific thing I need to change in the build variables.
Cheers,
Sam
Hi @sam-azak,
Unfortunately, the RTD packages are not compatible with C++. S32DS is not determined for creating generic C/C++ project. S32DS is determined for projects related to specific microcontroller with the required SDK/RTD (S32DS Project > select appropriate microcontroller).
The option for a C++ project is available only because S32DS is based on Eclipse, so it is not recommended creating project this way in S32DS at all.
There are some workarounds, (like you mentioned, converting the project to C++ after importing the RTD package) but the functionality is not guaranteed, you can see some discussions about the topic below:
Hi @Julián_AragónM,
I appreciate the response! I actually got a little further and no longer am getting the same error. This was by following the tutorial on the Eclipse forum that you shared. I think I just needed to change the startup code to be a cpp file.
I'm a little confused when you say the RTD packages are not compatible with C++. In all of the RTD header files in my project, there is linkage to C when compiling a C++ application. They all have the following:
#ifdef __cplusplus
extern "C"{
#endif
////// File Code
#ifdef __cplusplus
}
#endif
With some of the other controllers I've used, the driver code uses similar linkage and I've always assumed that this is how the library are compatible with C. And at this point, I'm actually able to build the code without and errors or warnings!
However, when I try run the code with the debugger, I'm getting a new error. The debugging session starts, and then there seems to be errors with the Disassembly process. In the Disassemble window in S32DS, it shows:
fffffff6: movs r0, r0
fffffff8: movs r0, r0
fffffffa: movs r0, r0
fffffffc: movs r0, r0
fffffffe: movs r0, r0
100000000: Unable to retrieve disassembly data from backend.
100000001: Unable to retrieve disassembly data from backend.
100000002: Unable to retrieve disassembly data from backend.
100000003: Unable to retrieve disassembly data from backend.
100000004: Unable to retrieve disassembly data from backend.
100000005: Unable to retrieve disassembly data from backend.
100000006: Unable to retrieve disassembly data from backend.
100000007: Unable to retrieve disassembly data from backend.
Where as when I compile the same project in C the memory seems to be filling in a little more as I would expect:
569 ldr r3, =ITCM_DECOUPLE_END
20400210: strh r0, [r0, #0]
20400212: movs r0, r0
584 ldr r0, =RESET_CATCH_CORE
20400214: strb r0, [r6, r5]
20400216: movs r0, #64 @ 0x40
597 ldr r0, =__Stack_dtcm_start
20400218: movs r0, r0
2040021a: movs r0, #1
731 ldr r0, =MSCM_CPXNUM
2040021c: movs r4, r0
2040021e: ands r6, r4
747 ldr r1, =__RAM_INTERRUPT_START
20400220: movs r0, r0
20400222: movs r0, #0
66 {
main:
20400224: push {r3, lr}
68 Clock_Ip_Init(clockConfig);
20400226: ldr r0, [pc, #40] @ (0x20400250 <main+44>)
79 if (1U == toggleLed)
20400228: ldr r4, [pc, #40] @ (0x20400254 <main+48>)
68 Clock_Ip_Init(clockConfig);
2040022a: bl 0x20400ea8 <Clock_Ip_Init>
81 Siul2_Dio_Ip_TogglePins(LED_PORT, (1UL << LED_PIN));
2040022e: ldr r5, [pc, #40] @ (0x20400258 <main+52>)
70 Siul2_Port_Ip_Init(NUM_OF_CONFIGURED_PINS_PortContainer_0_BOARD_InitPeripherals,g_pin_mux_InitConfigArr_PortContainer_0_BOARD_InitPeripherals);
20400230: movs r0, #1
Do you know why I would be having these errors when trying to run the project in C++? My hunch has to do with the linker files, but I've never needed to modify these before.
Thanks,
Sam
Hi @sam-azak,
Have you tried to configure the linker file after converting the project?
Navigate to C/C++ Build > Settings.
Under Tool Settings, find the C++ Linker section.
Add any necessary libraries and paths in the Libraries and Library search path sections.
You can also try to add the linker file manually, as shown in this post: Solved: C/C++ S32DS Project - NXP Community.
That said, C++ implementation is unfortunately out of this community's scope of support.
Best regards,
Julián