Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DO NOT MERGE] NuttX cmake #46

Closed
wants to merge 1 commit into from
Closed

Conversation

dagar
Copy link
Member

@dagar dagar commented Jan 2, 2019

This is an effort to explore the possibility of using cmake natively in NuttX. There's still a huge amount of work to do, but so far it's quite promising.

To test make sure you have cmake installed (and ninja-build + ccache as a bonus).

sudo apt-get install cmake ninja-build ccache

Then simply call make NUTTX_CONFIG (eg make stm32f4discovery/nsh). It's no longer necessary to explicitly run configure first.

Example

 % make stm32f4discovery/nsh            
-- NuttX: stm32f4discovery/nsh
-- NuttX apps: /home/dagar/git/Firmware/platforms/nuttx/NuttX/apps
-- The ASM compiler identification is GNU
-- Found assembler: /opt/gcc-arm-none-eabi-7-2017-q4-major/bin/arm-none-eabi-gcc
-- The C compiler identification is GNU 7.2.1
-- The CXX compiler identification is GNU 7.2.1
-- Check for working C compiler: /opt/gcc-arm-none-eabi-7-2017-q4-major/bin/arm-none-eabi-gcc
-- Check for working C compiler: /opt/gcc-arm-none-eabi-7-2017-q4-major/bin/arm-none-eabi-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /opt/gcc-arm-none-eabi-7-2017-q4-major/bin/arm-none-eabi-g++
-- Check for working CXX compiler: /opt/gcc-arm-none-eabi-7-2017-q4-major/bin/arm-none-eabi-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- ccache enabled (export CCACHE_DISABLE=1 to disable)
-- Configuring done
-- Generating done
-- Build files have been written to: /home/dagar/git/Firmware/platforms/nuttx/NuttX/nuttx/build/stm32f4discovery/nsh
ninja: Entering directory `/home/dagar/git/Firmware/platforms/nuttx/NuttX/nuttx/build/stm32f4discovery/nsh'
[6/790] Performing configure step for 'nuttx_host_tools'
-- NuttX Host Tools
-- The C compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/lib/ccache/cc
-- Check for working C compiler: /usr/lib/ccache/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/dagar/git/Firmware/platforms/nuttx/NuttX/nuttx/build/stm32f4discovery/nsh/nuttx_host_tools-prefix/src/nuttx_host_tools-build
[6/790] Generating .config
#
# configuration written to .config
#
[7/790] Performing build step for 'nuttx_host_tools'
[6/6] Linking C executable mkconfig
[8/790] Performing install step for 'nuttx_host_tools'
[1/1] Install the project...
-- Install configuration: ""
-- Installing: /home/dagar/git/Firmware/platforms/nuttx/NuttX/nuttx/build/stm32f4discovery/nsh/bin/mkconfig
-- Installing: /home/dagar/git/Firmware/platforms/nuttx/NuttX/nuttx/build/stm32f4discovery/nsh/bin/mkversion
[790/790] Linking CXX executable nuttx


 % size build/stm32f4discovery/nsh/nuttx
   text    data     bss     dec     hex filename
  58019      94    2488   60601    ecb9 build/stm32f4discovery/nsh/nuttx

Why cmake?

  • portability
    • sane development across linux, windows, macos
  • tighter integration with other projects
    • allows a "NuttX app" project to include NuttX as a submodule and extend the build cleanly and safely
    • allows NuttX to easily integrate with other cmake projects (eg libcxx)
  • speed
    • out of tree builds
    • lighting fast incremental builds
    • working ccache
    • ninja
    • CI system that can build everything on every commit

TODO:

@dagar dagar requested review from acassis and davids5 January 2, 2019 17:43
@dagar dagar self-assigned this Jan 2, 2019
@dagar dagar force-pushed the pr-cmake branch 3 times, most recently from 42ed948 to d4e3f9e Compare January 25, 2019 14:41
@dagar dagar changed the base branch from master to px4_firmware_nuttx-7.29+ July 27, 2019 15:22
@dagar dagar force-pushed the pr-cmake branch 14 times, most recently from 237b010 to 7d8b94d Compare September 14, 2019 21:02
@dagar dagar force-pushed the pr-cmake branch 2 times, most recently from 9ee63eb to 1d9143f Compare September 15, 2019 02:01
@dagar dagar closed this Nov 30, 2019
PX4BuildBot pushed a commit that referenced this pull request Jan 7, 2020
* arch: fe310: Fix comments

* arch: fe310: Improve irq handling in fe310_serial.c

* arch: fe310: Fix initial interrupt status (mstatus)

Also, removed unnecessary up_enable_irq(FE310_IRQ_ECALLM)
@dagar dagar mentioned this pull request Apr 6, 2021
PX4BuildBot pushed a commit that referenced this pull request Oct 11, 2024
set CONFIG_PRIORITY_INHERITANCE=y
set CONFIG_SEM_PREALLOCHOLDERS=0 or CONFIG_SEM_PREALLOCHOLDERS=8

    #24 0x4dcab71 in __assert assert/lib_assert.c:37
    #25 0x4d6b0e9 in nxsem_destroyholder semaphore/sem_holder.c:602
    #26 0x4d80cf7 in nxsem_destroy semaphore/sem_destroy.c:80
    #27 0x4d80db9 in sem_destroy semaphore/sem_destroy.c:120
    #28 0x4dcb077 in nxmutex_destroy misc/lib_mutex.c:122
    #29 0x4dc6611 in pipecommon_freedev pipes/pipe_common.c:117
    #30 0x4dc7fdc in pipecommon_close pipes/pipe_common.c:397
    #31 0x4ed4f6d in file_close vfs/fs_close.c:78
    #32 0x6a91133 in local_free local/local_conn.c:184
    #33 0x6a92a9c in local_release local/local_release.c:129
    #34 0x6a91d1a in local_subref local/local_conn.c:271
    #35 0x6a75767 in local_close local/local_sockif.c:797
    #36 0x4e978f6 in psock_close socket/net_close.c:102
    #37 0x4eed1b9 in sock_file_close socket/socket.c:115
    #38 0x4ed4f6d in file_close vfs/fs_close.c:78
    #39 0x4ed1459 in nx_close_from_tcb inode/fs_files.c:754
    #40 0x4ed1501 in nx_close inode/fs_files.c:781
    #41 0x4ed154a in close inode/fs_files.c:819
    #42 0x6bcb9ce in property_get kvdb/client.c:307
    #43 0x6bcd465 in property_get_int32 kvdb/common.c:270
    #44 0x5106c9a in tz_offset_restore app/miwear_bluetooth.c:745
    #45 0x510893f in miwear_bluetooth_main app/miwear_bluetooth.c:1033
    #46 0x4dcf5c8 in nxtask_startup sched/task_startup.c:70
    #47 0x4d70873 in nxtask_start task/task_start.c:134
    #48 0x4e04a07 in pre_start sim/sim_initialstate.c:52

Signed-off-by: ligd <liguiding1@xiaomi.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant