¿Cómo configurar la fuente para la compilación de YouTube?

¿Cómo configurar la fuente para la compilación de YouTube?

SO: debian10.

uname -a
Linux mydebian 4.19.0-13-amd64 #1 SMP Debian 4.19.160-2 (2020-11-28) x86_64 GNU/Linux

Haga lo que indica la página web del manual para instalar el módulo de microbits.

https://microbit-micropython.readthedocs.io/en/latest/devguide/installation.html

sudo add-apt-repository -y ppa:team-gcc-arm-embedded
sudo add-apt-repository -y ppa:pmiller-opensource/ppa
sudo apt-get update
sudo apt-get install cmake ninja-build gcc-arm-none-eabi srecord libssl-dev
pip3 install yotta

Establezca la configuración para module.json.

{
  "name": "helloyotta",
  "version": "0.0.0",
  "description": "Hello yotta example module",
  "keywords": ["example"],
  "author": "James Crosby <[email protected]>",
  "homepage": "http://github.com/ARMmbed/yotta",
  "repository": {
    "url": "[email protected]:ARMmbed/helloyotta.git",
    "type": "git"
  },
  "license": "Apache-2.0",
  "dependencies": {
    "simplelog": "~0.0.0"
  },
  "targetDependencies": {},
  "bin": "./source"
}

Firmware de construcción:

yt target bbc-microbit-classic-gcc-nosd

Ejecute yotta update para recuperar activos remotos:

yt up
yt build
info: generate for target: bbc-microbit-classic-gcc-nosd 0.2.3 at /home/debian/yotta_targets/bbc-microbit-classic-gcc-nosd
warning: bin directory "source" doesn't exist but is listed in the module.json file of helloyotta 0.0.0 at /home/debian
warning: nothing to build!
CMake Deprecation Warning at CMakeLists.txt:16 (cmake_policy):
  The OLD behavior for policy CMP0017 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


CMake Deprecation Warning at /usr/share/cmake-3.13/Modules/CMakeForceCompiler.cmake:69 (message):
  The CMAKE_FORCE_C_COMPILER macro is deprecated.  Instead just set
  CMAKE_C_COMPILER and allow CMake to identify the compiler.
Call Stack (most recent call first):
  /home/debian/yotta_targets/mbed-gcc/CMake/toolchain.cmake:78 (cmake_force_c_compiler)
  toolchain.cmake:8 (include)
  CMakeFiles/3.13.4/CMakeSystem.cmake:6 (include)
  CMakeLists.txt:97 (project)


CMake Deprecation Warning at /usr/share/cmake-3.13/Modules/CMakeForceCompiler.cmake:83 (message):
  The CMAKE_FORCE_CXX_COMPILER macro is deprecated.  Instead just set
  CMAKE_CXX_COMPILER and allow CMake to identify the compiler.
Call Stack (most recent call first):
  /home/debian/yotta_targets/mbed-gcc/CMake/toolchain.cmake:79 (cmake_force_cxx_compiler)
  toolchain.cmake:8 (include)
  CMakeFiles/3.13.4/CMakeSystem.cmake:6 (include)
  CMakeLists.txt:97 (project)

Mi información difícil:

Interface Version: 0255
Bootloader Version: 0255

Descárgalo y extráelo:

cd  microbit-samples-master 
yt clean 
yt build
info: generate for target: bbc-microbit-classic-gcc-nosd 0.2.3 at /home/debian/Downloads/microbit-samples-master/yotta_targets/bbc-microbit-classic-gcc-nosd
CMake Deprecation Warning at CMakeLists.txt:16 (cmake_policy):
  The OLD behavior for policy CMP0017 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


CMake Deprecation Warning at /usr/share/cmake-3.13/Modules/CMakeForceCompiler.cmake:69 (message):
  The CMAKE_FORCE_C_COMPILER macro is deprecated.  Instead just set
  CMAKE_C_COMPILER and allow CMake to identify the compiler.
Call Stack (most recent call first):
  /home/debian/Downloads/microbit-samples-master/yotta_targets/mbed-gcc/CMake/toolchain.cmake:78 (cmake_force_c_compiler)
  toolchain.cmake:8 (include)
  /usr/share/cmake-3.13/Modules/CMakeDetermineSystem.cmake:94 (include)
  CMakeLists.txt:73 (project)


