kendryte / kendryte-gnu-toolchain

Kendryte GNU Toolchain
Other
74 stars 25 forks source link

Help compiling a C++ hello world for the K210 #13

Open antoinecarme opened 11 months ago

antoinecarme commented 11 months ago

Hi,

An embedded newbie question ;)

I am trying to build a small C++ standalone app for the Kendryte k210 using the provided toolchain.

The build seems to work, but nothing on the USB serial port after flashing (kflash.py).

The same happens with a hello world app. I reduced the code to a minimal non-working case here :

https://gist.github.com/antoinecarme/636bcfdca343269f2026764e3cd25788

The command lines I use are (tried so many):

/opt/kendryte-toolchain/bin/riscv64-unknown-elf-g++ -ffunction-sections -fdata-sections -Wl,--gc-sections  -static -static-libstdc++ -Wall -mcmodel=medany -D_GLIBCXX_USE_WCHAR_T -D_GLIBCXX_USE_C99_STDLIB -D_GLIBCXX_USE_C99_STDIO -v -std=gnu++17 -T kendryte.ld -I. -lnosys  -o hello_world hello_world.cpp

/opt/kendryte-toolchain/bin/riscv64-unknown-elf-objcopy --output-format=binary hello_world hello_world.bin

Did I miss a step ? Your help is very welcome.

Thanks in advance.

Antoine