Hello.
I am able to compile and run C hello world project (from new project template) on RT1064. However, C++ hello world project (from new project template) compiles and runs but there is no output on the console. I am connecting through jtag. Any ideas about working in C++ is highly appreciated.
Thanks
Azhar
已解决! 转到解答。
Check the SDK Debug Console settings - read the MCUXpresso User Manual for details. I think you have it set to use the UART instead of the console. If you want to guarantee that you are using the console, use printf instead of PRINTF.
Another note: You need to understand the difference between newlibnano and newlib wrt C++ - newlibnano (for example) does not support exceptions. This is again described in the User Manual.
Thanks converse for the response. According to this post : What are Redlib and Newlib? - NXP Community
Newlib is c++ library. More instructions are at: Switching the selected C library - NXP Community
In the linker settings, I tried both Newlib(semihost) and NewlibNano(semihost) but the result is the same no output on the console. Let me know if something else needed to be changed?
Export and post your project here. There are several settings to do with where output is placed. However, C++ I/O is very memory hungry, so may not be suitable to use in an embedded environment anyway.
btw: what is you chip/board?
Device is RT1064.
Here are the exported project settings... (xml is not supported for attachment here, so I paste it below)
<?xml version="1.0" encoding="UTF-8"?>
<cdtprojectproperties>
<section name="org.eclipse.cdt.internal.ui.wizards.settingswizards.IncludePaths">
<language name="C++ Source File">
<includepath workspace_path="true">/${ProjName}/board</includepath>
<includepath workspace_path="true">/${ProjName}/source</includepath>
<includepath workspace_path="true">/${ProjName}/drivers</includepath>
<includepath workspace_path="true">/${ProjName}/xip</includepath>
<includepath workspace_path="true">/${ProjName}/component/serial_manager</includepath>
<includepath workspace_path="true">/${ProjName}/component/uart</includepath>
<includepath workspace_path="true">/${ProjName}/utilities</includepath>
<includepath workspace_path="true">/${ProjName}/component/lists</includepath>
<includepath workspace_path="true">/${ProjName}/CMSIS</includepath>
<includepath workspace_path="true">/${ProjName}/device</includepath>
</language>
<language name="C Source File">
<includepath workspace_path="true">/${ProjName}/board</includepath>
<includepath workspace_path="true">/${ProjName}/source</includepath>
<includepath workspace_path="true">/${ProjName}/drivers</includepath>
<includepath workspace_path="true">/${ProjName}/xip</includepath>
<includepath workspace_path="true">/${ProjName}/component/serial_manager</includepath>
<includepath workspace_path="true">/${ProjName}/component/uart</includepath>
<includepath workspace_path="true">/${ProjName}/utilities</includepath>
<includepath workspace_path="true">/${ProjName}/component/lists</includepath>
<includepath workspace_path="true">/${ProjName}/CMSIS</includepath>
<includepath workspace_path="true">/${ProjName}/device</includepath>
</language>
<language name="Assembly Source File">
<includepath workspace_path="true">/${ProjName}/board</includepath>
<includepath workspace_path="true">/${ProjName}/source</includepath>
</language>
<language name="Additional Assembly Source Files">
<includepath workspace_path="true">/${ProjName}/board</includepath>
<includepath workspace_path="true">/${ProjName}/source</includepath>
</language>
<language name="Object File">
</language>
</section>
<section name="org.eclipse.cdt.internal.ui.wizards.settingswizards.Macros">
<language name="C++ Source File">
<macro>
<name>CPU_MIMXRT1064DVL6A</name><value/>
</macro>
<macro>
<name>CPU_MIMXRT1064DVL6A_cm7</name><value/>
</macro>
<macro>
<name>FSL_RTOS_BM</name><value/>
</macro>
<macro>
<name>SDK_OS_BAREMETAL</name><value/>
</macro>
<macro>
<name>XIP_EXTERNAL_FLASH</name><value>1</value>
</macro>
<macro>
<name>XIP_BOOT_HEADER_ENABLE</name><value>1</value>
</macro>
<macro>
<name>SERIAL_PORT_TYPE_UART</name><value>1</value>
</macro>
<macro>
<name>SDK_DEBUGCONSOLE</name><value>0</value>
</macro>
<macro>
<name>__MCUXPRESSO</name><value/>
</macro>
<macro>
<name>__USE_CMSIS</name><value/>
</macro>
<macro>
<name>DEBUG</name><value/>
</macro>
<macro>
<name>__NEWLIB__</name><value/>
</macro>
</language>
<language name="C Source File">
<macro>
<name>__NEWLIB__</name><value/>
</macro>
<macro>
<name>CPU_MIMXRT1064DVL6A</name><value/>
</macro>
<macro>
<name>CPU_MIMXRT1064DVL6A_cm7</name><value/>
</macro>
<macro>
<name>FSL_RTOS_BM</name><value/>
</macro>
<macro>
<name>SDK_OS_BAREMETAL</name><value/>
</macro>
<macro>
<name>XIP_EXTERNAL_FLASH</name><value>1</value>
</macro>
<macro>
<name>XIP_BOOT_HEADER_ENABLE</name><value>1</value>
</macro>
<macro>
<name>SERIAL_PORT_TYPE_UART</name><value>1</value>
</macro>
<macro>
<name>SDK_DEBUGCONSOLE</name><value>0</value>
</macro>
<macro>
<name>__MCUXPRESSO</name><value/>
</macro>
<macro>
<name>__USE_CMSIS</name><value/>
</macro>
<macro>
<name>DEBUG</name><value/>
</macro>
</language>
<language name="Assembly Source File">
</language>
<language name="Additional Assembly Source Files">
</language>
<language name="Object File">
</language>
</section>
</cdtprojectproperties>
Check the SDK Debug Console settings - read the MCUXpresso User Manual for details. I think you have it set to use the UART instead of the console. If you want to guarantee that you are using the console, use printf instead of PRINTF.
Another note: You need to understand the difference between newlibnano and newlib wrt C++ - newlibnano (for example) does not support exceptions. This is again described in the User Manual.
Thanks converse for the response. According to this post : What are Redlib and Newlib? - NXP Community
Newlib is c++ library. More instructions are at: Switching the selected C library - NXP Community
In the linker settings, I tried both Newlib(semihost) and NewlibNano(semihost) but the result is the same no output on the console. Let me know if something else needed to be changed?