CMake Deprecation Warning at /usr/share/cmake-3.13/Modules/CMakeForceCompiler.cmake:83 (message):
  The CMAKE_FORCE_CXX_COMPILER macro is deprecated.  Instead just set
  CMAKE_CXX_COMPILER and allow CMake to identify the compiler.
Call Stack (most recent call first):
  /home/debian/Downloads/microbit-samples-master/yotta_targets/mbed-gcc/CMake/toolchain.cmake:79 (cmake_force_cxx_compiler)
  toolchain.cmake:8 (include)
  /usr/share/cmake-3.13/Modules/CMakeDetermineSystem.cmake:94 (include)
  CMakeLists.txt:73 (project)


GCC version is: 7.3.1
-- The ASM compiler identification is GNU
-- Found assembler: /usr/bin/arm-none-eabi-gcc
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: /home/debian/Downloads/microbit-samples-master/build/bbc-microbit-classic-gcc-nosd
[114/172] Building CXX object ym/microbit-dal/source/CMakeFiles/microbit-dal.dir/core/MicroBitHeapAllocator.cpp.o
/home/debian/Downloads/microbit-samples-master/yotta_modules/microbit-dal/source/core/MicroBitHeapAllocator.cpp: In function 'void free(void*)':
/home/debian/Downloads/microbit-samples-master/yotta_modules/microbit-dal/source/core/MicroBitHeapAllocator.cpp:342:13: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
             if (*cb == 0 || *cb & MICROBIT_HEAP_BLOCK_FREE)
             ^~
/home/debian/Downloads/microbit-samples-master/yotta_modules/microbit-dal/source/core/MicroBitHeapAllocator.cpp:345:10: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
          *cb |= MICROBIT_HEAP_BLOCK_FREE;
          ^
[117/172] Building CXX object ym/microbit-dal/source/CMakeFiles/microbit-dal.dir/core/MicroBitFiber.cpp.o
/home/debian/Downloads/microbit-samples-master/yotta_modules/microbit-dal/source/core/MicroBitFiber.cpp: In function 'void scheduler_init(EventModel&)':
/home/debian/Downloads/microbit-samples-master/yotta_modules/microbit-dal/source/core/MicroBitFiber.cpp:189:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
     if (fiber_scheduler_running())
     ^~
/home/debian/Downloads/microbit-samples-master/yotta_modules/microbit-dal/source/core/MicroBitFiber.cpp:194:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
  messageBus = &_messageBus;
  ^~~~~~~~~~
/home/debian/Downloads/microbit-samples-master/yotta_modules/microbit-dal/source/core/MicroBitFiber.cpp: In function 'int fiber_wait_for_event(uint16_t, uint16_t)':
/home/debian/Downloads/microbit-samples-master/yotta_modules/microbit-dal/source/core/MicroBitFiber.cpp:388:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
     if(ret == MICROBIT_OK)
     ^~
/home/debian/Downloads/microbit-samples-master/yotta_modules/microbit-dal/source/core/MicroBitFiber.cpp:391:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
  return ret;
  ^~~~~~
[162/172] Building CXX object ym/microbit-dal/source/CMakeFiles/microbit-dal.dir/bluetooth/MicroBitIOPinService.cpp.o
/home/debian/Downloads/microbit-samples-master/yotta_modules/microbit-dal/source/bluetooth/MicroBitIOPinService.cpp: In member function 'void MicroBitIOPinService::onDataWritten(const GattWriteCallbackParams*)':
/home/debian/Downloads/microbit-samples-master/yotta_modules/microbit-dal/source/bluetooth/MicroBitIOPinService.cpp:179:42: warning: array subscript is above array bounds [-Warray-bounds]
                 io.pin[i].getDigitalValue();
                 ~~~~~~~~~~~~~~~~~~~~~~~~~^~
/home/debian/Downloads/microbit-samples-master/yotta_modules/microbit-dal/source/bluetooth/MicroBitIOPinService.cpp:182:41: warning: array subscript is above array bounds [-Warray-bounds]
                 io.pin[i].getAnalogValue();
                 ~~~~~~~~~~~~~~~~~~~~~~~~^~
