ARMmbed / nrf51-sdk

Module to contain files provided by the nordic nRF51 SDK
Other
13 stars 17 forks source link

It's not possible to generate a debug build with nrf51-sdk 1.0.1 #11

Closed ghost closed 8 years ago

ghost commented 8 years ago
$ yotta build -d
# snip
yotta_modules/nrf51-sdk/source/nordic_sdk/components/libraries/bootloader_dfu/bootloader_util.c: In function 'bootloader_util_reset':
yotta_modules/nrf51-sdk/source/nordic_sdk/components/libraries/bootloader_dfu/bootloader_util.c:126:1: error: r7 cannot be used in asm here
andresag01 commented 8 years ago

@jrobeson: I believe yotta builds with debug information by default, you will find in your build/<target>/source folder an elf file (the one without extension) and .map and .hex files. You should be able to debug your application with these files. You can use yotta debug command or JLink (if using a nRF51DK board only), they both rely on GDB. Is this what you would like to do?

ghost commented 8 years ago

so shouldn't i still be able to build a debug build with -d ?

ghost commented 8 years ago

if yotta build and yotta build -d are equivalent, then they should both generate an error or none should?

andresag01 commented 8 years ago

@jrobeson: I was recently told that yotta build does include some debug information by default (such as symbols), but not the full information that a debug build with -d would have (such as sanity checks and so on). It is likely that the -d option is enabling some additional macros or something else that is causing the build to fail.

LiyouZhou commented 8 years ago

yotta related. closing

ghost commented 8 years ago

how is this yotta related? Please provide more information so I can provide a useful bug report.

LiyouZhou commented 8 years ago

@jrobeson https://github.com/ARMmbed/yotta sorry I meant to comment on this. I think this is a yotta documentation issue where it does not provide enough or clear directions for making a debug build. There is a debug build option and there is a yotta debug command. But the documentation is not very clear.

ghost commented 8 years ago

I WAS trying to generate a debug build.. and then I got an error that seems specifically related to some ASM instruction . Can you please explain how

yotta_modules/nrf51-sdk/source/nordic_sdk/components/libraries/bootloader_dfu/bootloader_util.c:126:1: error: r7 cannot be used in asm here is a bug of yotta?

LiyouZhou commented 8 years ago

@jrobeson Ok, I will look into this when I get to work tomorrow. Would you please run the following command and post the results here? yt target yt ls -a rm -rf yotta_* yt clean; yt build

ghost commented 8 years ago
$yt target
nrf51dk-gcc 1.0.0
nordic-nrf51822-gcc 1.0.0
mbed-gcc 1.1.0
 $ yt ls -a
mbedos-test 0.0.1
┗━ ble 2.4.0 (public registry)
  ┣━ ble-nrf51822 2.4.0 (public registry) yotta_modules/ble-nrf51822
  ┃ ┣━ ble >=2.3.0,<3.0.0
  ┃ ┗━ nrf51-sdk 2.2.0 (public registry) yotta_modules/nrf51-sdk
  ┃   ┗━ mbed-drivers *
  ┣━ mbed-drivers 0.11.6 (public registry) yotta_modules/mbed-drivers
  ┃ ┣━ mbed-hal 1.2.0 (public registry) yotta_modules/mbed-hal
  ┃ ┃ ┣━ mbed-drivers *
  ┃ ┃ ┗━ mbed-hal-nordic 2.0.0 yotta_modules/mbed-hal-nordic
  ┃ ┃   ┗━ mbed-hal-nrf51822-mcu 2.1.4 (public registry) yotta_modules/mbed-hal-nrf51822-mcu
  ┃ ┃     ┣━ mbed-hal >=1.0.0,<2.0.0
  ┃ ┃     ┣━ cmsis-core >=1.0.0,<2.0.0
  ┃ ┃     ┣━ nrf51-sdk >=2.0.0,<3.0.0
  ┃ ┃     ┗━ mbed-hal-nrf51dk 2.0.0 yotta_modules/mbed-hal-nrf51dk
  ┃ ┃       ┗━ mbed-hal-nrf51822-mcu >=2.0.0,<3.0.0
  ┃ ┣━ cmsis-core 1.1.0 (public registry) yotta_modules/cmsis-core
  ┃ ┃ ┗━ cmsis-core-nordic 1.0.1 yotta_modules/cmsis-core-nordic
  ┃ ┃   ┣━ cmsis-core *
  ┃ ┃   ┗━ cmsis-core-nrf51822 1.3.2 (public registry) yotta_modules/cmsis-core-nrf51822
  ┃ ┃     ┗━ nrf51-sdk >=2.0.0,<3.0.0
  ┃ ┣━ ualloc 1.0.3 (public registry) yotta_modules/ualloc
  ┃ ┃ ┣━ dlmalloc 1.0.0 yotta_modules/dlmalloc
  ┃ ┃ ┗━ core-util >=1.0.0,<2.0.0
  ┃ ┣━ minar 1.0.1 yotta_modules/minar
  ┃ ┃ ┣━ compiler-polyfill >=1.1.0,<2.0.0
  ┃ ┃ ┣━ minar-platform 1.0.0 yotta_modules/minar-platform
  ┃ ┃ ┃ ┣━ minar-platform-mbed 1.0.0 yotta_modules/minar-platform-mbed
  ┃ ┃ ┃ ┃ ┣━ cmsis-core >=1.0.0,<2.0.0
  ┃ ┃ ┃ ┃ ┣━ mbed-hal >=1.0.0,<2.0.0
  ┃ ┃ ┃ ┃ ┗━ minar *
  ┃ ┃ ┃ ┗━ cmsis-core >=1.0.0,<2.0.0
  ┃ ┃ ┗━ core-util >=1.0.0,<2.0.0
  ┃ ┣━ core-util 1.1.0 (public registry) yotta_modules/core-util
  ┃ ┃ ┣━ ualloc *
  ┃ ┃ ┣━ cmsis-core >=1.0.0,<2.0.0
  ┃ ┃ ┗━ mbed-drivers >=0.11.1,<0.12.0
  ┃ ┗━ compiler-polyfill >=1.1.0,<2.0.0
  ┗━ compiler-polyfill 1.2.1 (public registry) yotta_modules/compiler-polyfill
