GithubHelp home page GithubHelp logo

cmake-nrf5x's People

Contributors

borys-jelenski-polidea avatar borysjelenski avatar cierpliwy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cmake-nrf5x's Issues

Elf file

Can anyone lead me in the right direction of creating an elf file and setting up with Cortex-Debug for VS Code?

RTT viewer is not printing

Hello,

I am trying to use this framework and all is good, build files, flash, etc. Tho only problem is that I am trying to print something with RTT of Jlink and I can't see the output print. could you help me with this?

this is my src file:

#include <stdbool.h>
#include <stdint.h>
#include "nrf_delay.h"
#include "bsp.h"
#include "nrf.h"
#include "system_nrf52.h"
#include "nrf_delay.h"
#include "sdk_config.h"

#define ENABLE_SWD 1

static const uint8_t leds_list[LEDS_NUMBER] = { 9, 7, LED_3, LED_4 };

int main(void)
{
    /* Configure LED-pins as outputs. */
    printf("yeah nene\n");
    LEDS_CONFIGURE(LEDS_MASK);
    while (true)
    {
        for (int i = 0; i < LEDS_NUMBER; i++)
        {
            LEDS_INVERT(1 << leds_list[i]);
            printf("testing print CMAKE\n");
            nrf_delay_ms(500);
        }
    }
}

Missing step : include("CMake_nRF5x.cmake") from CMakeLists.txt ?

Is this step missing from the tutorial in the readme?

Without it, I get:

CMake Error at CMakeLists.txt:13 (nRF5x_setup):
Unknown CMake command "nRF5x_setup".

when I run: cmake -H. -B"cmake-build" -G "Unix Makefiles"

although I think I followed your tutorial closely.

Alternatively, can you link to a project that uses your cmake script? Or put a template CMakeLists.txt in your repository? That might help other CMake newbies like myself.

fails to link imported libraries

Redefinition of CMAKE_CXX_LINK_EXECUTABLE omits <LINK_LIBRARIES>. It should be:

set(CMAKE_CXX_LINK_EXECUTABLE "${CMAKE_C_COMPILER} <LINK_FLAGS> -lstdc++ -o <LINK_LIBRARIES>")

For example, without it, this fails with undefined references at link time:

add_library(bar STATIC IMPORTED)
set_target_properties( bar PROPERTIES IMPORTED_LOCATION /home/bootch/git/radioSoC/Debug52/bar.a )
nRF5x_addExecutable(foo main.cpp)
target_link_libraries( foo bar)

apparently cmake enacts that via <LINK_LIBRARIES>.

Also, what happens if the scripts don't redefine at all (and as you say, CMAKE_C_FLAGS are added implicitly)? I guess I should try it and see how CMAKE_C_FLAGS disrupt the link.

nrf5_drv_uart build failed

info: ci/examples/ble_peripheral/ble_app_blinky, SDK 16.0.0
command:

cmake . -D NRF5_SDK_PATH=/tmp/nRF5_SDK -D NRF5_TARGET=nrf52832 -D NRF5_SOFTDEVICE_VARIANT=s132 && make

[ 66%] Building C object CMakeFiles/nrf5_drv_uart.dir/tmp/nRF5_SDK/integration/nrfx/legacy/nrf_drv_uart.c.o
In file included from /tmp/nRF5_SDK/integration/nrfx/legacy/nrf_drv_uart.c:41:
/tmp/nRF5_SDK/integration/nrfx/legacy/nrf_drv_uart.h:122:13: error: unknown type name 'nrf_uarte_baudrate_t'
     typedef nrf_uarte_baudrate_t        nrf_uart_baudrate_t;
             ^~~~~~~~~~~~~~~~~~~~
/tmp/nRF5_SDK/integration/nrfx/legacy/nrf_drv_uart.h:127:13: error: unknown type name 'nrf_uarte_error_mask_t'
     typedef nrf_uarte_error_mask_t      nrf_uart_error_mask_t;
             ^~~~~~~~~~~~~~~~~~~~~~
/tmp/nRF5_SDK/integration/nrfx/legacy/nrf_drv_uart.h:130:13: error: unknown type name 'nrf_uarte_hwfc_t'
     typedef nrf_uarte_hwfc_t            nrf_uart_hwfc_t;
             ^~~~~~~~~~~~~~~~
