LoginSignup
0
0

Mbed OS 5をPlatformIOでビルドしたときにdarwin_arm64で怒られる時の対処法

Last updated at Posted at 2023-12-19

問題

こちらの記事を参考にMbed OS 5のコードをやろうと思ったが、このようなエラーが出て動かない。

/Users/shirokuma89dev/.platformio/penv/lib/python3.9/site-packages/urllib3/__init__.py:34: NotOpenSSLWarning: urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'LibreSSL 2.8.3'. See: https://github.com/urllib3/urllib3/issues/3020
  warnings.warn(

Resolving nucleo_f446re dependencies...
Tool Manager: Installing platformio/framework-mbed @ 6.51504.200716
UnknownPackageError: Could not find the package with 'platformio/framework-mbed @ 6.51504.200716' requirements for your system 'darwin_arm64'

私の環境

shirokuma89dev@shiro89dev.local 
------------------------------- 
OS: macOS 14.2 23C64 arm64 
Host: Mac14,2 
Kernel: 23.2.0 
Uptime: 4 days, 6 hours, 28 mins 
Packages: 57 (brew) 
Shell: zsh 5.9 
Resolution: 2560x1440 
DE: Aqua 
WM: Quartz Compositor 
WM Theme: Blue (Dark) 
Terminal: vscode 
CPU: Apple M2 
GPU: Apple M2 
Memory: 4918MiB / 24576MiB 
% pio --version                             
PlatformIO Core, version 6.1.11
% python3 --version
Python 3.12.0

解決策

platformio.iniに以下を追記する。すでにplatform_packagesが書いてある人は消してこれに上書きする。

platform_packages =
   	framework-mbed@~6.51506.231105

原因

あまり詳しくはわかっていないが6.51504.200716がレガシーすぎてarmに対応していないっぽい?Rosetta入れたりしたけどダメでした。

これにたどり着いた経緯

こちらのにあるMbed OS 5の最新版が6.51506.231105で先月(2023/12/20現在)だったので、書き換えたらなんかうまくいきました。

終わりに

Apple SiliconのMacBookでロボカップとかの競技をやる人がだんだん増えてきたと思うので、レガシーコードを動かすときに役に立てば嬉しいです。

これはどちらかというと暫定的措置なので、現在メインのプロジェクトをMbed OS 5でやってる人は面倒かもしれませんが6に移行することを検討した方がいいと思います。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0