0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Spreseneseの独自Arduinoパッケージを作るときの注意点

Last updated at Posted at 2024-05-16

Spresenseは、Arduino環境でも使えて、SDKになれていない人には触りやすいですよね?
でも、公式からリリースされた機能で固定されたパッケージをでの運用になるので、ちょっと変わったことをやろうとした場合、独自のパッケージを作る必要があります。

この独自パッケージの作り方も、実は、こちらに載っています。

これに従って独自に、コード修正やKernelのコンフィグレーションを変更して、パッケージを作ることができ、このパッケージを他の人にも渡すことができます。

ただ、この時、コンフィグレーションで、新しい機能を追加した場合、SDKのライブラリのアーカイブに、新しい lib???.a が追加されることがあります。

このライブラリは、Arduinoのローカルパッケージをインストールした場合、

*C:\Users\(ユーザ名)\AppData\Local\Arduino15\packages\SPRESENSE_(パッケージ名)\tools\spresense-sdk\(バージョン)\spresense\release\nuttx\libs`

の下などに追加されますが、そのままではリンクされず、リンクエラーになってしまいます。

これは、Arduino の elfのリンクが、実は、このファイルに従っているためで、

spresense-arduino-compatible/Arduino15/packages/SPRESENSE/hardware/spresense/1.0.0/boards.txt

これに、必要なアーカイブを追記する必要があります。

spresense.menu.Core.Main.build.libs="{build.libpath}/libapps.a" "{build.libpath}/libarch.a" "{build.libpath}/libarm_cortexM4lf_math.a" "{build.libpath}/libaudio.a" "{build.libpath}/libbinfmt.a" "{build.libpath}/libboard.a" "{build.libpath}/libboards.a" "{build.libpath}/libc.a" "{build.libpath}/libcmsis_nn.a" "{build.libpath}/libdrivers.a" "{build.libpath}/libfs.a" "{build.libpath}/libmm.a" "{build.libpath}/libnet.a" "{build.libpath}/libnnablart.a" "{build.libpath}/libsched.a" "{build.libpath}/libsslutils.a" "{build.libpath}/libxx.a" "{build.libpath}/libmossfw.a" "{build.libpath}/libnrf52.a" "{build.libpath}/libuecc.a" "{build.libpath}/(新しいライブラリ)"
spresense.menu.Core.Sub1.build.libs="{build.libpath}/libapps.a" "{build.libpath}/libarch.a" "{build.libpath}/libarm_cortexM4lf_math.a" "{build.libpath}/libbinfmt.a" "{build.libpath}/libboard.a" "{build.libpath}/libboards.a" "{build.libpath}/libc.a" "{build.libpath}/libcmsis_nn.a" "{build.libpath}/libdrivers.a" "{build.libpath}/libfs.a" "{build.libpath}/libmm.a" "{build.libpath}/libsched.a" "{build.libpath}/libxx.a" "{build.libpath}/(新しいライブラリ)"
spresense.menu.Core.Sub2.build.libs="{build.libpath}/libapps.a" "{build.libpath}/libarch.a" "{build.libpath}/libarm_cortexM4lf_math.a" "{build.libpath}/libbinfmt.a" "{build.libpath}/libboard.a" "{build.libpath}/libboards.a" "{build.libpath}/libc.a" "{build.libpath}/libcmsis_nn.a" "{build.libpath}/libdrivers.a" "{build.libpath}/libfs.a" "{build.libpath}/libmm.a" "{build.libpath}/libsched.a" "{build.libpath}/libxx.a" "{build.libpath}/(新しいライブラリ)"
spresense.menu.Core.Sub3.build.libs="{build.libpath}/libapps.a" "{build.libpath}/libarch.a" "{build.libpath}/libarm_cortexM4lf_math.a" "{build.libpath}/libbinfmt.a" "{build.libpath}/libboard.a" "{build.libpath}/libboards.a" "{build.libpath}/libc.a" "{build.libpath}/libcmsis_nn.a" "{build.libpath}/libdrivers.a" "{build.libpath}/libfs.a" "{build.libpath}/libmm.a" "{build.libpath}/libsched.a" "{build.libpath}/libxx.a" "{build.libpath}/(新しいライブラリ)”
spresense.menu.Core.Sub4.build.libs="{build.libpath}/libapps.a" "{build.libpath}/libarch.a" "{build.libpath}/libarm_cortexM4lf_math.a" "{build.libpath}/libbinfmt.a" "{build.libpath}/libboard.a" "{build.libpath}/libboards.a" "{build.libpath}/libc.a" "{build.libpath}/libcmsis_nn.a" "{build.libpath}/libdrivers.a" "{build.libpath}/libfs.a" "{build.libpath}/libmm.a" "{build.libpath}/libsched.a" "{build.libpath}/libxx.a" "{build.libpath}/(新しいライブラリ)"
spresense.menu.Core.Sub5.build.libs="{build.libpath}/libapps.a" "{build.libpath}/libarch.a" "{build.libpath}/libarm_cortexM4lf_math.a" "{build.libpath}/libbinfmt.a" "{build.libpath}/libboard.a" "{build.libpath}/libboards.a" "{build.libpath}/libc.a" "{build.libpath}/libcmsis_nn.a" "{build.libpath}/libdrivers.a" "{build.libpath}/libfs.a" "{build.libpath}/libmm.a" "{build.libpath}/libsched.a" "{build.libpath}/libxx.a" "{build.libpath}/(新しいライブラリ)"

このように追記することで、ようやく、buildができるようになります。

この記事は、以下のブログからの転載です。
http://spresense.livedoor.blog/archives/35790109.html

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?