ARMmbed / mbed-cli

Arm Mbed Command Line Interface
https://os.mbed.com
Apache License 2.0
328 stars 175 forks source link

Building classic projects for microbit #327

Open arekzaluski opened 7 years ago

arekzaluski commented 7 years ago

Building classic projects for Microbit doesn't seem to work. I've tried to build https://developer.mbed.org/teams/BBC/code/microbit_blinky/?platform=Microbit and https://developer.mbed.org/teams/microbit/code/microbit-hello-world/ projects. Both of them are failing to build correctly.

The command I'm using is mbed compile -t GCC_ARM -m NRF51_MICROBIT

@screamerbg @bogdanm

theotherjimmy commented 7 years ago

Could you post the output that is associated with the failure after appending -v to the command line? It would help me root cause the problem you are having.

[Mirrored to Jira]

arekzaluski commented 7 years ago

@theotherjimmy Sure here is the output of mbed compile -t GCC_ARM -m NRF51_MICROBIT -v

microbit_output.txt

[Mirrored to Jira]

janjongboom commented 7 years ago

Potential micro:bit partner also ran into this... I cannot compile with ARMCC either.

Errors like this:

[Error] device_manager.h@509,37: 'p_ble_evt' was not declared in this scope
[ERROR] In file included from ./microbit/microbit-dal/nRF51822/nrf51-sdk/source/nordic_sdk/components/libraries/bootloader_dfu/dfu_app_handler.h:57:0,
                 from ./microbit/microbit-dal/BLE_API/ble/services/DFUService.h:26,
                 from ./microbit/microbit-dal/BLE_API/source/services/DFUService.cpp:19:
./microbit/microbit-dal/nRF51822/nrf51-sdk/source/nordic_sdk/components/ble/ble_services/ble_dfu/ble_dfu.h:190:44: error: 'ble_evt_t' has not been declared
 void ble_dfu_on_ble_evt(ble_dfu_t * p_dfu, ble_evt_t * p_ble_evt);
                                            ^
In file included from ./microbit/microbit-dal/nRF51822/nrf51-sdk/source/nordic_sdk/components/libraries/bootloader_dfu/dfu_app_handler.h:60:0,
                 from ./microbit/microbit-dal/BLE_API/ble/services/DFUService.h:26,
                 from ./microbit/microbit-dal/BLE_API/source/services/DFUService.cpp:19:
./microbit/microbit-dal/nRF51822/nrf51-sdk/source/nordic_sdk/components/ble/device_manager/device_manager.h:509:25: error: variable or field 'dm_ble_evt_handler' declared void
 void dm_ble_evt_handler(ble_evt_t * p_ble_evt);
                         ^
./microbit/microbit-dal/nRF51822/nrf51-sdk/source/nordic_sdk/components/ble/device_manager/device_manager.h:509:25: error: 'ble_evt_t' was not declared in this scope
./microbit/microbit-dal/nRF51822/nrf51-sdk/source/nordic_sdk/components/ble/device_manager/device_manager.h:509:37: error: 'p_ble_evt' was not declared in this scope
 void dm_ble_evt_handler(ble_evt_t * p_ble_evt);

[Mirrored to Jira]

bridadan commented 7 years ago

I looked into why blinky wasn't compiling, looks like the pinned release of the microbit didn't actually support GCC_ARM at the time, or at least it wasn't included in the release. It compiles ok for ARM.

If you update the mbed.bld file to the latest version (2e9cc70d1897), I can compile blinky for GCC_ARM.

I'm afraid I don't know much about the other example since it isn't using the official mbed release.

[Mirrored to Jira]

arekzaluski commented 7 years ago

@bridadan Thanks. I was able to build microbit-blinky after updating mbed.bld to the latest version.

[Mirrored to Jira]

screamerbg commented 7 years ago

@arekzaluski Did this fix the issue? If so, are you happy to close this?

[Mirrored to Jira]

screamerbg commented 7 years ago

Closing this as there is no activity. Please reopen if the issue persists. [Mirrored to Jira]

thegecko commented 5 years ago

Re-opening this issue as it is still apparent with the promoted micro:bit examples being run locally with gcc.

E.g. this example:

https://os.mbed.com/teams/BBC/code/microbit-component-display/

Fails in mbed-cli with the following:

Building project microbit-component-display (NRF51_MICROBIT, GCC_ARM)
Scan: .
Scan: env
Scan: mbed
Compile [  1.0%]: GapScanningParams.cpp
Compile [  2.0%]: BLE.cpp
Compile [  3.1%]: DiscoveredCharacteristic.cpp
Compile [  4.1%]: main.cpp
Compile [  5.1%]: ble_radio_notification.c
Compile [  6.1%]: DFUService.cpp
[Error] ble_dfu.h@190,44: 'ble_evt_t' has not been declared
[Error] device_manager.h@509,25: variable or field 'dm_ble_evt_handler' declared void
[Error] device_manager.h@509,0: 'ble_evt_t' was not declared in this scope
[Error] device_manager.h@509,37: 'p_ble_evt' was not declared in this scope
[Warning] ble_l2cap.h@133,45: 'uint32_t sd_ble_l2cap_cid_register(uint16_t)' defined but not used [-Wunused-function]
[ERROR] In file included from ./microbit/microbit-dal/nRF51822/nrf51-sdk/source/nordic_sdk/components/libraries/bootloader_dfu/dfu_app_handler.h:57:0,
                 from ./microbit/microbit-dal/BLE_API/ble/services/DFUService.h:26,
                 from ./microbit/microbit-dal/BLE_API/source/services/DFUService.cpp:19:
