This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to import gcc-arm project to segger studio

Hi,

I am evaluating the Firmware on this github repo  and my nrf52832. 

At the moment I am compiling it using my makefile, however I would like to import this project to Segger Embedded Studio, in order to be able to use the debugger.

Could you give some advice on how  to do this?

Thanks!

Parents
  • Have you searched the SES documentation and the Segger forum to see if they have anything to import from a makefile?

    Otherwise, you are just going to have to go through all your makefile settings, and apply them via the IDE.

    The SES Project file is, basically, just an XML file - so you might be able to take a similar approach as described here: https://devzone.nordicsemi.com/f/nordic-q-a/42082/nordic-nrf5-sdk-15-2-0-example-include-files-in-eclipse/163538#163538

  • Thanks for that!
    I have tried adding files, include paths and macros manually to my project, however I still get some build issues, and cannot work out how to fix them. I attach output:

    Rebuilding ‘RUI_ses’ from solution ‘RUI_ses’ in configuration ‘Debug’
    Compiling ‘main.c’
    app_util_platform.h
    FreeRTOSConfig.h
    FreeRTOS.h
    main.c
    #error "Device must be defined. See nrf.h."
    FreeRTOS.h
    main.c
    #error "This port requires __NVIC_PRIO_BITS to be defined"
    portmacro_cmsis.h
    portmacro.h
    portable.h
    FreeRTOS.h
    main.c
    implicit declaration of function '__REV' [-Wimplicit-function-declaration]
    portmacro.h
    portable.h
    FreeRTOS.h
    main.c
    unknown type name '__STATIC_INLINE'; did you mean '__INLINE'?
    expected '=', ',', ';', 'asm' or 'attribute' before 'ulPortRaiseBASEPRI'
    ble.h
    ble_advdata.h
    main.c
    unknown type name '__STATIC_INLINE'; did you mean '__INLINE'?
    expected '=', ',', ';', 'asm' or 'attribute' before 'sd_ble_gattc_evt_char_val_by_uuid_read_rsp_iter'
    unknown type name '__STATIC_INLINE'; did you mean '__INLINE'?
    expected '=', ',', ';', 'asm' or 'attribute' before 'sd_ble_gattc_evt_char_val_by_uuid_read_rsp_iter'
    main.c
    ble_link_ctx_manager.h: No such file or directory
    Compiling ‘SEGGER_RTT.c’
    Compiling ‘SEGGER_RTT_Syscalls_SES.c’
    Assembling ‘Cortex_M_Startup.s’
    Assembling ‘HardFaultHandler.S’

Reply
  • Thanks for that!
    I have tried adding files, include paths and macros manually to my project, however I still get some build issues, and cannot work out how to fix them. I attach output:

    Rebuilding ‘RUI_ses’ from solution ‘RUI_ses’ in configuration ‘Debug’
    Compiling ‘main.c’
    app_util_platform.h
    FreeRTOSConfig.h
    FreeRTOS.h
    main.c
    #error "Device must be defined. See nrf.h."
    FreeRTOS.h
    main.c
    #error "This port requires __NVIC_PRIO_BITS to be defined"
    portmacro_cmsis.h
    portmacro.h
    portable.h
    FreeRTOS.h
    main.c
    implicit declaration of function '__REV' [-Wimplicit-function-declaration]
    portmacro.h
    portable.h
    FreeRTOS.h
    main.c
    unknown type name '__STATIC_INLINE'; did you mean '__INLINE'?
    expected '=', ',', ';', 'asm' or 'attribute' before 'ulPortRaiseBASEPRI'
    ble.h
    ble_advdata.h
    main.c
    unknown type name '__STATIC_INLINE'; did you mean '__INLINE'?
    expected '=', ',', ';', 'asm' or 'attribute' before 'sd_ble_gattc_evt_char_val_by_uuid_read_rsp_iter'
    unknown type name '__STATIC_INLINE'; did you mean '__INLINE'?
    expected '=', ',', ';', 'asm' or 'attribute' before 'sd_ble_gattc_evt_char_val_by_uuid_read_rsp_iter'
    main.c
    ble_link_ctx_manager.h: No such file or directory
    Compiling ‘SEGGER_RTT.c’
    Compiling ‘SEGGER_RTT_Syscalls_SES.c’
    Assembling ‘Cortex_M_Startup.s’
    Assembling ‘HardFaultHandler.S’

