Hey thx for your answer. This was indeed helpful :smileyhappy:.
I did setup an USB sample project.
I event did manage to convert this project to c++ using this instruction
Convert project to C++
However Linking fails with various undefined references
c:/nxp/mcuxpressoide_11.0.0_2516/ide/plugins/com.nxp.mcuxpresso.tools.win32_11.0.0.201905131304/tools/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: warning: cannot find entry symbol _start; defaulting to 00008000
undefined reference to `memset'
undefined reference to `__data_section_table'
and so on
If i remove the -nostandardlib flag from the linker options the error messages go down to a few
make -r -j8 all
Building target: frdmk64f_host_hid_mouse_keyboard_freertos.axf
Invoking: MCU C++ Linker
arm-none-eabi-g++ -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -o
c:/nxp/mcuxpressoide_11.0.0_2516/ide/plugins/com.nxp.mcuxpresso.tools.win32_11.0.0.201905131304/tools/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: c:/nxp/mcuxpressoide_11.0.0_2516/ide/plugins/com.nxp.mcuxpresso.tools.win32_11.0.0.201905131304/tools/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard\libc.a(lib_a-exit.o): in function `exit':
exit.c:(.text.exit+0x16): undefined reference to `_exit'
c:/nxp/mcuxpressoide_11.0.0_2516/ide/plugins/com.nxp.mcuxpresso.tools.win32_11.0.0.201905131304/tools/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: ./startup/startup_mk64f12.o: in function `ResetISR':
C:\Users\heju\mcuxpresso\workspace\frdmk64f_host_hid_mouse_keyboard_freertos\Debug/../startup/startup_mk64f12.c:537: undefined reference to `__data_section_table'
c:/nxp/mcuxpressoide_11.0.0_2516/ide/plugins/com.nxp.mcuxpresso.tools.win32_11.0.0.201905131304/tools/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\heju\mcuxpresso\workspace\frdmk64f_host_hid_mouse_keyboard_freertos\Debug/../startup/startup_mk64f12.c:537: undefined reference to `__data_section_table_end'
c:/nxp/mcuxpressoide_11.0.0_2516/ide/plugins/com.nxp.mcuxpresso.tools.win32_11.0.0.201905131304/tools/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\heju\mcuxpresso\workspace\frdmk64f_host_hid_mouse_keyboard_freertos\Debug/../startup/startup_mk64f12.c:537: undefined reference to `__bss_section_table_end'
c:/nxp/mcuxpressoide_11.0.0_2516/ide/plugins/com.nxp.mcuxpresso.tools.win32_11.0.0.201905131304/tools/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: ./startup/startup_mk64f12.o:(.isr_vector+0x0): undefined reference to `_vStackTop'
c:/nxp/mcuxpressoide_11.0.0_2516/ide/plugins/com.nxp.mcuxpresso.tools.win32_11.0.0.201905131304/tools/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/bin/ld.exe: c:/nxp/mcuxpressoide_11.0.0_2516/ide/plugins/com.nxp.mcuxpresso.tools.win32_11.0.0.201905131304/tools/bin/../lib/gcc/arm-none-eabi/8.2.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard\libc.a(lib_a-sbrkr.o): in function `_sbrk_r':
sbrkr.c:(.text._sbrk_r+0xc): undefined reference to `_sbrk'
collect2.exe: error: ld returned 1 exit status
make: *** [makefile:60: frdmk64f_host_hid_mouse_keyboard_freertos.axf] Error 1
"make -r -j8 all" terminated with exit code 2. Build might be incomplete.
Is there any reason why nostlibs flag is used?
the data_section objects are declared extern in the startup script. But i couldn't find an actual definition of these objects? Where are they coming from?