$ yt clean && yt build
info: generate for target: nrf51dk-gcc 1.0.0 at ~/projects/mbedos-test/yotta_targets/nrf51dk-gcc
GCC version is: arm-none-eabi-g++ (Fedora 5.2.0-3.fc23) 5.2.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

suppressing warnings from nrf51-sdk
suppressing warnings from ble-nrf51822
-- The ASM compiler identification is GNU
-- Found assembler: /usr/bin/arm-none-eabi-gcc
-- Configuring done
-- Generating done
-- Build files have been written to: ~/projects/mbedos-test/build/nrf51dk-gcc

~/projects/mbedos-test/yotta_modules/mbed-drivers/source/rtc_time.c: In function 'set_time':
~/projects/mbedos-test/yotta_modules/mbed-drivers/source/rtc_time.c:48:22: warning: unused parameter 't' [-Wunused-parameter]
 void set_time(time_t t) {
                      ^
In file included from ~/projects/mbedos-test/yotta_modules/nrf51-sdk/source/nordic_sdk/components/softdevice/s130/headers/nrf_soc.h:45:0,
                 from ~/projects/mbedos-test/yotta_modules/core-util/core-util/CriticalSectionLock.h:25,
                 from ~/projects/mbedos-test/yotta_modules/mbed-drivers/source/SPI.cpp:19:
~/projects/mbedos-test/yotta_modules/nrf51-sdk/source/nordic_sdk/components/softdevice/s130/headers/nrf_soc.h:369:59: warning: unused parameter 'p_mutex' [-Wunused-parameter]
 SVCALL(SD_MUTEX_NEW, uint32_t, sd_mutex_new(nrf_mutex_t * p_mutex));
                                                           ^
~/projects/mbedos-test/yotta_modules/nrf51-sdk/source/nordic_sdk/components/softdevice/s130/headers/nrf_svc.h:49:45: note: in definition of macro 'SVCALL'
   __attribute__((naked)) static return_type signature \
                                             ^
~/projects/mbedos-test/yotta_modules/mbed-drivers/source/error.c: In function 'error':
~/projects/mbedos-test/yotta_modules/mbed-drivers/source/error.c:25:31: warning: unused parameter 'format' [-Wunused-parameter]
 __weak void error(const char* format, ...) {
                               ^
~/projects/mbedos-test/yotta_modules/mbed-drivers/source/assert.c: In function 'mbed_assert_internal':
~/projects/mbedos-test/yotta_modules/mbed-drivers/source/assert.c:26:39: warning: unused parameter 'expr' [-Wunused-parameter]
 void mbed_assert_internal(const char *expr, const char *file, int line)
                                       ^
~/projects/mbedos-test/yotta_modules/mbed-drivers/source/assert.c:26:57: warning: unused parameter 'file' [-Wunused-parameter]
 void mbed_assert_internal(const char *expr, const char *file, int line)
                                                         ^
~/projects/mbedos-test/yotta_modules/mbed-drivers/source/assert.c:26:67: warning: unused parameter 'line' [-Wunused-parameter]
 void mbed_assert_internal(const char *expr, const char *file, int line)
                                                                   ^
~/projects/mbedos-test/yotta_modules/core-util/source/assert_mbed.c: In function 'core_util_runtime_error_internal':
~/projects/mbedos-test/yotta_modules/core-util/source/assert_mbed.c:33:51: warning: unused parameter 'file' [-Wunused-parameter]
 void core_util_runtime_error_internal(const char *file, int line, const char* format, ...) {
                                                   ^
~/projects/mbedos-test/yotta_modules/core-util/source/assert_mbed.c:33:61: warning: unused parameter 'line' [-Wunused-parameter]
 void core_util_runtime_error_internal(const char *file, int line, const char* format, ...) {
                                                             ^
~/projects/mbedos-test/yotta_modules/core-util/source/assert_mbed.c:33:79: warning: unused parameter 'format' [-Wunused-parameter]
 void core_util_runtime_error_internal(const char *file, int line, const char* format, ...) {
                                                                               ^
~/projects/mbedos-test/yotta_modules/core-util/source/assert_mbed.c: In function 'core_util_assert_internal':
~/projects/mbedos-test/yotta_modules/core-util/source/assert_mbed.c:44:44: warning: unused parameter 'expr' [-Wunused-parameter]
 void core_util_assert_internal(const char *expr, const char *file, int line, const char* msg)
                                            ^
~/projects/mbedos-test/yotta_modules/core-util/source/assert_mbed.c:44:62: warning: unused parameter 'file' [-Wunused-parameter]
 void core_util_assert_internal(const char *expr, const char *file, int line, const char* msg)
                                                              ^
~/projects/mbedos-test/yotta_modules/core-util/source/assert_mbed.c:44:72: warning: unused parameter 'line' [-Wunused-parameter]
 void core_util_assert_internal(const char *expr, const char *file, int line, const char* msg)
                                                                        ^
~/projects/mbedos-test/yotta_modules/core-util/source/assert_mbed.c:44:90: warning: unused parameter 'msg' [-Wunused-parameter]
 void core_util_assert_internal(const char *expr, const char *file, int line, const char* msg)
                                                                                          ^
In file included from ~/projects/mbedos-test/yotta_modules/nrf51-sdk/source/nordic_sdk/components/softdevice/s130/headers/nrf_soc.h:45:0,
                 from ~/projects/mbedos-test/yotta_modules/core-util/core-util/CriticalSectionLock.h:25,
                 from ~/projects/mbedos-test/yotta_modules/core-util/core-util/atomic_ops.h:22,
                 from ~/projects/mbedos-test/yotta_modules/core-util/source/atomic_ops.cpp:18:
~/projects/mbedos-test/yotta_modules/nrf51-sdk/source/nordic_sdk/components/softdevice/s130/headers/nrf_soc.h:369:59: warning: unused parameter 'p_mutex' [-Wunused-parameter]
 SVCALL(SD_MUTEX_NEW, uint32_t, sd_mutex_new(nrf_mutex_t * p_mutex));
                                                           ^
~/projects/mbedos-test/yotta_modules/nrf51-sdk/source/nordic_sdk/components/softdevice/s130/headers/nrf_svc.h:49:45: note: in definition of macro 'SVCALL'
   __attribute__((naked)) static return_type signature \
                                             ^
In file included from ~/projects/mbedos-test/yotta_modules/nrf51-sdk/source/nordic_sdk/components/softdevice/s130/headers/nrf_soc.h:45:0,
                 from ~/projects/mbedos-test/yotta_modules/core-util/core-util/CriticalSectionLock.h:25,
                 from ~/projects/mbedos-test/yotta_modules/core-util/core-util/atomic_ops.h:22,
                 from ~/projects/mbedos-test/yotta_modules/core-util/source/sbrk.cpp:17:
~/projects/mbedos-test/yotta_modules/nrf51-sdk/source/nordic_sdk/components/softdevice/s130/headers/nrf_soc.h:369:59: warning: unused parameter 'p_mutex' [-Wunused-parameter]
 SVCALL(SD_MUTEX_NEW, uint32_t, sd_mutex_new(nrf_mutex_t * p_mutex));
                                                           ^
~/projects/mbedos-test/yotta_modules/nrf51-sdk/source/nordic_sdk/components/softdevice/s130/headers/nrf_svc.h:49:45: note: in definition of macro 'SVCALL'
   __attribute__((naked)) static return_type signature \
                                             ^
In file included from ~/projects/mbedos-test/yotta_modules/nrf51-sdk/source/nordic_sdk/components/softdevice/s130/headers/nrf_soc.h:45:0,
                 from ~/projects/mbedos-test/yotta_modules/core-util/core-util/CriticalSectionLock.h:25,
                 from ~/projects/mbedos-test/yotta_modules/core-util/core-util/atomic_ops.h:22,
                 from ~/projects/mbedos-test/yotta_modules/core-util/source/PoolAllocator.cpp:23:
~/projects/mbedos-test/yotta_modules/nrf51-sdk/source/nordic_sdk/components/softdevice/s130/headers/nrf_soc.h:369:59: warning: unused parameter 'p_mutex' [-Wunused-parameter]
 SVCALL(SD_MUTEX_NEW, uint32_t, sd_mutex_new(nrf_mutex_t * p_mutex));
                                                           ^
~/projects/mbedos-test/yotta_modules/nrf51-sdk/source/nordic_sdk/components/softdevice/s130/headers/nrf_svc.h:49:45: note: in definition of macro 'SVCALL'
   __attribute__((naked)) static return_type signature \
                                             ^
In file included from ~/projects/mbedos-test/yotta_modules/nrf51-sdk/source/nordic_sdk/components/softdevice/s130/headers/nrf_soc.h:45:0,
                 from ~/projects/mbedos-test/yotta_modules/core-util/core-util/CriticalSectionLock.h:25,
                 from ~/projects/mbedos-test/yotta_modules/core-util/source/ExtendablePoolAllocator.cpp:20:
~/projects/mbedos-test/yotta_modules/nrf51-sdk/source/nordic_sdk/components/softdevice/s130/headers/nrf_soc.h:369:59: warning: unused parameter 'p_mutex' [-Wunused-parameter]
 SVCALL(SD_MUTEX_NEW, uint32_t, sd_mutex_new(nrf_mutex_t * p_mutex));
                                                           ^
~/projects/mbedos-test/yotta_modules/nrf51-sdk/source/nordic_sdk/components/softdevice/s130/headers/nrf_svc.h:49:45: note: in definition of macro 'SVCALL'
   __attribute__((naked)) static return_type signature \
                                             ^
In file included from ~/projects/mbedos-test/yotta_modules/minar/source/minar.cpp:28:0:
~/projects/mbedos-test/yotta_modules/core-util/core-util/core-util.h:23:2: warning: #warning "core-util/core-util.h is deprecated: use core-util/assert.h instead" [-Wcpp]
 #warning "core-util/core-util.h is deprecated: use core-util/assert.h instead"
  ^
In file included from ~/projects/mbedos-test/yotta_modules/nrf51-sdk/source/nordic_sdk/components/softdevice/s130/headers/nrf_soc.h:45:0,
                 from ~/projects/mbedos-test/yotta_modules/core-util/core-util/CriticalSectionLock.h:25,
                 from ~/projects/mbedos-test/yotta_modules/minar/source/minar.cpp:26:
~/projects/mbedos-test/yotta_modules/nrf51-sdk/source/nordic_sdk/components/softdevice/s130/headers/nrf_soc.h:369:59: warning: unused parameter 'p_mutex' [-Wunused-parameter]
 SVCALL(SD_MUTEX_NEW, uint32_t, sd_mutex_new(nrf_mutex_t * p_mutex));
                                                           ^
~/projects/mbedos-test/yotta_modules/nrf51-sdk/source/nordic_sdk/components/softdevice/s130/headers/nrf_svc.h:49:45: note: in definition of macro 'SVCALL'
   __attribute__((naked)) static return_type signature \
                                             ^
[77/141] Building C object ym/mbed-hal-nrf51822-mcu/existing/CMakeFiles/mbed-hal-nrf51822-mcu.dir/source/us_ticker.c.o
In file included from ~/projects/mbedos-test/yotta_modules/mbed-hal-nrf51822-mcu/source/us_ticker.c:21:0:
~/projects/mbedos-test/yotta_modules/nrf51-sdk/source/nordic_sdk/components/drivers_nrf/delay/nrf_delay.h:194:1: warning: 'inline' is not at beginning of declaration [-Wold-style-declaration]
 static void __INLINE nrf_delay_us(uint32_t volatile number_of_us) __attribute__((always_inline));
 ^
~/projects/mbedos-test/yotta_modules/nrf51-sdk/source/nordic_sdk/components/drivers_nrf/delay/nrf_delay.h:195:1: warning: 'inline' is not at beginning of declaration [-Wold-style-declaration]
 static void __INLINE nrf_delay_us(uint32_t volatile number_of_us)
 ^
[77/141] Building C object ym/mbed-hal-nrf51822-mcu/existing/CMakeFiles/mbed-hal-nrf51822-mcu.dir/source/serial_api.c.o
~/projects/mbedos-test/yotta_modules/mbed-hal-nrf51822-mcu/source/serial_api.c: In function 'serial_baud':
~/projects/mbedos-test/yotta_modules/mbed-hal-nrf51822-mcu/source/serial_api.c:114:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         if (baudrate<acceptedSpeeds[i][0]) {
                     ^
In file included from ~/projects/mbedos-test/yotta_modules/nrf51-sdk/source/nordic_sdk/components/drivers_nrf/delay/nrf_delay.c:36:0:
~/projects/mbedos-test/yotta_modules/nrf51-sdk/source/nordic_sdk/components/drivers_nrf/delay/nrf_delay.h:194:1: warning: 'inline' is not at beginning of declaration [-Wold-style-declaration]
 static void __INLINE nrf_delay_us(uint32_t volatile number_of_us) __attribute__((always_inline));
 ^
~/projects/mbedos-test/yotta_modules/nrf51-sdk/source/nordic_sdk/components/drivers_nrf/delay/nrf_delay.h:195:1: warning: 'inline' is not at beginning of declaration [-Wold-style-declaration]
 static void __INLINE nrf_delay_us(uint32_t volatile number_of_us)
 ^
[115/141] Building C object ym/nrf51-sdk/source/CMakeFiles/nrf51-s...nordic_sdk/components/libraries/bootloader_dfu/dfu_app_handler.c.o
In file included from ~/projects/mbedos-test/yotta_modules/nrf51-sdk/source/nordic_sdk/components/libraries/bootloader_dfu/dfu_app_handler.c:43:0:
~/projects/mbedos-test/yotta_modules/nrf51-sdk/source/nordic_sdk/components/drivers_nrf/delay/nrf_delay.h:194:1: warning: 'inline' is not at beginning of declaration [-Wold-style-declaration]
 static void __INLINE nrf_delay_us(uint32_t volatile number_of_us) __attribute__((always_inline));
 ^
~/projects/mbedos-test/yotta_modules/nrf51-sdk/source/nordic_sdk/components/drivers_nrf/delay/nrf_delay.h:195:1: warning: 'inline' is not at beginning of declaration [-Wold-style-declaration]
 static void __INLINE nrf_delay_us(uint32_t volatile number_of_us)
 ^
In file included from ~/projects/mbedos-test/yotta_modules/nrf51-sdk/source/nordic_sdk/components/softdevice/s130/headers/ble_l2cap.h:45:0,
                 from ~/projects/mbedos-test/yotta_modules/nrf51-sdk/source/nordic_sdk/components/softdevice/s130/headers/ble_gatts.h:44,
                 from ~/projects/mbedos-test/yotta_modules/nrf51-sdk/source/nordic_sdk/components/ble/ble_services/ble_dfu/ble_dfu.h:51,
                 from ~/projects/mbedos-test/yotta_modules/nrf51-sdk/source/nordic_sdk/components/libraries/bootloader_dfu/dfu_app_handler.h:57,
                 from ~/projects/mbedos-test/yotta_modules/ble/ble/services/DFUService.h:26,
                 from ~/projects/mbedos-test/yotta_modules/ble/source/services/DFUService.cpp:19:
~/projects/mbedos-test/yotta_modules/nrf51-sdk/source/nordic_sdk/components/softdevice/s130/headers/ble_l2cap.h:133:80: warning: unused parameter 'cid' [-Wunused-parameter]
 SVCALL(SD_BLE_L2CAP_CID_REGISTER, uint32_t, sd_ble_l2cap_cid_register(uint16_t cid));
                                                                                ^
~/projects/mbedos-test/yotta_modules/nrf51-sdk/source/nordic_sdk/components/softdevice/s130/headers/nrf_svc.h:49:45: note: in definition of macro 'SVCALL'
   __attribute__((naked)) static return_type signature \
                                             ^
[141/141] Linking CXX executable source/mbedos-test
Memory usage for 'mbedos-test'
section              size
.data                 148
.bss                 2424
.heap               17908
.stack               2048