Children
  • Hi 

    Could you zip the repo with the changes you made?

    Then I can take a look at it and see if I can make it work. 

    Not making any promises, but it's worth a try ;)

    Best regards
    Torbjørn

  • https://github.com/ASL07/RUI_Ses

    Thank you,

    I'll appreciate it very much if you can do anything.

    Regards

  • Hi

    I meant if you can zip the repo and the changes you made to make it work. 

    It is limited how much time I can spend trying to make a non-Nordic code repo work with SES, but if you have done parts of the work already then I can give it a go Slight smile

    Best regards
    Torbjørn

  • Hi,

    Sorry for the delay, I have been busy the las couple of weeks.

    That repo contains my changes. The way I am running it is I place the repo files inside the SDK root directory (same as components, config, documentation, examples...)

    But the only changes I made were I just added these define macros (which were previously defined by the makefile) in main.c

    #define DBG96_TEST    1
    #define DBEM280_TEST  1
    #define DLIS2MDL_TEST 1
    #define DLIS3DH_TEST  1
    #define DOPT3001_TEST 1
    #define DBOARD_PCA10040 1
    #define DDEBUG  1
    #define DCONFIG_NFCT_PINS_AS_GPIOS  1
    #define DSOFTDEVICE_PRESENT 1
    #define DNRF52  1
    #define DS132   1
    #define DSWI_DISABLE0 1
    #define DNRF_SD_BLE_API_VERSION=5 
    #define DNRF52832_XXAA  1
    #define DNRF52_PAN_74 1

    Then I added the include directories in Segger Studio (the project file is in the repo)

    And I added the include directories:

    ../external/freertos/source/include

    ../external/freertos/config

    ../external/freertos/source

    ../components

    ../components/libraries/experimental_memobj

    ../components/libraries/experimental_section_vars

    ../components/softdevice/s132/headers

    ../components/softdevice/s132/headers/nrf52

    ../components/libraries/strerror

    ../components/libraries/fstorage

    ../components/libraries/experimental_memobj

    ../components/softdevice/common

    ../components/libraries/util

    ../components/ble/ble_link_ctx_manager

    ../components/libraries/atomic

    ../components/libraries/atomic_flags

    ../components/ble/nrf_ble_gatt

    ../components/libraries/balloc

    ../components/boards

    ../components/ble/peer_manager

    ../integration/nrfx/legacy

    ../components/libraries/experimental_log

    ../components/softdevice/common

    ../components/ble/common

    ../components/ble/ble_services/ble_nus

    ../components/ble/ble_services/ble_nus

    ../components/ble/ble_link_ctx_manager

    ../components/ble/ble_advertising

    ../components/libraries/atomic_flags

    ../components/libraries/timer

    ../components/libraries/fds

    ../components/libraries/fifo

    ../components/libraries/atomic

    ../components/libraries/atomic_fifo

    ../components/libraries/uart

    ../components/libraries/fstorage

    ../components/libraries/crc32

    ../components/libraries/sha256

    ../components/libraries/crypto

    ../components/libraries/crypto/backend/cc310

    ../components/libraries/crypto/backend/cc310_bl

    ../components/libraries/crypto/backend/nrf_sw

    ../components/libraries/crypto/backend/mbedtls

    ../components/libraries/crypto/backend/oberon

    ../components/libraries/crypto/backend/micro_ecc

    ../components/libraries/bootloader/dfu

    ../components/ble/nrf_ble_gatt

    ../components/libraries/uart/

    ../modules/nrfx/mdk

    ../RUI/build/RTE

    ../modules/nrfx/hal

    ../modules/nrfx/drivers/src/prs

    ../components/libraries/balloc

    ../components/libraries/experimental_log

    ../components/libraries/experimental_log/src

    ../components/libraries/delay

    ../integration/nrfx

    ../components/libraries/bsp

    ../components/drivers_nrf/nrf_soc_nosd

    ../external/segger_rtt

    ../RUI/Source

    ../RUI/Source/include

    ../RUI/Source/external/micro-ecc

    ../components/libraries/strerror

    ../components/boards

    ../components/toolchain/cmsis/include

    ../modules/nrfx

    ../components/libraries/util

    ../external/freertos/portable/GCC/nrf52/

    ../external/freertos/portable/CMSIS/nrf52

    ../external/freertos/source/include

    ../external/fprintf

    ../external/segger_rtt

    ../integration/nrfx/legacy

    ../modules/nrfx/drivers/include

    ../components/libraries/util

    ../components/ble/ble_advertising

    ../components/libraries/fds

    ../components/libraries/button

    ../components/libraries/bsp

    ../modules/nrfx/drivers/include

    ../modules/nrfx/hal/

    ../config

    ../components

    ../components/ble/ble_advertising

    ../components/ble/ble_dtm

    ../components/ble/ble_racp

    ../components/ble/ble_services/ble_ancs_c

    ../components/ble/ble_services/ble_ans_c

    ../components/ble/ble_services/ble_bas

    ../components/ble/ble_services/ble_bas_c

    ../components/ble/ble_services/ble_cscs

    ../components/ble/ble_services/ble_cts_c

    ../components/ble/ble_services/ble_dfu

    ../components/ble/ble_services/ble_dis

    ../components/ble/ble_services/ble_gls

    ../components/ble/ble_services/ble_hids

    ../components/ble/ble_services/ble_hrs

    ../components/ble/ble_services/ble_hrs_c

    ../components/ble/ble_services/ble_hts

    ../components/ble/ble_services/ble_ias

    ../components/ble/ble_services/ble_ias_c

    ../components/ble/ble_services/ble_lbs

    ../components/ble/ble_services/ble_lbs_c

    ../components/ble/ble_services/ble_lls

    ../components/ble/ble_services/ble_nus

    ../components/ble/ble_services/ble_nus_c

    ../components/ble/ble_services/ble_rscs

    ../components/ble/ble_services/ble_rscs_c

    ../components/ble/ble_services/ble_tps

    ../components/ble/common

    ../components/ble/nrf_ble_gatt

    ../components/ble/nrf_ble_qwr

    ../components/ble/peer_manager

    ../components/boards

    ../components/drivers_nrf/usbd

    ../components/libraries/atomic

    ../components/libraries/atomic_fifo

    ../components/libraries/atomic_flags

    ../components/libraries/balloc

    ../components/libraries/bootloader/ble_dfu

    ../components/libraries/bsp

    ../components/libraries/button

    ../components/libraries/cli

    ../components/libraries/crc16

    ../components/libraries/crc32

    ../components/libraries/crypto

    ../components/libraries/csense

    ../components/libraries/csense_drv

    ../components/libraries/delay

    ../components/libraries/ecc

    ../components/libraries/experimental_section_vars

    ../components/libraries/experimental_task_manager

    ../components/libraries/fds

    ../components/libraries/fstorage

    ../components/libraries/gfx

    ../components/libraries/gpiote

    ../components/libraries/hardfault

    ../components/libraries/hardfault/nrf52

    ../components/libraries/hci

    ../components/libraries/led_softblink

    ../components/libraries/log

    ../components/libraries/log/src

    ../components/libraries/low_power_pwm

    ../components/libraries/mem_manager

    ../components/libraries/memobj

    ../components/libraries/mpu

    ../components/libraries/mutex

    ../components/libraries/pwm

    ../components/libraries/pwr_mgmt

    ../components/libraries/queue

    ../components/libraries/ringbuf

    ../components/libraries/scheduler

    ../components/libraries/sdcard

    ../components/libraries/sensorsim

    ../components/libraries/slip

    ../components/libraries/sortlist

    ../components/libraries/spi_mngr

    ../components/libraries/stack_guard

    ../components/libraries/strerror

    ../components/libraries/svc

    ../components/libraries/timer

    ../components/libraries/twi_mngr

    ../components/libraries/twi_sensor

    ../components/libraries/usbd

    ../components/libraries/usbd/class/audio

    ../components/libraries/usbd/class/cdc

    ../components/libraries/usbd/class/cdc/acm

    ../components/libraries/usbd/class/hid

    ../components/libraries/usbd/class/hid/generic

    ../components/libraries/usbd/class/hid/kbd

    ../components/libraries/usbd/class/hid/mouse

    ../components/libraries/usbd/class/msc

    ../components/libraries/util

    ../components/nfc/ndef/conn_hand_parser

    ../components/nfc/ndef/conn_hand_parser/ac_rec_parser

    ../components/nfc/ndef/conn_hand_parser/ble_oob_advdata_parser

    ../components/nfc/ndef/conn_hand_parser/le_oob_rec_parser

    ../components/nfc/ndef/connection_handover/ac_rec

    ../components/nfc/ndef/connection_handover/ble_oob_advdata

    ../components/nfc/ndef/connection_handover/ble_pair_lib

    ../components/nfc/ndef/connection_handover/ble_pair_msg

    ../components/nfc/ndef/connection_handover/common

    ../components/nfc/ndef/connection_handover/ep_oob_rec

    ../components/nfc/ndef/connection_handover/hs_rec

    ../components/nfc/ndef/connection_handover/le_oob_rec

    ../components/nfc/ndef/generic/message

    ../components/nfc/ndef/generic/record

    ../components/nfc/ndef/launchapp

    ../components/nfc/ndef/parser/message

    ../components/nfc/ndef/parser/record

    ../components/nfc/ndef/text

    ../components/nfc/ndef/uri

    ../components/nfc/t2t_lib

    ../components/nfc/t2t_lib/hal_t2t

    ../components/nfc/t2t_parser

    ../components/nfc/t4t_lib

    ../components/nfc/t4t_lib/hal_t4t

    ../components/nfc/t4t_parser/apdu

    ../components/nfc/t4t_parser/cc_file

    ../components/nfc/t4t_parser/hl_detection_procedure

    ../components/nfc/t4t_parser/tlv

    ../components/softdevice/common

    ../components/softdevice/s132/headers

    ../components/softdevice/s132/headers/nrf52

    ../components/toolchain/cmsis/include

    ../external/fprintf

    ../external/freertos/config

    ../external/freertos/portable/CMSIS/nrf52

    ../external/freertos/portable/GCC/nrf52

    ../external/freertos/source/include

    ../external/segger_rtt

    ../external/utf_converter

    ../integration/nrfx

    ../integration/nrfx/legacy

    ../modules/nrfx

    ../modules/nrfx/drivers/include

    ../modules/nrfx/hal

    ../modules/nrfx/mdk

    .

  • Hi 

    Your list of include contain some duplicates, and it seems there are some lines with trailing spaces also. 

    If there are trailing spaces SES won't be able to decode the include directory properly. 

    After fixing that I noticed that you don't include any preprocessor definitions, which are needed by most of the SDK projects. 

    Below I included the standard preprocessor definitions for the BLE projects in SDK v15.0.0:
    BOARD_PCA10040
    CONFIG_GPIO_AS_PINRESET
    FLOAT_ABI_HARD
    INITIALIZE_USER_SECTIONS
    NO_VTOR_CONFIG
    NRF52
    NRF52832_XXAA
    NRF52_PAN_74
    NRF_SD_BLE_API_VERSION=6
    S132
    SOFTDEVICE_PRESENT
    SWI_DISABLE0

    Can you confirm whether or not the RUI projects include the BLE SoftDevice?

    If so it is important not to include the ../components/drivers_nrf/nrf_soc_nosd folder. 

    Best regards
    Torbjørn

Related