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

Error in gcc_current_sp in compiler_abstraction.h #5

Open
FelixGruen opened this issue Jan 22, 2017 · 0 comments
Open

Error in gcc_current_sp in compiler_abstraction.h #5

FelixGruen opened this issue Jan 22, 2017 · 0 comments

Comments

@FelixGruen
Copy link

FelixGruen commented Jan 22, 2017

When I try to build a C programm for the micro:bit with yotta, it tells me:

compiler_abstraction.h:85:30: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'asm'
         register unsigned sp asm("sp");
                              ^~~

I followed the installation guide on https://lancaster-university.github.io/microbit-docs/offline-toolchains/ for the general tool chain and installed yotta according to http://yottadocs.mbed.com/ with the gcc-arm-embedded package from team-gcc-arm-embedded/ppa.

And I'm using the 64-bit version of Ubuntu 14.04 LTS.

The complete error message is:

info: generate for target: bbc-microbit-classic-gcc 0.2.3 at /my_project/yotta_targets/bbc-microbit-classic-gcc
warning: subdirectory "test" of my_project 0.0.0 at /my_project was ignored because it doesn't appear to contain any source files
GCC version is: 6.2.1
suppressing warnings from ble-nrf51822
suppressing warnings from nrf51-sdk
fatal: Not a git repository (or any of the parent directories): .git
fatal: Not a git repository (or any of the parent directories): .git
suppressing ALL warnings from mbed-classic, ble, ble-nrf51822 & nrf51-sdk
-- Configuring done
-- Generating done
-- Build files have been written to: /my_project/build/bbc-microbit-classic-gcc
[1/2] Building C object source/CMakeFiles/my_project.dir/my_project/source/start.c.o
FAILED: /usr/bin/arm-none-eabi-gcc  -DYOTTA_MODULE_NAME=my_project -Dmy_project_EXPORTS -std=c99 -fno-exceptions -fno-unwind-tables [...]
In file included from /my_project/yotta_modules/mbed-classic/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/nrf.h:43:0,
                 from /my_project/yotta_modules/mbed-classic/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/cmsis.h:10,
                 from /my_project/yotta_modules/mbed-classic/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/objects.h:19,
                 from /my_project/yotta_modules/mbed-classic/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/TARGET_NRF51_MICROBIT/device.h:55,
                 from /my_project/yotta_modules/mbed-classic/api/platform.h:21,
                 from /my_project/yotta_modules/mbed-classic/api/mbed.h:21,
                 from /my_project/yotta_modules/microbit/inc/MicroBit.h:29,
                 from /my_project/source/start.c:1:
/my_project/yotta_modules/mbed-classic/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/compiler_abstraction.h: In function 'gcc_current_sp':
/my_project/yotta_modules/mbed-classic/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/compiler_abstraction.h:85:30: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'asm'
         register unsigned sp asm("sp");
                              ^~~
/my_project/yotta_modules/mbed-classic/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/compiler_abstraction.h:85:30: warning: implicit declaration of function 'asm' [-Wimplicit-function-declaration]
/my_project/yotta_modules/mbed-classic/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/compiler_abstraction.h:86:16: error: 'sp' undeclared (first use in this function)
         return sp;
                ^~
/my_project/yotta_modules/mbed-classic/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/compiler_abstraction.h:86:16: note: each undeclared identifier is reported only once for each function it appears in
In file included from /my_project/yotta_modules/mbed-classic/api/mbed.h:21:0,
                 from /my_project/yotta_modules/microbit/inc/MicroBit.h:29,
                 from /my_project/source/start.c:1:
/my_project/yotta_modules/mbed-classic/api/platform.h: At top level:
/my_project/yotta_modules/mbed-classic/api/platform.h:25:19: fatal error: cstddef: No such file or directory
 #include <cstddef>
                   ^
compilation terminated.
ninja: build stopped: subcommand failed.
error: command ['ninja'] failed

The exact commands I used were:

yt init
yt target bbc-microbit-classic-gcc
yt install lancaster-university/microbit
yt build

If I build it as a C++ project by changing the file ending to cpp it builds without problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant