Closed nimish closed 9 months ago
Yeah, I agree, @sakumisue could you provide example how to use SDK as external dependency and how to compile out-of-tree application code on top of SDK?
@Jatsekku Just copy helloworld out of sdk and modify BL_SDK_BASE will work.
The cmake/makefile mix of the repo makes it confusing to set up in an IDE. Is there a guide?
Alternatively I stripped out the custom CMake code here: https://github.com/nimish/bl616-tmpl but it's not as complete
Sorry sir, i need to say your project has many problems.
target_link_libraries(lhal PUBLIC
soc
phyrf
cherryusb)
Makefile is just used to run cmake cmd and modifiy some variables.
Like this, if you can write cmake project, i think you can know these comand, so where is mix?
build:Makefile
$(CMAKE) -S . -B build -G $(cmake_generator) $(cmake_definition)
$(MAKE) -C build -j8
$(MAKE) -C build combine
The cmake/makefile mix of the repo makes it confusing to set up in an IDE. Is there a guide? Alternatively I stripped out the custom CMake code here: https://github.com/nimish/bl616-tmpl but it's not as complete
Sorry sir, i need to say your project has many problems.
- When cmake builds done, your variables can not be modified, like COMX,
- When we use other chips, we need to modify cmake file, no, we don't allow that
- We don't allow these codes, we should add automatically
target_link_libraries(lhal PUBLIC soc phyrf cherryusb)
- If we use cmake to build, it will be too much config to set, we don't allow that
- and many other problems i do not want to say, so i suggest you remove your project and do not have such idea.
In general, I would like to know if there is a way to get a template project set up in CLion or VSCode using the existing makefiles and CMake.
The bl616-tmpl was my personal reorganization for the hw I use that integrates with the IDE and is simply an example. It supports incremental and parallel building along with IDE cmake integration so it is faster to iterate. The price of that is the explicit dependency handling. It is not something that the SDK itself should adopt without significant extra development.
I am using Bouffalo SDK with my project through CLion, and it works perfectly.
This is how I have it configured:
(NOTE: There are no Bouffalo SDK changes)
CMake Options: -G "Unix Makefiles" -DCROSS_COMPILE=/home/gamiee/Desktop/tools/toolchain_gcc_t-head_linux/bin/riscv64-unknown-elf- -DCHIP=bl616 -DCPU_ID= -DBOARD=bl616dk -DBOARD_DIR= -DCONFIG_DEBUG=y -DCONFIG_ROMAPI=y -DCONFIG_USB_HS=y -DCONFIG_COMX=COM5 -DCMAKE_EXPORT_COMPILE_COMMANDS=OFF -DCONFIG_TLSF=y
Environment: BL_SDK_BASE=/home/gamiee/Desktop/tools/bouffalo_sdk
My CMakeLists.txt:
As @sakumisu mentioned, there is no need for using Make files, everything can be easily used through CMake, with CLion or VS Code CMake integration.
I was even able to make auto-upload by Run command with terminal. If there will be interest, I can create sample CMake project with CLion configuration stored here.
I am using Bouffalo SDK with my project through CLion, and it works perfectly. This is how I have it configured: (NOTE: There are no Bouffalo SDK changes) CMake Options:
-G "Unix Makefiles" -DCROSS_COMPILE=/home/gamiee/Desktop/tools/toolchain_gcc_t-head_linux/bin/riscv64-unknown-elf- -DCHIP=bl616 -DCPU_ID= -DBOARD=bl616dk -DBOARD_DIR= -DCONFIG_DEBUG=y -DCONFIG_ROMAPI=y -DCONFIG_USB_HS=y -DCONFIG_COMX=COM5 -DCMAKE_EXPORT_COMPILE_COMMANDS=OFF -DCONFIG_TLSF=y
Environment:BL_SDK_BASE=/home/gamiee/Desktop/tools/bouffalo_sdk
My CMakeLists.txt:
As @sakumisu mentioned, there is no need for using Make files, everything can be easily used through CMake, with CLion or VS Code CMake integration.
I was even able to make auto-upload by Run command with terminal. If there will be interest, I can create sample CMake project with CLion configuration stored here.
Right, copy cmake comand from makefile into clion, so makefile is unuseful, just make command length lesss for user.
Great, thanks. I think this covers what I wanted. Perhaps this could be added to the README as well?
The cmake/makefile mix of the repo makes it confusing to set up in an IDE. Is there a guide?
Alternatively I stripped out the custom CMake code here: https://github.com/nimish/bl616-tmpl but it's not as complete