/home/debian/Downloads/microbit-samples-master/yotta_modules/microbit-dal/source/bluetooth/MicroBitIOPinService.cpp:199:41: warning: array subscript is above array bounds [-Warray-bounds]
                io.pin[i].getDigitalValue();
                ~~~~~~~~~~~~~~~~~~~~~~~~~^~
/home/debian/Downloads/microbit-samples-master/yotta_modules/microbit-dal/source/bluetooth/MicroBitIOPinService.cpp:202:40: warning: array subscript is above array bounds [-Warray-bounds]
                io.pin[i].getAnalogValue();
                ~~~~~~~~~~~~~~~~~~~~~~~~^~
/home/debian/Downloads/microbit-samples-master/yotta_modules/microbit-dal/source/bluetooth/MicroBitIOPinService.cpp:224:43: warning: array subscript is above array bounds [-Warray-bounds]
                 io.pin[pin].setAnalogValue(value);
                 ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
/home/debian/Downloads/microbit-samples-master/yotta_modules/microbit-dal/source/bluetooth/MicroBitIOPinService.cpp:225:46: warning: array subscript is above array bounds [-Warray-bounds]
                 io.pin[pin].setAnalogPeriodUs(period);
                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
/home/debian/Downloads/microbit-samples-master/yotta_modules/microbit-dal/source/bluetooth/MicroBitIOPinService.cpp:245:51: warning: array subscript is above array bounds [-Warray-bounds]
                  io.pin[data->pin].setDigitalValue(data->value);
                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
/home/debian/Downloads/microbit-samples-master/yotta_modules/microbit-dal/source/bluetooth/MicroBitIOPinService.cpp:247:50: warning: array subscript is above array bounds [-Warray-bounds]
                  io.pin[data->pin].setAnalogValue(data->value == 255 ? 1023 : data->value << 2);
                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/debian/Downloads/microbit-samples-master/yotta_modules/microbit-dal/source/bluetooth/MicroBitIOPinService.cpp: In member function 'void MicroBitIOPinService::updateBLEInputs(bool)':
/home/debian/Downloads/microbit-samples-master/yotta_modules/microbit-dal/source/bluetooth/MicroBitIOPinService.cpp:136:50: warning: array subscript is above array bounds [-Warray-bounds]
                 value = io.pin[i].getDigitalValue();
                         ~~~~~~~~~~~~~~~~~~~~~~~~~^~
/home/debian/Downloads/microbit-samples-master/yotta_modules/microbit-dal/source/bluetooth/MicroBitIOPinService.cpp:138:49: warning: array subscript is above array bounds [-Warray-bounds]
                 value = io.pin[i].getAnalogValue() >> 2;
                         ~~~~~~~~~~~~~~~~~~~~~~~~^~
[172/172] Linking CXX executable source/microbit-samples
 

No se encontró ningún archivo .hex.

ls  build/bbc-microbit-classic-gcc-nosd
build.ninja     CMakeFiles           CMakeLists.txt       generated    source           ym                  yotta_config.h
CMakeCache.txt  cmake_install.cmake  CTestTestfile.cmake  rules.ninja  toolchain.cmake  yotta_build_info.h  yotta_config.json

Ahora en mi python3:

python3
Python 3.7.3 (default, Jul 25 2020, 13:03:44) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import  microbit
>>> dir(microbit)
['__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__']
>>> 

No puedo usar REPL de python3 para microbits.

Respuesta1

El resultado de muestra que publicó muestra que el sistema de compilación está buscando un directorio 'fuente' y también un archivo para compilar. En este caso un archivo .cpp.

No dijiste qué versión de micro:bit estás usando. Las siguientes sugerencias me funcionan al usar la versión 1 de micro:bit en Debian.

Descargue los ejemplos de micro:bit del repositorio de la Universidad de Lancaster en GitHub y descomprímalos:

https://github.com/lancaster-university/microbit-samples

Hay un archivo main.cpp de ejemplo y un archivo .json en el directorio microbit-samples-master. Hay otros archivos .cpp de ejemplo en el directorio de ejemplos.

En el directorio microbit-samples-master:

yt target bbc-microbit-classic-gcc-nosd
yt clean
yt build

El archivo .hex se puede encontrar en:

microbit-samples-master/build/bbc-microbit-classic-gcc/source

información relacionada