./microbit/microbit-dal/nRF51822/nrf51-sdk/source/nordic_sdk/components/ble/ble_services/ble_dfu/ble_dfu.h:190:44: error: 'ble_evt_t' has not been declared
 void ble_dfu_on_ble_evt(ble_dfu_t * p_dfu, ble_evt_t * p_ble_evt);
                                            ^~~~~~~~~
In file included from ./microbit/microbit-dal/nRF51822/nrf51-sdk/source/nordic_sdk/components/libraries/bootloader_dfu/dfu_app_handler.h:60:0,
                 from ./microbit/microbit-dal/BLE_API/ble/services/DFUService.h:26,
                 from ./microbit/microbit-dal/BLE_API/source/services/DFUService.cpp:19:
./microbit/microbit-dal/nRF51822/nrf51-sdk/source/nordic_sdk/components/ble/device_manager/device_manager.h:509:25: error: variable or field 'dm_ble_evt_handler' declared void
 void dm_ble_evt_handler(ble_evt_t * p_ble_evt);
                         ^~~~~~~~~
./microbit/microbit-dal/nRF51822/nrf51-sdk/source/nordic_sdk/components/ble/device_manager/device_manager.h:509:25: error: 'ble_evt_t' was not declared in this scope
./microbit/microbit-dal/nRF51822/nrf51-sdk/source/nordic_sdk/components/ble/device_manager/device_manager.h:509:37: error: 'p_ble_evt' was not declared in this scope
 void dm_ble_evt_handler(ble_evt_t * p_ble_evt);
                                     ^~~~~~~~~
In file included from ./microbit/microbit-dal/nRF51822/nrf51-sdk/source/nordic_sdk/components/softdevice/s130/headers/ble_l2cap.h:45:0,
                 from ./microbit/microbit-dal/nRF51822/nrf51-sdk/source/nordic_sdk/components/softdevice/s130/headers/ble_gatts.h:44,
                 from ./microbit/microbit-dal/nRF51822/nrf51-sdk/source/nordic_sdk/components/ble/ble_services/ble_dfu/ble_dfu.h:51,
                 from ./microbit/microbit-dal/nRF51822/nrf51-sdk/source/nordic_sdk/components/libraries/bootloader_dfu/dfu_app_handler.h:57,
                 from ./microbit/microbit-dal/BLE_API/ble/services/DFUService.h:26,
                 from ./microbit/microbit-dal/BLE_API/source/services/DFUService.cpp:19:
./microbit/microbit-dal/nRF51822/nrf51-sdk/source/nordic_sdk/components/softdevice/s130/headers/ble_l2cap.h:133:45: warning: 'uint32_t sd_ble_l2cap_cid_register(uint16_t)' defined but not used [-Wunused-function]
 SVCALL(SD_BLE_L2CAP_CID_REGISTER, uint32_t, sd_ble_l2cap_cid_register(uint16_t cid));
                                             ^
./microbit/microbit-dal/nRF51822/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 \
                                             ^~~~~~~~~

[mbed] ERROR: "/usr/local/opt/python/bin/python2.7" returned error code 1.
[mbed] ERROR: Command "/usr/local/opt/python/bin/python2.7 -u /Users/robmor01/Projects/microbit-component-display/.temp/tools/make.py -t gcc_arm -m NRF51_MICROBIT --source . --build ./BUILD/NRF51_MICROBIT/gcc_arm" in "/Users/robmor01/Projects/microbit-component-display"

Updating to the latest revision of the microbit library doesn't fix the issue. [Mirrored to Jira]

0xc0170 commented 5 years ago

@jaustin Can you review this issue? The libraries are 2 years old by looks of it. [Mirrored to Jira]

jaustin commented 5 years ago

@theotherjimmy looked into this a while back, and I thought he had success with building the older programs. There was an inconsistency between the online compiler and the offline one WRT armcc, but that shouldn't be a factor here.... Jimmy, did you bump into any of the issues like Rob has? [Mirrored to Jira]

theotherjimmy commented 5 years ago

@jaustin, I did, and I resolved them with a build profile that was like develop, but without disabling VLA. [Mirrored to Jira]

awe-devasc commented 5 years ago

I also came across the kind of problem discussed above when trying to build a simple BBC:Microbit C++ program using the mbed-cli ... is there a simple set of instructions and example to show me how to do this please ... [Mirrored to Jira]

yennster commented 5 years ago

I opened an issue on the microbit-dal repo here: https://github.com/lancaster-university/microbit-dal/issues/393

Still unsure of the proper way I should be building the microbit examples with Mbed CLI

adbridge commented 4 years ago

Apologies, this was closed in error by the automated bot - re-opening.

ciarmcom commented 4 years ago

Internal Jira reference: https://jira.arm.com/browse/IOTBTOOL-480