arduino / ArduinoCore-mbed

331 stars 199 forks source link

Need help compiling mbed for PORTENTA_H7_M7 #609

Open salasidis opened 1 year ago

salasidis commented 1 year ago

Hello, having eternal issues trying to compile new libmbed.a file

Created a new PC with Ubuntuu linux Downloaded Arduino IDE 2.0 Install Portenta Board manager

Used the main file below as guide

https://github.com/arduino/ArduinoCore-mbed#mbed-os-to-arduino-script

Did not create a new clone, but trying to compile in the 3.5.4 installation itself Went to ~/.arduino15/packages/arduino/hardware/mbed_portenta/3.5.4

I tried running the mbed-os-to-arduino script at that point, and was getting a line 25 error

I then found this https://github.com/arduino/ArduinoCore-nRF528x-mbedos/issues/66

I installed python3 Created a virtual environemt and and ran

./mbed-os-to-arduino -a -g PORTENTA_H7_M7:PORTENTA_H7_M7

I then got an error message later in the script

MBED_CLEAN=0
MBED_UPDATE=0
APPLY_PATCHES=1
RESTORE_GDB_INFO=1
LOCAL_REPO=
REMOTE_BRANCH=
MBED_CORE_LOCATION=/home/rsalasidis/.arduino15/packages/arduino/hardware/mbed_portenta/3.5.4

VARIANT=PORTENTA_H7_M7 BOARD=PORTENTA_H7_M7 Checking for prerequisites... done.
Creating MbedOS Application... done.
Checking out preferred 'mbed-os' version... done.
Setting up Mbed Application...[mbed] Working path "/tmp/mbed-os-program" 
(program)
[mbed] PORTENTA_H7_M7 now set as default target in program "mbed-os-program"
[mbed] Working path "/tmp/mbed-os-program" (program) [mbed] GCC_ARM now set as default toolchain in program "mbed-os-program"
  done.
Applying patches... done.
Restoring gdb info (this increases libmbed binary size, not suitable for
release)
Updated 0 paths from the index
/tmp/mbed-os-program
Compiling Mbed Application...[mbed] ERROR: 
"/home/rsalasidis/.arduino15/packages/arduino/hardware/mbed_portenta/3.5.4/bin/python3" 
returned error.
        Code: 1
        Path: "/tmp/mbed-os-program"
        Command: 
"/home/rsalasidis/.arduino15/packages/arduino/hardware/mbed_portenta/3.5.4/bin/python3
-m pip list -l"
---

I downloaded the GNU ToolChain, but not sure if the problem is that the scrtipt dows not find the compiler locations?

Any ideas?

Thanks

salasidis commented 1 year ago

I did the clone, and created the symbolic link

Everything else was left as is

I now get the following error message ? compiler location ?

./mbed-os-to-arduino -a -g PORTENTA_H7_M7:PORTENTA_H7_M7

MBED_CLEAN=0
MBED_UPDATE=0
APPLY_PATCHES=1
RESTORE_GDB_INFO=1
LOCAL_REPO=
REMOTE_BRANCH=
MBED_CORE_LOCATION=/home/rsalasidis/Arduino/hardware/arduino-git/mbed

VARIANT=PORTENTA_H7_M7 BOARD=PORTENTA_H7_M7
Checking for prerequisites... done.
Creating MbedOS Application... done.
Checking out preferred 'mbed-os' version... done.
Setting up Mbed Application...[mbed] Working path "/tmp/mbed-os-program" (program)
[mbed] PORTENTA_H7_M7 now set as default target in program "mbed-os-program"
[mbed] Working path "/tmp/mbed-os-program" (program)
[mbed] GCC_ARM now set as default toolchain in program "mbed-os-program"
 done.
Applying patches...git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0001-PACKAGING-remove-gdb-exta-information-to-slim-librar.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0002-Portenta-enable-certificates-in-filesystem.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0003-I2CSlave.read-buf-count-returns-the-number-of-bytes-.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0004-Add-AnalogIn-configure-function.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0005-HACK-avoid-10862-by-not-firing-the-assert.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0006-portentaH7-Change-BLE-public-address.patch 
/home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0006-portentaH7-Change-BLE-public-address.patch:21: trailing whitespace.
            uint8_t bdAddr[6] = { 0xFF, 0xFF, 0xFF, 0x0A, 0x61, 0xA8 }; 
warning: 1 line adds whitespace errors.
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0007-TLSSocketWrapper-add-method-to-retrieve-certificates.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0008-TLSSocketWrapper-Add-unit-test-for-set_root_ca_cert_.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0009-TLSSocketWrapper-add-test-for-certificates-stored-in.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0010-Initial-support-Portenta-Beta.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0011-STM32-USB-allow-dynamic-USB-speed-configuration-base.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0012-Increase-Cordio-memory-pool-for-nRF52832.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0013-Cordio-Add-sendCmplt-Callback-for-updating-NumCmplPc.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0014-Add-support-for-Arduino-Edge-Control.patch 
/home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0014-Add-support-for-Arduino-Edge-Control.patch:139: trailing whitespace.

/home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0014-Add-support-for-Arduino-Edge-Control.patch:182: trailing whitespace.