/tmp/nRF5_SDK/integration/nrfx/legacy/nrf_drv_uart.h:133:13: error: unknown type name 'nrf_uarte_parity_t'
     typedef nrf_uarte_parity_t          nrf_uart_parity_t;
             ^~~~~~~~~~~~~~~~~~
/tmp/nRF5_SDK/integration/nrfx/legacy/nrf_drv_uart.h:134:13: error: unknown type name 'nrf_uarte_task_t'
     typedef nrf_uarte_task_t            nrf_uart_task_t;
             ^~~~~~~~~~~~~~~~
/tmp/nRF5_SDK/integration/nrfx/legacy/nrf_drv_uart.h:135:13: error: unknown type name 'nrf_uarte_event_t'
     typedef nrf_uarte_event_t           nrf_uart_event_t;
             ^~~~~~~~~~~~~~~~~
/tmp/nRF5_SDK/integration/nrfx/legacy/nrf_drv_uart.c: In function 'nrf_drv_uart_init':
/tmp/nRF5_SDK/integration/nrfx/legacy/nrf_drv_uart.c:124:27: warning: variable 'config' set but not used [-Wunused-but-set-variable]
     nrf_drv_uart_config_t config = *p_config;
                           ^~~~~~
make[2]: *** [CMakeFiles/nrf5_drv_uart.dir/build.make:82: CMakeFiles/nrf5_drv_uart.dir/tmp/nRF5_SDK/integration/nrfx/legacy/nrf_drv_uart.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1454: CMakeFiles/nrf5_drv_uart.dir/all] Error 2
make: *** [Makefile:103: all] Error 2

Add support for the nRF5 SDK 17.0.0

Library definitions and examples should be adapted if needed so they can be build with the version 17.0.0 of the nRF5 SDK. After this change, version 16.0.0 and 17.0.0 should be used for building on the CI.

Example is not working

I followed the example, it compiles, flashes both softdevice and firmware, but the Led1 that is supposed to be lit on the board is not and the ble is not broadcasting.

I also compiled the simple peripheral/blinky example and it also does not work.

Am I missing something?

Thank you

Cover all examples from the `peripheral` folder.

Examples to cover:

  • peripheral/blinky
  • peripheral/blinky_freertos
  • peripheral/blinky_rtc_freertos
  • peripheral/blinky_systick
  • peripheral/bsp
  • peripheral/cli
  • peripheral/cli_libuarte
  • peripheral/csense
  • peripheral/csense_drv
  • peripheral/fatfs
  • peripheral/flash_fds
  • peripheral/flash_fstorage
  • peripheral/flashwrite
  • peripheral/fpu_fft
  • peripheral/gfx
  • peripheral/gpiote
  • peripheral/i2s
  • peripheral/led_softblink
  • peripheral/libuarte
  • peripheral/low_power_pwm
  • peripheral/lpcomp
  • peripheral/nrfx_spim
  • peripheral/pin_change_int
  • peripheral/ppi
  • peripheral/preflash
  • peripheral/pwm_driver
  • peripheral/pwm_library
  • peripheral/pwr_mgmt
  • peripheral/qdec
  • peripheral/qspi
  • peripheral/qspi_bootloader
  • peripheral/radio_test
  • peripheral/radio/receiver
  • peripheral/radio/transmitter
  • peripheral/ram_retention
  • peripheral/rng
  • peripheral/rtc
  • peripheral/saadc
  • peripheral/serial
  • peripheral/serial_uartes
  • peripheral/simple_timer
  • peripheral/spi
  • peripheral/spi_master_using_nrf_spi_mngr
  • peripheral/spis
  • peripheral/temperature
  • peripheral/template_project
  • peripheral/timer
  • peripheral/twi_master_using_nrf_twi_mngr
  • peripheral/twi_master_with_twis_slave
  • peripheral/twi_scanner
  • peripheral/twi_sensor
  • peripheral/uart
  • peripheral/uicr_config
  • peripheral/usbd
  • peripheral/usbd_audio
  • peripheral/usbd_ble_uart
  • peripheral/usbd_ble_uart_freertos
  • peripheral/usbd_cdc_acm
  • peripheral/usbd_hid_composite
  • peripheral/usbd_hid_generic
  • peripheral/usbd_msc
  • peripheral/wdt

Add 'nrf5_bsp_defs' target with include dirs. only

