Skip to content

Recompiling Mbed Os as library with cygwin #570

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

Closed
aqw42 opened this issue Oct 26, 2022 · 2 comments
Closed

Recompiling Mbed Os as library with cygwin #570

aqw42 opened this issue Oct 26, 2022 · 2 comments

Comments

@aqw42
Copy link

aqw42 commented Oct 26, 2022

Under Windows 10, with a portenta machine control
The core doesn't recompile automatically if you modify it. SO you need to compile it manually. The issue is that it can't recompile using only cygwin. Here is the procedure I used to still be able to compile it :

Issue :

  • manually modify the mbed_app.json (located under Arduino15\packages\arduino\hardware\mbed_portenta\3.3.0\variants\PORTENTA_H7_M7\conf\mbed_app.json)
  • try to execute './mbed-os-to-arduino -a PORTENTA_H7_M7:PORTENTA_H7_M7'
  • 'mbed-cli compile' will not execute because the dependency "pstool" is not available with Cygwin

Workaround :

  • manually install windows mbed-cli (installer available here)

  • manually install python3

  • modify the mbed-os-to-arduino script line 141
    cmd /c "set PATH=%PATH%;C:\mbed-cli\mbed-cli\mbed-cli-1.8.3\mbed; & mbed compile $PROFILE_FLAG --source . -v "\ | tee >(cat | grep 'Compile \[' >&2) | grep "Macros:" > "$BOARDNAME".macros.txt echo " done."
    (You can modify all the calls to mbed in the script the same way)(there are only 5 of them)

  • execute ./mbed-os-to-arduino -a PORTENTA_H7_M7:PORTENTA_H7_M7 from cygwin

  • The script complains that dependencies are not installed. Open CMD, and got to C:\cygwin64\tmp\mbed-os-program\mbed-os

  • Execute pip install -r requirements.txt --user

  • go back to cygwin, and re-execute mbed-os-to-arduino script. It will now compile successfully.

I stumbled across this as I tried to use lwip library, which needed me to manually set some variables in the JSON. Hope this could help someone else, have a nice day !

@aqw42
Copy link
Author

aqw42 commented Oct 26, 2022

Should I set the issue as closed, as I don't require any particular change ?
If you want me to post this somewhere else, please ask.
I didn't know where to post that, but I felt like that could help someone (even me if I forget how to do it in a few months, lol)

@aqw42
Copy link
Author

aqw42 commented Dec 13, 2022

If the compilation doesn't work, see this issue : #587

You have to clone the whole repo, and copy-paste the "patchs" folder in Arduino15\packages\arduino\hardware\mbed_portenta

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