/home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0014-Add-support-for-Arduino-Edge-Control.patch:197: trailing whitespace.
    QSPI_FLASH1_CSN = QSPI1_CSN,    
warning: 3 lines add whitespace errors.
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0015-RASPBERRYPI-import-pico-sdk.patch 
/home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0015-RASPBERRYPI-import-pico-sdk.patch:1045: trailing whitespace.
by the actual target `PICO_PLATFORM`` 
/home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0015-RASPBERRYPI-import-pico-sdk.patch:3450: trailing whitespace.
 *         // will try to sleep until timeout or the next processor event 
/home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0015-RASPBERRYPI-import-pico-sdk.patch:5113: trailing whitespace.
This can be extremely useful for testing and debugging higher level application code, or porting code which is not yet small enough 
/home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0015-RASPBERRYPI-import-pico-sdk.patch:5119: trailing whitespace.
It is possible however to inject additional SDK library implementations/simulations to provide 
/home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0015-RASPBERRYPI-import-pico-sdk.patch:5120: trailing whitespace.
more complete functionality. For an example of this see the [pico-host-sdl](https://github.com/raspberrypi/pico-host-sdl) 
warning: squelched 50 whitespace errors
warning: 55 lines add whitespace errors.
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0016-RP2040-add-NANO_RP2040_CONNECT-target.patch 
/home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0016-RP2040-add-NANO_RP2040_CONNECT-target.patch:626: new blank line at EOF.
+
/home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0016-RP2040-add-NANO_RP2040_CONNECT-target.patch:820: new blank line at EOF.
+
warning: 2 lines add whitespace errors.
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0017-RP2040-add-placeholder-files-for-includes-like-pico-.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0018-RP2040-implement-serial-api.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0019-RP2040-add-pinmap-for-i2c-spi-pwm.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0020-RP2040-Mark-.init-section-as-KEEP.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0021-RP2040-implement-mbed-api-analogin.patch 
/home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0021-RP2040-implement-mbed-api-analogin.patch:80: trailing whitespace.
    if (!is_adc_initialized) 
/home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0021-RP2040-implement-mbed-api-analogin.patch:54: new blank line at EOF.
+
warning: 2 lines add whitespace errors.
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0022-RP2040-add-SPI-support.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0023-RP2040-prefix-pico-sdk-s-i2c_init-function-with-a-_.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0024-RP2040-add-I2C-peripheral-support.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0025-RP2040-implement-USBDevice.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0026-RP2040-avoid-float.h-first-level-inclusion.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0027-RP2040-don-t-initalize-contructors-during-runtime_in.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0028-RP2040-add-pwm-driver.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0029-RP2040-add-flow-control-to-SERIAL-object.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0030-RP2040-add-lp-and-us-timer.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0031-RP2040-implement-gpio_is_connected.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0032-RP2040-adapt-linker-script-to-mbed.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0033-RP2040-Start-adding-Flash-support.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0034-RP2040-Protect-flash-operations-in-critical-sections.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0035-RP2040-Check-alignment-avoid-passing-const-buf-to-fl.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0036-RP2040-Rename-pico-sdk-s-gpio_irq_handler-with-a-_-t.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0037-RP2040-Add-gpio-interrupt-support.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0038-RP2040-usb-fix-USB_DEVICE_ENUMERATION_FIX-linking.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0039-RP2040-usb-make-all-unhandled-conditions-a-no-op.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0040-RP2040-i2c-fix-addressing-mismatch.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0041-RP2040-SPI-check-SS-correctness-only-if-declared.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0042-RP2040-Add-I2C-slave.patch 
/home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0042-RP2040-Add-I2C-slave.patch:76: space before tab in indent.
            return;
warning: 1 line adds whitespace errors.
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0043-RP2040-PWM-fix-asserts.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0044-RP2040-nano-connect-fix-pinmap.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0045-RP2040-add-Raspberry-Pico-target.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0046-RP2040-fix-analogin_read_u16-to-report-full-range.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0047-RP2040-fix-PwmOut-enable-command.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0048-RP2040-Implement-watchdog.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0049-RP2040-Implement-reset-reasons.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0050-RP2040-fix-spi.h-spurious-inclusion-in-case-insensit.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0051-RP2040-UART-baud-can-t-be-changed-at-runtime.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0052-RP2040-i2c-remove-debug-prints.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0053-RP2040-PICO-Add-CONSOLE_-X-defines.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0054-RP2040-FLASH-fix-multipage-write.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0055-RP2040-fix-include-paths.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0056-RP2040-silence-nasty-warning.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0057-RP2040-start-fixing-CMake-files-for-mbed-cli-2.patch 
/home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0057-RP2040-start-fixing-CMake-files-for-mbed-cli-2.patch:39: space before tab in indent.
        .
warning: 1 line adds whitespace errors.
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0058-RP2040-fix-and-update-Raspberry-Pi-Pico-target.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0059-RP2040-USBPhy-implement-stall-and-unstall.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0060-RP2040-include-multicore-library-in-build.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0061-RP2040-USB-retry-handling-irqs-if-some-went-missing.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0062-Nano-RP2040-Connect-force-flash-size-to-16MB.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0063-Save-watchdog-timeout-in-a-static-variable-accessibl.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0064-RP2040-us_ticker-fix-missing-interrupts-after-32bit-.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0065-Nano-RP2040-connect-use-standard-W25Q080-2nd-stage.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0066-RP2040-optimize-flash-ram-occupation.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0067-RP2040-Add-weak-aliases-for-ISR-handlers.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0068-RP2040-enable-led-indication-on-mbed_die.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0069-check-MISO-correctness-only-if-it-is-declared.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0070-rp2040-Fix-I2CSlave-synchronization-issue-by-adding-.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0071-STM32-PWM-add-export-HRTIM-capable-pins-to-Periphera.patch 
/home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0071-STM32-PWM-add-export-HRTIM-capable-pins-to-Periphera.patch:88: trailing whitespace.

warning: 1 line adds whitespace errors.
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0072-STM32H7-add-HRTIM-capable-pins.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0073-STM32-PWM-implement-HRTIM-based-PWM-APIs.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0074-STM32-HRTIM-greatly-simplify-corner-cases.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0075-Portenta-PWM-force-PA8-to-use-HRTIM.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0076-STM32H7-CM4-avoid-vtor-relocation-via-define.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0077-STM32-analogin-use-critical-section-to-protect-PLL-c.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0078-PortentaH7-implement-and-use-get_default_instance-fo.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0079-PortentaH7-Disable-WHD-WPRINT_MACRO.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0080-Add-NICLA-target.patch 
/home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0080-Add-NICLA-target.patch:57: trailing whitespace.
/* 
/home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0080-Add-NICLA-target.patch:60: trailing whitespace.
 * 
/home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0080-Add-NICLA-target.patch:63: trailing whitespace.
 * 
/home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0080-Add-NICLA-target.patch:64: trailing whitespace.
 *   1. Redistributions of source code must retain the above copyright notice, this list 
/home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0080-Add-NICLA-target.patch:67: trailing whitespace.
 *   2. Redistributions in binary form, except as embedded into a Nordic Semiconductor ASA 
warning: squelched 9 whitespace errors
warning: 14 lines add whitespace errors.
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0081-NICLA-use-nfc-pins-as-GPIOs.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0082-Fix-cast-error-in-WHD.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0083-mbed-client-cli-ns_cmdline-make-cmd_class_t-cmd-priv.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0084-BlockDevice-add-mbed-namespace-to-function-signature.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0085-Use-ADC-clock-synchronous-with-AHB.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0086-RP2040-Add-basic-RTC-support.patch 
/home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0086-RP2040-Add-basic-RTC-support.patch:73: trailing whitespace.

/home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0086-RP2040-Add-basic-RTC-support.patch:76: trailing whitespace.
    } 
/home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0086-RP2040-Add-basic-RTC-support.patch:113: trailing whitespace.

warning: 3 lines add whitespace errors.
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0087-RP2040-Watchdog-get_reload_value-returns-0-if-wd-is-.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0088-RP2040-backport-p2040_usb_device_enumeration-fix.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0089-RP2040-correct-system-clock-frequency.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0090-Thales-mbed-library-porting.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0091-Implement-connect-and-get_context-functions-inside-G.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0092-Make-set_cid-protected-to-call-it-from-GEMALTO-stack.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0093-Implement-GEMALTO-subclass-of-CellularNetwork.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0094-Handle-missing-IP-address-resolution.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0095-Check-if-username-and-password-are-empty-strings.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0096-Overwrite-old-context-with-new-one-if-they-are-diffe.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0097-Fix-recv-implementation.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0098-Add-time-functions-to-Gemalto-stack.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0099-AT_CellularStack-return-NSAPI_ERROR_NO_CONNECTION-on.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0100-SerialBase-implement-sw-flow-control.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0101-GEMALTO-fix-some-corner-cases.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0102-Gemalto-properly-handle-SYSSTART-URC.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0103-Gemalto-TX62-handle-oob-before-closing-the-socket.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0104-GEMALTO-implement-GNSS.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0105-GEMALTO-TX62-tune-AT-configuration.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0106-Add-APIs-to-start-and-stop-gnss-functionality.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0107-Added-GNSS-Psm-management-and-bug-fixing.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0108-Implement-LNA_ENABLE-for-Thales-rev3.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0109-cmux-support.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0110-Implement-Udp_RemClient-for-TX62.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0111-Fix-HostByName-SISX-request.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0112-PwmOut-set-pwm-period-before-duty-cycle.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0113-Initial-add-Nicla-Vision-target.patch 
/home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0113-Initial-add-Nicla-Vision-target.patch:2382: trailing whitespace.
target_sources(mbed-portenta-whd-4343w-fw 
/home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0113-Initial-add-Nicla-Vision-target.patch:2404: trailing whitespace.
        port/wiced_filesystem.cpp 
/home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0113-Initial-add-Nicla-Vision-target.patch:2414: trailing whitespace.
/* 
/home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0113-Initial-add-Nicla-Vision-target.patch:2416: trailing whitespace.
 * The MAC address of the Wi-Fi device may be configured in OTP and/or in NVRAM. 
/home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0113-Initial-add-Nicla-Vision-target.patch:2417: trailing whitespace.
 * If both OTP and NVRAM contains the MAC address then OTP programmed MAC address will be used. 
warning: squelched 30 whitespace errors
warning: 35 lines add whitespace errors.
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0114-Nicla-Vision-Set-WiFi-as-default-interface.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0115-Nicla-Vision-enable-I2C_TIMING_VALUE_ALGO.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0116-Nicla-Vision-tune-LWIP-mem-size.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0117-Nicla-Vision-fix-wifi-bug-related-to-SDMMC2.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0118-Nicla-Vision-fix-LPUART-at-baudrates-higher-than-960.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0119-TEMP-Remove-log-from-.gitignore-file.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0120-Initial-import-of-plug-trust-library-to-COMPONENT_SE.patch 
/home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0120-Initial-import-of-plug-trust-library-to-COMPONENT_SE.patch:628: trailing whitespace.
Introduction on Plug & Trust Middleware Mini Package
/home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0120-Initial-import-of-plug-trust-library-to-COMPONENT_SE.patch:629: trailing whitespace.
====================================================================
/home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0120-Initial-import-of-plug-trust-library-to-COMPONENT_SE.patch:630: trailing whitespace.

/home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0120-Initial-import-of-plug-trust-library-to-COMPONENT_SE.patch:631: trailing whitespace.
Plug and Trust middleware mini package contains the minimum files required to
/home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0120-Initial-import-of-plug-trust-library-to-COMPONENT_SE.patch:632: trailing whitespace.
connect to SE05x using t1oi2c protocol. The package is tested on
warning: squelched 344 whitespace errors
warning: 349 lines add whitespace errors.
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0121-Port-sss-hostLib-to-mbed-os.patch 
/home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0121-Port-sss-hostLib-to-mbed-os.patch:904: trailing whitespace.
    if(se05x_i2c != NULL) 
/home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0121-Port-sss-hostLib-to-mbed-os.patch:914: trailing whitespace.
    if(se05x_i2c != NULL) 
/home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0121-Port-sss-hostLib-to-mbed-os.patch:937: new blank line at EOF.
+
warning: 3 lines add whitespace errors.
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0122-Do-not-build-ecdh.c-from-mbedtls-stack-if-MBEDTLS_EC.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0123-Enable-MBEDTLS-alternative-implementation-over-SSS.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0124-Enable-DEBUG-log-by-default.-To-disable-it-define-FL.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0125-Add-1ms-delays-to-let-communication-work-also-with-d.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0126-Make-i2c-and-resets-pin-configurable.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0127-Add-missing-__MBED__-define-to-avoid-build-mbedtls-k.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0128-Moved-COMPONENT_SE050-from-TARGET_PORTENTA_H7-to-STM.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0129-NICLA_VISION-Enable-component-SE050.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0130-NICLA_VISION-Add-configuration-macros-used-for-APDU-.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0131-NICLA_VISION-Add-configuration-for-reset-pin-and-i2c.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0132-NICLA_VISION-DISABLE-debug-log-with-FLOW_SILENT-macr.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0133-NICLA_VISION-Add-overload-for-TLSSocketWrapper-set_c.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0134-TLSSocketWrapper-store-SE050-keystore-pointer-and-ke.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0135-TLSSocketWrapper-Force-correct-cipher-suite-for-SE05.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0136-TLSSocketWrapper-Associate-SE050-ecdh-context-to-mbe.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0137-TLSSocketWrapper-Add-function-to-append-a-certificat.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0138-Initialize-sss_object-and-sss_keystore-to-nullptr.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0139-RP2040-fix-high-speed-uart-by-enabling-FIFO-timeout.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0140-Fix-Ethernet-pins-configuration.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0141-COMPONENT_SE050-Add-defines-to-exclude-DES-functions.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0142-Add-build-options-to-allow-to-disable-device-functio.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0143-MCUboot-PORTENTA_H7_M7-Change-ST-HAL-configuration-r.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0144-Add-build-option-to-allow-FATFS-customization-remove.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0145-Optimize-HAL_RCCEx_PeriphCLKConfig-using-only-HAL-en.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0146-MCUboot-PORTENTA_H7_M7-Remove-HSI-CSI-LSI-HSI48-supp.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0147-MCUBoot-PORTENTA_H7_M7-Add-linker-sections-to-store-.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0148-Add-build-option-DEVICE_SERIAL_FC-preventing-build-i.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0149-MCUboot-PORTENTA_H7_M7-Remove-FATFS-mkdir-and-rename.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0150-Fix-Only-return-true-for-uart_is_writeable-if-the-TX.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0151-MCUboot-PORTENTA_H7_M7-Remove-LittleFS-format-reform.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0152-MCUboot-PORTENTA_H7_Move-libc-rodata-after-bootloade.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0153-NICLA_VISION-Add-device-name-in-target.json.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0154-MCUboot-NICLA_VISION-linker-file-Reserve-space-for-k.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0155-ST-CAN-allow-sending-CAN-remote-frames.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0156-Add-Portenta-X8-target.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0157-PortentaX8-remove-MPU-support.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0158-Enable-Watchdog-for-ARDUINO_NANO33BLE.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0159-Enable-Watchdog-for-NICLA.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0160-Port-pico-sdk-1.3.0-initial.patch 
/home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0160-Port-pico-sdk-1.3.0-initial.patch:2232: trailing whitespace.
#define PICO_DEFAULT_I2C 1 
/home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0160-Port-pico-sdk-1.3.0-initial.patch:2238: trailing whitespace.
#define PICO_DEFAULT_I2C_SCL_PIN 7 
/home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0160-Port-pico-sdk-1.3.0-initial.patch:2263: trailing whitespace.
#define PICO_FLASH_SPI_CLKDIV 2 
/home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0160-Port-pico-sdk-1.3.0-initial.patch:2275: trailing whitespace.
#ifndef PICO_RP2040_B0_SUPPORTED 
/home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0160-Port-pico-sdk-1.3.0-initial.patch:2778: trailing whitespace.
#ifndef PICO_RP2040_B0_SUPPORTED 
warning: squelched 58 whitespace errors
warning: 63 lines add whitespace errors.
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0161-RP2040-add-placeholder-files.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0162-RP2040-Fix-multiple-definitions-errors-and-clashes.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0163-RP2040-Restore-previous-divider.S-to-avoid-including.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0164-RP2040-Prepend-_-to-clashing-functions-names.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0165-RP2040-Change-standard-interrupt-names-and-linker-sc.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0166-RP2040-i2c-read-modification-to-make-it-compliant-wi.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0167-RP2040-Change-uart-is_writable-logic-to-handle-FIFO.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0168-RP2040-don-t-initalize-contructors-during-runtime_in.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0169-RP2040-adapt-linker-script-to-mbed.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0170-RP2040-watchdog-return-timeout-value-in-ms.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0171-can-stm32-use-FDCAN_IT_RX_FIFO0_NEW_MESSAGE-for-RX-i.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0172-RP2040-align-gpio_irq_init-API-with-mainline.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0173-STM32H7-arduino-give-full-2MB-flash-for-pure-CM7-app.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0174-WHD-force-disconnect-on-roamed-due-to-low-RSSI.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0175-STM32-lpticker-allow-dynamic-configuration.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0176-Portenta-use-LSE-for-low-power-ticker.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0177-QSPI-make-_qspi-object-protected-to-allow-subclassin.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0178-STM32H747-linker-set-bootloader_info-section-for-all.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0179-STM32-RTC-allow-runtime-clock-source-selection.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0180-Increase-the-default-EAPOL-key-messages-timeout.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0181-Portenta-WHD-add-function-to-mount-wlan-firmware-fs-.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0182-STM32-fix-HRTIM-pwm-corner-cases-0-100.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0183-NiclaVision-WHD-add-function-to-mount-wlan-firmware-.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0184-Cellular-add-API-to-set-Modem-bands.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0185-STM32H7-set-ADC-PLL-clock-for-various-source-configu.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0186-Opta-initial-Add-target.patch 
/home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0186-Opta-initial-Add-target.patch:2497: trailing whitespace.
target_sources(mbed-portenta-whd-4343w-fw 
/home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0186-Opta-initial-Add-target.patch:2519: trailing whitespace.
        port/wiced_filesystem.cpp 
/home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0186-Opta-initial-Add-target.patch:2529: trailing whitespace.
/* 
/home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0186-Opta-initial-Add-target.patch:2531: trailing whitespace.
 * The MAC address of the Wi-Fi device may be configured in OTP and/or in NVRAM. 
/home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0186-Opta-initial-Add-target.patch:2532: trailing whitespace.
 * If both OTP and NVRAM contains the MAC address then OTP programmed MAC address will be used. 
warning: squelched 29 whitespace errors
warning: 34 lines add whitespace errors.
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0187-QSPI-Disable-fast-mode-for-vendor-ID-0xc22018.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0188-Opta-enable-power-save-mode-on-SDIO-CLK-pin.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0189-QSPI-call-is_mem_ready-before-trying-to-set-write-en.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0190-QSPI-add-Adesto-quirks-and-adapt-QSPIFBlockDevice-fu.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0191-Opta-fix-bootloader-info.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0192-Opta-WHD-add-function-to-mount-wlan-firmware-fs-from.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0193-stm32h747-linker-set-bootloader_version-sectionat-th.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0194-MCUboot-PORTENTA_H7-Tune-rodata-to-fit-flash.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0195-QSPI-apply-Adesto-quirk-only-for-AT25SF128A.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0196-STM32-USBDevice-fix-USB_FS-on-H7.patch 
/tmp/mbed-os-program
 done.
Restoring gdb info (this increases libmbed binary size, not suitable for release)
Updated 1 path from the index
/tmp/mbed-os-program
Compiling Mbed Application...[mbed] WARNING: Missing Python modules were not auto-installed.
       The Mbed OS tools in this program require the following Python modules: pyyaml, jsonschema, jinja2, mbed_ls, mbed_host_tests, mbed_greentea, pyelftools, pycryptodome, pyusb, cmsis_pack_manager, psutil, cryptography, click, cbor
       You can install all missing modules by running "pip install -r requirements.txt" in "/tmp/mbed-os-program/mbed-os"
       On Posix systems (Linux, etc) you might have to switch to superuser account or use "sudo"
---
Traceback (most recent call last):
  File "/tmp/mbed-os-program/mbed-os/tools/make.py", line 40, in <module>
    from tools.options import get_default_options_parser
  File "/tmp/mbed-os-program/mbed-os/tools/options.py", line 25, in <module>
    from .toolchains import TOOLCHAINS, EXTRA_TOOLCHAIN_NAMES
  File "/tmp/mbed-os-program/mbed-os/tools/toolchains/__init__.py", line 20, in <module>
    from . import mbed_toolchain, arm, gcc, iar
  File "/tmp/mbed-os-program/mbed-os/tools/toolchains/mbed_toolchain.py", line 48, in <module>
    from ..memap import MemapParser
  File "/tmp/mbed-os-program/mbed-os/tools/memap.py", line 34, in <module>
    from jinja2 import FileSystemLoader, StrictUndefined
ModuleNotFoundError: No module named 'jinja2'
[mbed] ERROR: "/home/rsalasidis/Arduino/hardware/arduino-git/mbed/virtenv/bin/python3" returned error.
       Code: 1
       Path: "/tmp/mbed-os-program"
       Command: "/home/rsalasidis/Arduino/hardware/arduino-git/mbed/virtenv/bin/python3 -u /tmp/mbed-os-program/mbed-os/tools/make.py -t GCC_ARM -m PORTENTA_H7_M7 --source . --build ./BUILD/PORTENTA_H7_M7/GCC_ARM -v"
---
(virtenv) rsalasidis@rsalasidis-Aspire-S7-391:~/Arduino/hardware/arduino-git/mbed$
trik commented 1 year ago

@salasidis some python modules are missing. use this requirements file to install all the dependencies https://github.com/ARMmbed/mbed-os/blob/master/requirements.txt

salasidis commented 1 year ago

Thanks, I see that now in the list. I have once upon a time used QNX about 25 yrs ago, but have not used any UNIX/Linux flavor since, so I am quite rusty - sorry.

I managed to install them - had to use 'sudo pip install -r requirements.txt'

Interestingly enough, it worked the first time, but if I try to install again, I get all sorts of errors - below is a short list of the start of the output

$ sudo pip install -r /home/Downloads/requirements.txt
Traceback (most recent call last):
  File "/usr/bin/pip", line 11, in <module>
    load_entry_point('pip==20.0.2', 'console_scripts', 'pip')()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 490, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2854, in load_entry_point
    return ep.load()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2445, in load
    return self.resolve()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2451, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib/python3/dist-packages/pip/_internal/cli/main.py", line 10, in <module>
    from pip._internal.cli.autocompletion import autocomplete
  File "/usr/lib/python3/dist-packages/pip/_internal/cli/autocompletion.py", line 9, in <module>
    from pip._internal.cli.main_parser import create_main_parser
  File "/usr/lib/python3/dist-packages/pip/_internal/cli/main_parser.py", line 7, in <module>
    from pip._internal.cli import cmdoptions
  File "/usr/lib/python3/dist-packages/pip/_internal/cli/cmdoptions.py", line 24, in <module>
    from pip._internal.exceptions import CommandError

In any case, when I try to run the ./mbed-os-to-arduino script again I also get a variable output - after running a few times, I now get this

$ ./mbed-os-to-arduino -a -g PORTENTA_H7_M7:PORTENTA_H7_M7

MBED_CLEAN=0
MBED_UPDATE=0
APPLY_PATCHES=1
RESTORE_GDB_INFO=1
LOCAL_REPO=
REMOTE_BRANCH=
MBED_CORE_LOCATION=/home/rsalasidis/Arduino/hardware/arduino-git/mbed

VARIANT=PORTENTA_H7_M7 BOARD=PORTENTA_H7_M7
Checking for prerequisites... done.
Creating MbedOS Application... done.
Checking out preferred 'mbed-os' version... done.
Setting up Mbed Application...[mbed] Working path "/tmp/mbed-os-program" (program)
[mbed] PORTENTA_H7_M7 now set as default target in program "mbed-os-program"
[mbed] Working path "/tmp/mbed-os-program" (program)
[mbed] GCC_ARM now set as default toolchain in program "mbed-os-program"
 done.
Applying patches...git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0001-PACKAGING-remove-gdb-exta-information-to-slim-librar.patch 
error: patch failed: tools/profiles/develop.json:5
error: tools/profiles/develop.json: patch does not apply
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0002-Portenta-enable-certificates-in-filesystem.patch 
error: patch failed: targets/targets.json:3428
error: targets/targets.json: patch does not apply
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0003-I2CSlave.read-buf-count-returns-the-number-of-bytes-.patch 
error: patch failed: drivers/include/drivers/I2CSlave.h:172
error: drivers/include/drivers/I2CSlave.h: patch does not apply
error: patch failed: drivers/source/I2CSlave.cpp:52
error: drivers/source/I2CSlave.cpp: patch does not apply
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0004-Add-AnalogIn-configure-function.patch 
error: patch failed: drivers/include/drivers/AnalogIn.h:88
error: drivers/include/drivers/AnalogIn.h: patch does not apply
error: patch failed: hal/include/hal/analogin_api.h:33
error: hal/include/hal/analogin_api.h: patch does not apply
error: patch failed: targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/analogin_api.c:122
error: targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/analogin_api.c: patch does not apply
error: patch failed: targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/objects.h:50
error: targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/objects.h: patch does not apply
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0005-HACK-avoid-10862-by-not-firing-the-assert.patch 
error: patch failed: drivers/usb/source/USBDevice.cpp:980
error: drivers/usb/source/USBDevice.cpp: patch does not apply
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0006-portentaH7-Change-BLE-public-address.patch 
/home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0006-portentaH7-Change-BLE-public-address.patch:21: trailing whitespace.
            uint8_t bdAddr[6] = { 0xFF, 0xFF, 0xFF, 0x0A, 0x61, 0xA8 }; 
error: patch failed: connectivity/drivers/ble/FEATURE_BLE/COMPONENT_CYW43XXX/HCIDriver.cpp:378
error: connectivity/drivers/ble/FEATURE_BLE/COMPONENT_CYW43XXX/HCIDriver.cpp: patch does not apply
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0007-TLSSocketWrapper-add-method-to-retrieve-certificates.patch 
error: patch failed: connectivity/mbedtls/source/x509_crt.c:74
error: connectivity/mbedtls/source/x509_crt.c: patch does not apply
error: patch failed: connectivity/netsocket/include/netsocket/TLSSocketWrapper.h:116
error: connectivity/netsocket/include/netsocket/TLSSocketWrapper.h: patch does not apply
error: patch failed: connectivity/netsocket/source/TLSSocketWrapper.cpp:136
error: connectivity/netsocket/source/TLSSocketWrapper.cpp: patch does not apply
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0008-TLSSocketWrapper-Add-unit-test-for-set_root_ca_cert_.patch 
error: patch failed: connectivity/nanostack/coap-service/test/coap-service/unittest/stub/mbedtls_stub.c:303
error: connectivity/nanostack/coap-service/test/coap-service/unittest/stub/mbedtls_stub.c: patch does not apply
error: patch failed: connectivity/netsocket/tests/UNITTESTS/netsocket/TLSSocketWrapper/test_TLSSocketWrapper.cpp:399
error: connectivity/netsocket/tests/UNITTESTS/netsocket/TLSSocketWrapper/test_TLSSocketWrapper.cpp: patch does not apply
error: patch failed: connectivity/netsocket/tests/UNITTESTS/netsocket/TLSSocketWrapper/tls_test_config.h:19
error: connectivity/netsocket/tests/UNITTESTS/netsocket/TLSSocketWrapper/tls_test_config.h: patch does not apply
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0009-TLSSocketWrapper-add-test-for-certificates-stored-in.patch 
error: patch failed: connectivity/netsocket/tests/TESTS/netsocket/tls/main.cpp:234
error: connectivity/netsocket/tests/TESTS/netsocket/tls/main.cpp: patch does not apply
error: patch failed: connectivity/netsocket/tests/TESTS/netsocket/tls/tls_tests.h:89
error: connectivity/netsocket/tests/TESTS/netsocket/tls/tls_tests.h: patch does not apply
error: connectivity/netsocket/tests/TESTS/netsocket/tls/tlssocket_cert_in_filesystem.cpp: already exists in working directory
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0010-Initial-support-Portenta-Beta.patch 
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0011-STM32-USB-allow-dynamic-USB-speed-configuration-base.patch 
error: patch failed: targets/TARGET_STM/USBPhy_STM32.cpp:217
error: targets/TARGET_STM/USBPhy_STM32.cpp: patch does not apply
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0012-Increase-Cordio-memory-pool-for-nRF52832.patch 
error: patch failed: connectivity/drivers/ble/FEATURE_BLE/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/mbed_lib.json:8
error: connectivity/drivers/ble/FEATURE_BLE/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/mbed_lib.json: patch does not apply
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0013-Cordio-Add-sendCmplt-Callback-for-updating-NumCmplPc.patch 
error: patch failed: connectivity/FEATURE_BLE/libraries/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_conn.c:514
error: connectivity/FEATURE_BLE/libraries/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_conn.c: patch does not apply
git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0014-Add-support-for-Arduino-Edge-Control.patch 
/home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0014-Add-support-for-Arduino-Edge-Control.patch:139: trailing whitespace.

/home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0014-Add-support-for-Arduino-Edge-Control.patch:182: trailing whitespace.
salasidis commented 1 year ago

This is the content of the 0001-PACKAGING... file

From 3d7f8d18abca4e6132611fe544bf94b5d3483af3 Mon Sep 17 00:00:00 2001
From: Martino Facchin <m.facchin@arduino.cc>
Date: Thu, 11 Mar 2021 15:05:20 +0100
Subject: [PATCH 001/157] PACKAGING: remove gdb exta information to slim
 library

---
 tools/profiles/develop.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/profiles/develop.json b/tools/profiles/develop.json
index 21ba5c88d5..5995d276e4 100644
--- a/tools/profiles/develop.json
+++ b/tools/profiles/develop.json
@@ -5,7 +5,7 @@
                    "-fmessage-length=0", "-fno-exceptions",
                    "-ffunction-sections", "-fdata-sections", "-funsigned-char",
                    "-MMD",
-                   "-fomit-frame-pointer", "-Os", "-g", "-DMBED_TRAP_ERRORS_ENABLED=1"],
+                   "-fomit-frame-pointer", "-Os", "-DMBED_TRAP_ERRORS_ENABLED=1"],
         "asm": ["-c", "-x", "assembler-with-cpp"],
         "c": ["-c", "-std=gnu11"],
         "cxx": ["-c", "-std=gnu++14", "-fno-rtti", "-Wvla"],
-- 
2.36.0

I cd to /tmp/mbed-os-program/mbed-os

In ./tools/profiles from that directory the develop.json file is there

These are the files present in that directory debug.json develop.json extensions release.json

When I execute the git apply command, I get the following

git apply /home/rsalasidis/Arduino/hardware/arduino-git/mbed/patches/0001-PACKAGING-remove-gdb-exta-information-to-slim-librar.patch
error: patch failed: tools/profiles/develop.json:5
error: tools/profiles/develop.json: patch does not apply

No difference if I execute it as sudo

Still lost unfortunately - Thanks for any further help

facchinm commented 1 year ago

Hi @salasidis , I think the missing dependencies messed up with the script a bit. Before retrying running mbed-os-to-arduino, make sure to delete /tmp/mbed-os-program folder, so the next run will not use the cached version of mbed-os but will clone a new one and likely checkout latest branch (which is the only one where the patches apply correctly).

About bundling the patches with the released version of the core there's an issue already opened here https://github.com/arduino/ArduinoCore-mbed/issues/587 that may contains some information to get you unstuck

salasidis commented 1 year ago

Thanks for taking the time. That did help in getting the compiler to continue running again. There were some more dependencies and the like I had to install, but it eventtually says

[mbed-os-to-arduino] MbedOS core generation ended succesfully.

In case others are interested, I created a file that has the steps I took in order to get it to work

•   Install wsl2 ubuntu and desktop

•   https://medium.com/@riley.kao/wsl2-ubuntu20-04-gui-remote-desktop-connection-rdp-2bbd21d2fa71

•   Install Arduino IDE via image from Arduino.cc

•   Install and Start xrdp
•   sudo apt-get purge xrdp
•   sudo apt-get install xrdp
•   sudo apt-get install xfce4
•   sudo apt-get install xfce4-goodies    

•   sudo cp /etc/xrdp/xrdp.ini /etc/xrdp/xrdp.ini.bak
•   sudo sed -i 's/3389/3390/g' /etc/xrdp/xrdp.ini
•   sudo sed -i 's/max_bpp=32/#max_bpp=32\nmax_bpp=128/g' /etc/xrdp/xrdp.ini
•   sudo sed -i 's/xserverbpp=24/#xserverbpp=24\nxserverbpp=128/g' /etc/xrdp/xrdp.ini
•   echo xfce4-session > ~/.xsession

•   sudo nano /etc/xrdp/startwm.sh
•   comment these lines to:
•   #test -x /etc/X11/Xsession && exec /etc/X11/Xsession
•   #exec /bin/sh /etc/X11/Xsession

•   add these lines:
•   # xfce
•   startxfce4

•   sudo /etc/init.d/xrdp start 

o   sudo /etc/init.d/xrdp start

          # check xrdp status (optional)
          sudo /etc/init.d/xrdp status

•   Create virtual environment
o   [How to Create and Activate Virtual Environment In Linux ? | by Baleshwar Mahto | Medium](https://baleshwar-mahto.medium.com/how-to-create-and-activate-virtual-environment-in-linux-b3c68d4d60fb)
o   source bin/activate

•   Add ssh key to github
o   https://www.theserverside.com/blog/Coffee-Talk-Java-News-Stories-and-Opinions/GitHub-SSH-Key-Setup-Config-Ubuntu-Linux

•   add requirements in new dependency
o   https://github.com/ARMmbed/mbed-os/blob/master/requirements.txt
o   pip install -r requirements.txt

•   install npm xpm
o   install npm – sudo apt install npm
o   sudo npm install –global xpm@latest

•   Install Compilers
o   sudo apt install libc6-armel-cross libc6-dev-armel-cross binutils-arm-linux-gnueabi libncurses5-dev build-essential bison flex libssl-dev bc
o   (not sure above one is necessary – but that is the order I did it)
o   sudo apt-get install gcc-arm*

•   Install mbed
o   [Install and set up - Build tools | Mbed OS 6 Documentation](https://os.mbed.com/docs/mbed-os/v6.15/build-tools/install-and-set-up.html)

•   Install iq
o   sudo apt install jq 

•   Install steps from [arduino/ArduinoCore-mbed (github.com)](https://github.com/arduino/ArduinoCore-mbed#mbed-os-to-arduino-script)
o   mkdir -p $sketchbook/hardware/arduino-git
o   cd $sketchbook/hardware/arduino-git
o   git clone git@github.com:arduino/ArduinoCore-mbed mbed
o   -
o   git clone git@github.com:arduino/ArduinoCore-API
o   –
o   Make a symbolic link in the mbed directory of the ArduinoCore-API/api directory
   Easiest to use GUI and Shift/Ctrl and drag one directory to the other

o   Go to mbed directory 
o   cd $sketchbook/hardware/arduino-git/mbed
o   sudo ./mbed-os-to-arduino -a -g PORTENTA_H7_M7:PORTENTA_H7_M7

remember to 'sudo rm -r -f /tmp/mbed-os-program' between every compile (or compile attempt)

And with any luck, that should work