There are examples in nRF5 SDK which rely on definitions found in bsp.h file however, they do not require the bsp.c to be compiled e.g. peripheral/uart. Actually, such examples do not contain the configuration required (in sdk_config.h) to compile the bsp.c. The problem is, when the nrf5_bsp target is linked in those examples, it cannot be built correctly.

The solution would be to create an interface target nrf5_bsp_defs containing only the include directory for the bsp.h file.

Correctly handle the 'flash_softdevice' custom target in 'blank' and 'mbr' configurations

If blank or mbr will be specified as NRF5_SD_VARIANT, running the flash_softdevice target after a successful configuration will result in the nrfjprog reporting an error. This is due to the local_sd_hex_file_path CMake variable which in case of blank and MBR variants will remain uninitialized (empty). This will result in composing of an incorrect command line for the nrfjprog.

Make "missing separator. Stop"

Hi,

There are some .cmake files that have some kind of indent problem. When you try to compile blinky example adding "nrf5_app_scheduler" as target link library (SDK 16) on Linux environment it throws the following error:
Scanning dependencies of target nrf5_mdk [100%] Building ASM object CMakeFiles/nrf5_mdk.dir/nRF5_SDK_16.0.0/modules/nrfx/mdk/gcc_startup_nrf52.S.obj [100%] Building C object CMakeFiles/nrf5_mdk.dir/nRF5_SDK_16.0.0/modules/nrfx/mdk/system_nrf52.c.obj [100%] Built target nrf5_mdk Scanning dependencies of target nrf5_boards [100%] Building C object CMakeFiles/nrf5_boards.dir/nRF5_SDK_16.0.0/components/boards/boards.c.obj [100%] Built target nrf5_boards Scanning dependencies of target nrf5_app_scheduler CMakeFiles/nrf5_app_scheduler.dir/depend.make:4: *** missing separator. Stop. make[1]: *** [CMakeFiles/Makefile2:5985: CMakeFiles/nrf5_app_scheduler.dir/all] Error 2 make: *** [Makefile:84: all] Error 2 stark@vm:~/workspace/cmake-nRF5x/build$

Afterwards, if you run again "make", it compiles. This error happens with many files of this project. I have idented all .cmake files but continues happening I do not know where is the problem.

Best regards

RTT viewer is not printing

Hello,

I am trying to use this framework and all is good, build files, flash, etc. Tho only problem is that I am trying to print something with RTT of Jlink and I can't see the output print. could you help me with this?

this is my src file:

#include <stdbool.h>
#include <stdint.h>
#include "nrf_delay.h"
#include "bsp.h"
#include "nrf.h"
#include "system_nrf52.h"
#include "nrf_delay.h"
#include "sdk_config.h"

#define ENABLE_SWD 1

static const uint8_t leds_list[LEDS_NUMBER] = { 9, 7, LED_3, LED_4 };

int main(void)
{
    /* Configure LED-pins as outputs. */
    printf("yeah nene\n");
    LEDS_CONFIGURE(LEDS_MASK);
    while (true)
    {
        for (int i = 0; i < LEDS_NUMBER; i++)
        {
            LEDS_INVERT(1 << leds_list[i]);
            printf("testing print CMAKE\n");
            nrf_delay_ms(500);
        }
    }
}

Detect if nrfjprog is a recognised command

Currently the code does not check whether or not nrfjprog is actually included in PATH. One way to check if to see if nrfjprog.exe is found using find_program()

There's also no gurantee that if a user defines a path for NRF5_NRFJPROG that it is a valid path.

if(NOT NRF5_NRFJPROG)
    # Check if nrfjprog command is recognised
    find_program(NRFJPROG "nrfjprog")
    if(NRFJPROG)
        set(NRF5_NRFJPROG "nrfjprog" CACHE FILEPATH "" FORCE)
        message(STATUS "Using nrfjprog utility available from PATH: ${NRF5_NRFJPROG}")
    else()
        message(FATAL_ERROR "Could no find nrfjprog utlity from PATH")
    endif()
else()
  message(STATUS "Using nrfjprog utility: ${NRF5_NRFJPROG}")
endif()

Introduce versioning

We need to come up with a strategy to introduce versioning shortly. Currently, a lot of names and features are unstable, and we should communicate than through versioning. I can see the following steps required to achieve it:

  • Define the versioning scheme in the README file.
  • Add changelog, when breaking changes are introduced.
  • Create release packs with bundled CMake files (should be a Github Action triggered by tags).

Incompatible with newer NRF SDK 14.2

