Skip to content

Packaged core doesn't ship with patches folder #587

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

Open
aqw42 opened this issue Dec 5, 2022 · 5 comments
Open

Packaged core doesn't ship with patches folder #587

aqw42 opened this issue Dec 5, 2022 · 5 comments
Labels
enhancement New feature or request

Comments

@aqw42
Copy link

aqw42 commented Dec 5, 2022

Hello !
Another issue with mbed Core

Operating system: ParrotOS Debian Based -> 5.18.0-14parrot1-amd64
Compiling command:
arduino-cli compile test -b arduino:mbed_portenta:envie_m7 -v
Arduino mbed version : 3.4.1
Ino file:
test/test.ino

#include <Arduino.h>

void setup()
{

}

void loop()
{}

At first it compiles fine, but when i recompile mbed it crashes. (The install is clean i deleted and reinstalled everything)
Compiling command :
./mbed-os-to-arduino -a PORTENTA_H7_M7:PORTENTA_H7_M
from directory :
/home/chickpea/.arduino15/packages/arduino/hardware/mbed_portenta/3.4.1

The Mbed compilation works just fine, but when i recompile test here is the error :

/home/chickpea/.arduino15/packages/arduino/hardware/mbed_portenta/3.4.1/variants/PORTENTA_H7_M7/variant.cpp:245:14: error: 'mbed::QSPI QSPIFBlockDevice::_qspi' is private within this context
       ret &= _qspi.command_transfer(0xB1, -1, nullptr, 0, nullptr, 0);
              ^~~~~
In file included from /home/chickpea/.arduino15/packages/arduino/hardware/mbed_portenta/3.4.1/variants/PORTENTA_H7_M7/variant.cpp:239:0:
/home/chickpea/.arduino15/packages/arduino/hardware/mbed_portenta/3.4.1/cores/arduino/mbed/storage/blockdevice/COMPONENT_QSPIF/include/QSPIF/QSPIFBlockDevice.h:344:16: note: declared private here
     mbed::QSPI _qspi;
                ^~~~~
/home/chickpea/.arduino15/packages/arduino/hardware/mbed_portenta/3.4.1/variants/PORTENTA_H7_M7/variant.cpp:247:14: error: 'mbed::QSPI QSPIFBlockDevice::_qspi' is private within this context
       ret &= _qspi.command_transfer(0xC1, -1, nullptr, 0, nullptr, 0);
              ^~~~~
In file included from /home/chickpea/.arduino15/packages/arduino/hardware/mbed_portenta/3.4.1/variants/PORTENTA_H7_M7/variant.cpp:239:0:
/home/chickpea/.arduino15/packages/arduino/hardware/mbed_portenta/3.4.1/cores/arduino/mbed/storage/blockdevice/COMPONENT_QSPIF/include/QSPIF/QSPIFBlockDevice.h:344:16: note: declared private here
     mbed::QSPI _qspi;
                ^~~~~

I did this because it fails with my build, with a bunch of other errors from variant.cpp and from MBedTLS.cpp.
So i guess i'm doing this wrong, could anyone help ?
Thanks

@facchinm
Copy link
Member

facchinm commented Dec 5, 2022

Hi @aqw42 ,
that error is due to patch https://github.com/arduino/ArduinoCore-mbed/blob/master/patches/0177-QSPI-make-_qspi-object-protected-to-allow-subclassin.patch not being correctly applied; can you remove /tmp/mbed-os-program folder, relaunch the script ./mbed-os-to-arduino -a PORTENTA_H7_M7:PORTENTA_H7_M7 and paste the compilation output here? Thx

@aqw42
Copy link
Author

aqw42 commented Dec 7, 2022

I do not have access to my computer right now, i'll send you that on monday
Thanks for your help, I really appreciate that
Have a nice week

@aqw42
Copy link
Author

aqw42 commented Dec 12, 2022

Hello,
here is the output

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

VARIANT=PORTENTA_H7_M7 BOARD=PORTENTA_H7_M7
Checking for prerequisites... done.
Creating MbedOS Application...[mbed] Working path "/tmp" (directory)
[mbed] Creating new program "mbed-os-program" (git)
[mbed] Adding library "mbed-os" from "https://github.com/ARMmbed/mbed-os" at branch/tag "latest"
[mbed] Updating reference "mbed-os" -> "https://github.com/ARMmbed/mbed-os/#54e8693ef4ff7e025018094f290a1d5cf380941f"
[mbed] Auto-installing missing Python modules (urllib3, requests, jinja2, cryptography, click)...
 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.
Compiling Mbed Application... done.
Generating defines... done.
Generating includes... copying to destination... /tmp/mbed-os-program
 done.
Generating libs... done.
Generating flags...Patching '-fno-exceptions' flag for /home/chickpea/.arduino15/packages/arduino/hardware/mbed_portenta/3.4.1/variants/PORTENTA_H7_M7/cflags.txt
Adding OpenAMP section to /home/chickpea/.arduino15/packages/arduino/hardware/mbed_portenta/3.4.1/variants/PORTENTA_H7_M7/linker_script.ld
Patching linker scripts
Patching '-fno-exceptions' flag for /home/chickpea/.arduino15/packages/arduino/hardware/mbed_portenta/3.4.1/variants/PORTENTA_H7_M7/cxxflags.txt
Patching linker scripts
Patching '-fno-exceptions' flag for /home/chickpea/.arduino15/packages/arduino/hardware/mbed_portenta/3.4.1/variants/PORTENTA_H7_M7/ldflags.txt
Patching linker scripts
 done.
Copying generic MbedOS headers to core...  done.
Patching 'mbed.h'... done.
Patching SPI headers... done.

[...]
Compile [100.0%]: stm_spi_api.c

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

@aqw42
Copy link
Author

aqw42 commented Dec 12, 2022

I also tried using the options -c and -u, did not fix

@facchinm
Copy link
Member

Ah, I found the problem. Basically, the released package doesn't contain the patches folder, so -a has no effect.
I always launched the script from the git repo so never encountered the problem.
@manchoz could it be worth to package also that folder in the release archive?

@facchinm facchinm added enhancement New feature or request and removed waiting for feedback labels Dec 12, 2022
@facchinm facchinm changed the title Mbed-OS-to-arduino breaks the compilation Packaged core doesn't ship with patches folder Dec 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants