i use gcc 10.2, don't have ewl_c9x, how i can enable printf with uart port
i see there is link:
use below configure,
Hi @alice_th,
You can use NewLib/NewLib Nano with Debugger Console I/O support with GCC 10.2:
or downgrade the toolchain version (6.3) and use EWL:
Best regards,
Julián
how to modify it when the project already created ?
BTW, if use GCC 10.2, we need still add uart driver code ?
like below code ?
but there is error , fatal error: ewl_misra_types.h: No such file or directory
Hi @alice_th,
No, that driver is for EWL console support.
I believe some changes are needed if you want to change an existing project's toolchain, such as the included paths in project settings, but I would suggest creating an application project and porting the application code to the new project.
Best regards,
Julián
if still use gcc 10.2, do you steps to add printf with console, is it only need configure,
is there any other code we need add ? can you show the full steps with gcc 10.2 console printf ?
Hi @alice_th,
You can refer to the following post: Solved: how to use the printf function in S32DS.3.5 ? - NXP Community
Best regards,
Julián
i want use the real uart print with terminal, you link only work with semihosting console.
i already add this code, but no print on my terminal, please check , thanks!
int _write(int file, char *ptr, int len)
{
uint32_t bytesRemain;
size_t bytes=len;
unsigned char ret_car[]={"\r"};
LPUART_DRV_SendData(INST_LPUART1, ptr, bytes);
while(LPUART_DRV_GetTransmitStatus(INST_LPUART1, &bytesRemain) != STATUS_SUCCESS);
LPUART_DRV_SendData(INST_LPUART1, ret_car, 1);
while(LPUART_DRV_GetTransmitStatus(INST_LPUART1, &bytesRemain) != STATUS_SUCCESS);
return len;
}
Hi @alice_th,
You can use the example you posted. This example was designed for an older SDK, which can be flashed in S32DS.2018.R1 or you can create a new project (selecting GCC 6.3 compiler and EWL library) and copy over the configuration from the original post:
I've shared the ported project for S32DS3.5 RTD3.0.0.
Best regards,
Julián
if switch gcc , there will some error below, could you help to check
Building target: lpi2c_master_s32k144.elf
Invoking: Standard S32DS C Linker
arm-none-eabi-gcc -o "lpi2c_master_s32k144.elf" "@lpi2c_master_s32k144.args"
c:/nxp/s32ds.3.5/s32ds/build_tools/gcc_v10.2/gcc-10.2-arm32-eabi/bin/../lib/gcc/arm-none-eabi/10.2.0/../../../../arm-none-eabi/bin/real-ld.exe: ./SDK/platform/drivers/src/interrupt/interrupt_manager.o: in function `INT_SYS_InstallHandler':
C:/NXP/S32DS.3.5/S32DS/software/S32SDK_S32K1XX_RTM_4.0.1/platform/drivers/src/interrupt/interrupt_manager.c:175: undefined reference to `__VECTOR_RAM'
c:/nxp/s32ds.3.5/s32ds/build_tools/gcc_v10.2/gcc-10.2-arm32-eabi/bin/../lib/gcc/arm-none-eabi/10.2.0/../../../../arm-none-eabi/bin/real-ld.exe: C:/NXP/S32DS.3.5/S32DS/software/S32SDK_S32K1XX_RTM_4.0.1/platform/drivers/src/interrupt/interrupt_manager.c:175: undefined reference to `__VECTOR_TABLE'
c:/nxp/s32ds.3.5/s32ds/build_tools/gcc_v10.2/gcc-10.2-arm32-eabi/bin/../lib/gcc/arm-none-eabi/10.2.0/../../../../arm-none-eabi/bin/real-ld.exe: C:/NXP/S32DS.3.5/S32DS/software/S32SDK_S32K1XX_RTM_4.0.1/platform/drivers/src/interrupt/interrupt_manager.c:175: undefined reference to `__DATA_ROM'
c:/nxp/s32ds.3.5/s32ds/build_tools/gcc_v10.2/gcc-10.2-arm32-eabi/bin/../lib/gcc/arm-none-eabi/10.2.0/../../../../arm-none-eabi/bin/real-ld.exe: C:/NXP/S32DS.3.5/S32DS/software/S32SDK_S32K1XX_RTM_4.0.1/platform/drivers/src/interrupt/interrupt_manager.c:175: undefined reference to `__DATA_END'
collect2.exe: error: ld returned 1 exit status
make: *** [makefile:46: lpi2c_master_s32k144.elf] Error 1
"make -j8 all" terminated with exit code 2. Build might be incomplete.
11:19:43 Build Failed. 5 errors, 0 warnings. (took 28s.674ms)
if switch the gcc tool, then rebuild project, always have these error, what is the problem ?
Building target: lpi2c_master_s32k144.elf
Invoking: Standard S32DS C Linker
arm-none-eabi-gcc -o "lpi2c_master_s32k144.elf" "@lpi2c_master_s32k144.args"
c:/nxp/s32ds.3.5/s32ds/build_tools/gcc_v10.2/gcc-10.2-arm32-eabi/bin/../lib/gcc/arm-none-eabi/10.2.0/../../../../arm-none-eabi/bin/real-ld.exe: error: lpi2c_master_s32k144.elf uses VFP register arguments, ./board/clock_config.o does not
c:/nxp/s32ds.3.5/s32ds/build_tools/gcc_v10.2/gcc-10.2-arm32-eabi/bin/../lib/gcc/arm-none-eabi/10.2.0/../../../../arm-none-eabi/bin/real-ld.exe: failed to merge target specific data of file ./board/clock_config.o
c:/nxp/s32ds.3.5/s32ds/build_tools/gcc_v10.2/gcc-10.2-arm32-eabi/bin/../lib/gcc/arm-none-eabi/10.2.0/../../../../arm-none-eabi/bin/real-ld.exe: error: lpi2c_master_s32k144.elf uses VFP register arguments, ./board/peripherals_edma_config_1.o does not
c:/nxp/s32ds.3.5/s32ds/build_tools/gcc_v10.2/gcc-10.2-arm32-eabi/bin/../lib/gcc/arm-none-eabi/10.2.0/../../../../arm-none-eabi/bin/real-ld.exe: failed to merge target specific data of file ./board/peripherals_edma_config_1.o
c:/nxp/s32ds.3.5/s32ds/build_tools/gcc_v10.2/gcc-10.2-arm32-eabi/bin/../lib/gcc/arm-none-eabi/10.2.0/../../../../arm-none-eabi/bin/real-ld.exe: error: lpi2c_master_s32k144.elf uses VFP register arguments, ./board/peripherals_lpi2c_config_1.o does not
c:/nxp/s32ds.3.5/s32ds/build_tools/gcc_v10.2/gcc-10.2-arm32-eabi/bin/../lib/gcc/arm-none-eabi/10.2.0/../../../../arm-none-eabi/bin/real-ld.exe: failed to merge target specific data of file ./board/peripherals_lpi2c_config_1.o
c:/nxp/s32ds.3.5/s32ds/build_tools/gcc_v10.2/gcc-10.2-arm32-eabi/bin/../lib/gcc/arm-none-eabi/10.2.0/../../../../arm-none-eabi/bin/real-ld.exe: error: lpi2c_master_s32k144.elf uses VFP register arguments, ./board/peripherals_lpuart_1.o does not
c:/nxp/s32ds.3.5/s32ds/build_tools/gcc_v10.2/gcc-10.2-arm32-eabi/bin/../lib/gcc/arm-none-eabi/10.2.0/../../../../arm-none-eabi/bin/real-ld.exe: failed to merge target specific data of file ./board/peripherals_lpuart_1.o
c:/nxp/s32ds.3.5/s32ds/build_tools/gcc_v10.2/gcc-10.2-arm32-eabi/bin/../lib/gcc/arm-none-eabi/10.2.0/../../../../arm-none-eabi/bin/real-ld.exe: error: lpi2c_master_s32k144.elf uses VFP register arguments, ./board/peripherals_osif_1.o does not
c:/nxp/s32ds.3.5/s32ds/build_tools/gcc_v10.2/gcc-10.2-arm32-eabi/bin/../lib/gcc/arm-none-eabi/10.2.0/../../../../arm-none-eabi/bin/real-ld.exe: failed to merge target specific data of file ./board/peripherals_osif_1.o
c:/nxp/s32ds.3.5/s32ds/build_tools/gcc_v10.2/gcc-10.2-arm32-eabi/bin/../lib/gcc/arm-none-eabi/10.2.0/../../../../arm-none-eabi/bin/real-ld.exe: error: lpi2c_master_s32k144.elf uses VFP register arguments, ./board/pin_mux.o does not
c:/nxp/s32ds.3.5/s32ds/build_tools/gcc_v10.2/gcc-10.2-arm32-eabi/bin/../lib/gcc/arm-none-eabi/10.2.0/../../../../arm-none-eabi/bin/real-ld.exe: failed to merge target specific data of file ./board/pin_mux.o
c:/nxp/s32ds.3.5/s32ds/build_tools/gcc_v10.2/gcc-10.2-arm32-eabi/bin/../lib/gcc/arm-none-eabi/10.2.0/../../../../arm-none-eabi/bin/real-ld.exe: error: lpi2c_master_s32k144.elf uses VFP register arguments, ./src/SFH5721.o does not
c:/nxp/s32ds.3.5/s32ds/build_tools/gcc_v10.2/gcc-10.2-arm32-eabi/bin/../lib/gcc/arm-none-eabi/10.2.0/../../../../arm-none-eabi/bin/real-ld.exe: failed to merge target specific data of file ./src/SFH5721.o
c:/nxp/s32ds.3.5/s32ds/build_tools/gcc_v10.2/gcc-10.2-arm32-eabi/bin/../lib/gcc/arm-none-eabi/10.2.0/../../../../arm-none-eabi/bin/real-ld.exe: error: lpi2c_master_s32k144.elf uses VFP register arguments, ./src/console.o does not
c:/nxp/s32ds.3.5/s32ds/build_tools/gcc_v10.2/gcc-10.2-arm32-eabi/bin/../lib/gcc/arm-none-eabi/10.2.0/../../../../arm-none-eabi/bin/real-ld.exe: failed to merge target specific data of file ./src/console.o
c:/nxp/s32ds.3.5/s32ds/build_tools/gcc_v10.2/gcc-10.2-arm32-eabi/bin/../lib/gcc/arm-none-eabi/10.2.0/../../../../arm-none-eabi/bin/real-ld.exe: error: lpi2c_master_s32k144.elf uses VFP register arguments, ./src/main.o does not
c:/nxp/s32ds.3.5/s32ds/build_tools/gcc_v10.2/gcc-10.2-arm32-eabi/bin/../lib/gcc/arm-none-eabi/10.2.0/../../../../arm-none-eabi/bin/real-ld.exe: failed to merge target specific data of file ./src/main.o
c:/nxp/s32ds.3.5/s32ds/build_tools/gcc_v10.2/gcc-10.2-arm32-eabi/bin/../lib/gcc/arm-none-eabi/10.2.0/../../../../arm-none-eabi/bin/real-ld.exe: ./SDK/platform/drivers/src/interrupt/interrupt_manager.o: in function `INT_SYS_InstallHandler':
C:/NXP/S32DS.3.5/S32DS/software/S32SDK_S32K1XX_RTM_4.0.1/platform/drivers/src/interrupt/interrupt_manager.c:175: undefined reference to `__VECTOR_RAM'
c:/nxp/s32ds.3.5/s32ds/build_tools/gcc_v10.2/gcc-10.2-arm32-eabi/bin/../lib/gcc/arm-none-eabi/10.2.0/../../../../arm-none-eabi/bin/real-ld.exe: C:/NXP/S32DS.3.5/S32DS/software/S32SDK_S32K1XX_RTM_4.0.1/platform/drivers/src/interrupt/interrupt_manager.c:175: undefined reference to `__VECTOR_TABLE'
c:/nxp/s32ds.3.5/s32ds/build_tools/gcc_v10.2/gcc-10.2-arm32-eabi/bin/../lib/gcc/arm-none-eabi/10.2.0/../../../../arm-none-eabi/bin/real-ld.exe: C:/NXP/S32DS.3.5/S32DS/software/S32SDK_S32K1XX_RTM_4.0.1/platform/drivers/src/interrupt/interrupt_manager.c:175: undefined reference to `__DATA_ROM'
c:/nxp/s32ds.3.5/s32ds/build_tools/gcc_v10.2/gcc-10.2-arm32-eabi/bin/../lib/gcc/arm-none-eabi/10.2.0/../../../../arm-none-eabi/bin/real-ld.exe: C:/NXP/S32DS.3.5/S32DS/software/S32SDK_S32K1XX_RTM_4.0.1/platform/drivers/src/interrupt/interrupt_manager.c:175: undefined reference to `__DATA_END'
collect2.exe: error: ld returned 1 exit status
make: *** [makefile:46: lpi2c_master_s32k144.elf] Error 1
"make -j8 all" terminated with exit code 2. Build might be incomplete.
10:22:32 Build Failed. 5 errors, 0 warnings. (took 19s.142ms)
then i switch back to gcc 6.3, then still have these error(),
Building target: lpi2c_master_s32k144.elf
Invoking: Standard S32DS C Linker
arm-none-eabi-gcc -o "lpi2c_master_s32k144.elf" "@lpi2c_master_s32k144.args"
c:/nxp/s32ds.3.5/s32ds/build_tools/gcc_b1620/gcc-6.3-arm32-eabi/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/bin/real-ld.exe: C:/NXP/S32DS.3.5/S32DS/build_tools/gcc_b1620/arm32_ewl2/lib/thumb/v7e-m/fpv4-sp/hard/__arm_start.o: in function `__thumb_startup':
arm32_ewl2/EWL_Runtime/src/arm/__arm_start.c:282: undefined reference to `__START_BSS'
c:/nxp/s32ds.3.5/s32ds/build_tools/gcc_b1620/gcc-6.3-arm32-eabi/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/bin/real-ld.exe: arm32_ewl2/EWL_Runtime/src/arm/__arm_start.c:282: undefined reference to `__END_BSS'
c:/nxp/s32ds.3.5/s32ds/build_tools/gcc_b1620/gcc-6.3-arm32-eabi/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/bin/real-ld.exe: ./SDK/platform/drivers/src/interrupt/interrupt_manager.o: in function `INT_SYS_InstallHandler':
C:/NXP/S32DS.3.5/S32DS/software/S32SDK_S32K1XX_RTM_4.0.1/platform/drivers/src/interrupt/interrupt_manager.c:175: undefined reference to `__VECTOR_RAM'
c:/nxp/s32ds.3.5/s32ds/build_tools/gcc_b1620/gcc-6.3-arm32-eabi/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/bin/real-ld.exe: C:/NXP/S32DS.3.5/S32DS/software/S32SDK_S32K1XX_RTM_4.0.1/platform/drivers/src/interrupt/interrupt_manager.c:175: undefined reference to `__VECTOR_TABLE'
c:/nxp/s32ds.3.5/s32ds/build_tools/gcc_b1620/gcc-6.3-arm32-eabi/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/bin/real-ld.exe: C:/NXP/S32DS.3.5/S32DS/software/S32SDK_S32K1XX_RTM_4.0.1/platform/drivers/src/interrupt/interrupt_manager.c:175: undefined reference to `__DATA_ROM'
c:/nxp/s32ds.3.5/s32ds/build_tools/gcc_b1620/gcc-6.3-arm32-eabi/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/bin/real-ld.exe: C:/NXP/S32DS.3.5/S32DS/software/S32SDK_S32K1XX_RTM_4.0.1/platform/drivers/src/interrupt/interrupt_manager.c:175: undefined reference to `__DATA_END'
c:/nxp/s32ds.3.5/s32ds/build_tools/gcc_b1620/gcc-6.3-arm32-eabi/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/bin/real-ld.exe: C:/NXP/S32DS.3.5/S32DS/build_tools/gcc_b1620/arm32_ewl2/lib/thumb/v7e-m/fpv4-sp/hard\librt.a(__arm_eabi_init.o): in function `__init_registers':
arm32_ewl2/EWL_Runtime/src/arm/__arm_eabi_init.c:102: undefined reference to `__SP_INIT'
collect2.exe: error: ld returned 1 exit status
make: *** [makefile:43: lpi2c_master_s32k144.elf] Error 1
"make -j8 all" terminated with exit code 2. Build might be incomplete.
10:27:00 Build Failed. 8 errors, 0 warnings. (took 26s.737ms)
i use this example to test, lpi2c_master_s32k144