It seems that Nordic restructured SDK directories and renamed some files, e.g. softdevice_handler.c is now called sdh.c ? And location of RTT files changed?

I don't expect anyone to fix this, just noting that users of the script might need to adjust for SDK versions other than 12.3 used by the script.

Cover all examples from the `ble_central` folder.

Examples to cover:

  • ble_central/ble_app_blinky_c
  • ble_central/ble_app_gatts
  • ble_central/ble_app_hrs_c
  • ble_central/ble_app_ias
  • ble_central/ble_app_ipsp_initiator
  • ble_central/ble_app_multilink_central
  • ble_central/ble_app_rscs_c
  • ble_central/ble_app_uart_c
  • ble_central/experimental/ble_app_hrs_nfc_c
  • ble_central/experimental/ble_app_ots_c
  • ble_central/experimental/ble_nfc_pairing_reference_c

gcc_startup_nrf5 error

hello,
I follow your code. and I am using the clion IDE on Mac OS . now I am getting this error.

CMakeFiles/Blinky.dir/Users/atifshabbir/Development/SDK/components/toolchain/gcc/gcc_startup_nrf51.S.o:9:157: warning: null character(s) ignored
CMakeFiles/Blinky.dir/Users/atifshabbir/Development/SDK/components/toolchain/gcc/gcc_startup_nrf51.S.o:9:169: warning: null character(s) ignored
CMakeFiles/Blinky.dir/Users/atifshabbir/Development/SDK/components/toolchain/gcc/gcc_startup_nrf51.S.o: Assembler messages:
CMakeFiles/Blinky.dir/Users/atifshabbir/Development/SDK/components/toolchain/gcc/gcc_startup_nrf51.S.o:1: Error: junk at end of line, first unrecognized character valued 0x7f
CMakeFiles/Blinky.dir/Users/atifshabbir/Development/SDK/components/toolchain/gcc/gcc_startup_nrf51.S.o:2: Error: junk at end of line, first unrecognized character valued 0x3
CMakeFiles/Blinky.dir/Users/atifshabbir/Development/SDK/components/toolchain/gcc/gcc_startup_nrf51.S.o:3: Error: bad instruction `h�h'
CMakeFiles/Blinky.dir/Users/atifshabbir/Development/SDK/components/toolchain/gcc/gcc_startup_nrf51.S.o:4: Error: bad instruction `c�` H�h'
CMakeFiles/Blinky.dir/Users/atifshabbir/Development/SDK/components/toolchain/gcc/gcc_startup_nrf51.S.o:5: Error: bad instruction `c�J K�����'
CMakeFiles/Blinky.dir/Users/atifshabbir/Development/SDK/components/toolchain/gcc/gcc_startup_nrf51.S.o:5: Error: bad instruction `�x�p����������$�'
CMakeFiles/Blinky.dir/Users/atifshabbir/Development/SDK/components/toolchain/gcc/gcc_startup_nrf51.S.o:6: Error: junk at end of line, first unrecognized character is `:'
CMakeFiles/Blinky.dir/Users/atifshabbir/Development/SDK/components/toolchain/gcc/gcc_startup_nrf51.S.o:7: Error: junk at end of line, first unrecognized character is `4'
CMakeFiles/Blinky.dir/Users/atifshabbir/Development/SDK/components/toolchain/gcc/gcc_startup_nrf51.S.o:8: Error: junk at end of line, first unrecognized character valued 0x1
CMakeFiles/Blinky.dir/Users/atifshabbir/Development/SDK/components/toolchain/gcc/gcc_startup_nrf51.S.o:9: Error: junk at end of line, first unrecognized character valued 0x7
make[3]: *** [Blinky.out] Error 1
make[2]: *** [CMakeFiles/Blinky.dir/all] Error 2
make[1]: *** [CMakeFiles/Blinky.dir/rule] Error 2
make: *** [Blinky] Error 2

in the start he give me lot of warning but I just copy last two warning which is the same as previous warning. after then some error regarding the gcc_startup_nrf5.

thank you

[FR] linker script database

in case user didn't provide linker a scripts, c-nRF can do smarter then now.
Based on this input:

  1. chip;
  2. SoftDevice;
  3. is this app or bootloader.

it can provide suitable linker script or generate it on the fly.

Support pca10100 board with SDK 16.0.0

In the nrf5_helpers.cmake file, the pca10100 seems to be the only board which does not support SDK 16. Is there any reason for this? Could it be a mistake?
If I change line 71 to the following:

  set(board_pca10100      nrf52833_xxaa BOARD_PCA10100 15.3.0 16.0.0)

I'm able to compile the blinky example just fine.

Has this gone stale?

I've noticed that there haven't been any commits in two years. Wanted to check if there are any plans to develop this further.

Thanks!

Cover all examples from the `ble_peripheral` folder.

Examples to cover:

  • ble_peripheral/ble_app_alert_notification
  • ble_peripheral/ble_app_ancs_c
  • ble_peripheral/ble_app_beacon
  • ble_peripheral/ble_app_blinky
  • ble_peripheral/ble_app_bms
  • ble_peripheral/ble_app_bps
  • ble_peripheral/ble_app_buttonless_dfu
  • ble_peripheral/ble_app_cscs
  • ble_peripheral/ble_app_cts_c
  • ble_peripheral/ble_app_eddystone
  • ble_peripheral/ble_app_gatts_c
  • ble_peripheral/ble_app_gls
  • ble_peripheral/ble_app_hids_keyboard
  • ble_peripheral/ble_app_hids_mouse
  • ble_peripheral/ble_app_hrs
  • ble_peripheral/ble_app_hrs_freertos
  • ble_peripheral/ble_app_hts
  • ble_peripheral/ble_app_ias_c
  • ble_peripheral/ble_app_ipsp_acceptor
  • ble_peripheral/ble_app_proximity
  • ble_peripheral/ble_app_pwr_profiling
  • ble_peripheral/ble_app_rscs
  • ble_peripheral/ble_app_template
  • ble_peripheral/ble_app_tile
  • ble_peripheral/ble_app_uart
  • ble_peripheral/experimental/ble_app_cgms
  • ble_peripheral/experimental/ble_app_cli
  • ble_peripheral/experimental/ble_app_hids_keyboard_pairing_nfc
  • ble_peripheral/experimental/ble_app_hrs_nfc_pairing
  • ble_peripheral/experimental/ble_app_lls
  • ble_peripheral/experimental/ble_app_lns
  • ble_peripheral/experimental/ble_app_multiperipheral
  • ble_peripheral/experimental/ble_app_ots
  • ble_peripheral/experimental/ble_app_queued_writes
  • ble_peripheral/experimental/ble_nfc_pairing_reference
  • ble_peripheral/experimental/bluetoothds_template

Supporting Thread and Zigbee SDK

Hello!

From that what I can see the Thread and Zigbee SDK has similar directory structure as the nRF SDK, but some of the components are missing and some of components are present only in the former.

The contributing guide explains how to support a new library to use within the "normal" SDK. Most probably to use another SDK some extra steps should be made or the existing steps should be made in another way. I could even try to contribute to support the Thread and Zigbee SDK, but I need support from the authors to take a look at the current project structure and say whether the normal approach is fine or no.

To support the Thread and Zigbee SDK we would need most probably to make some changes in the definition of the cache variables.

What do you think about that?

process_begin: CreateProcess(NULL, nrfjprog -c 4000 --eraseall --program untitled4.hex --sectorerase, ...) failed.

First of all, this is a question, not really an issue, but since you seem to have more knowledge for cmake files rather than me, I'd like to ask something. I have almost the same cmake file (customized yours for the NRF52) but when I try to build the project, I get the following error message:

mingw32-make.exe[2]: Leaving directory 'C:/Users/marcd/Google Drive/HBO ICT/Jaar 3/Stage/untitled4/cmake-build-debug'
process_begin: CreateProcess(NULL, nrfjprog -c 4000 --eraseall --program untitled4.hex --sectorerase, ...) failed.
mingw32-make.exe[1]: Leaving directory 'C:/Users/marcd/Google Drive/HBO ICT/Jaar 3/Stage/untitled4/cmake-build-debug'
make (e=2): The system cannot find the file specified.
mingw32-make.exe[2]: *** [CMakeFiles\flash_untitled4.dir\build.make:60: CMakeFiles/flash_untitled4] Error 2
mingw32-make.exe[1]: *** [CMakeFiles\Makefile2:112: CMakeFiles/flash_untitled4.dir/all] Error 2
mingw32-make.exe: *** [Makefile:86: all] Error 2

It cannot create the process for some reason while I have nrfjprog installed and added to path. Also I am running the FLASH_${EXECUTABLE_NAME}, when I run the project. Do you have any suggestions?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.