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?

pico_flash ライブラリで PICO_ERROR_NOT_PERMITTED が発生した場合の対処方法

Last updated at Posted at 2025-09-13

はじめに

Raspberry Pi Pico には pico_flash という Flash メモリを扱う関数が存在している。

hardware_flash のサンプルプログラムを実行したところ、PICO_ERROR_NOT_PERMITTED が発生した。

私の環境では、littlefs を簡易に利用したかったため、 pico-jxglib を利用していたが、この場合だと FS::Format でエラーが発生する。

海外記事も含めて解決策がなかったので、記録に残す。

原因

原因は、ハードウェアがマルチコアで動作している、かつ、コアが安全に初期化されていないことが原因だった。

今回の場合、マルチコア処理は不要である。
その場合でも、マルチコア動作していたため、上記のエラーが発生していた。

解決方法

解決するためには CMakeList.txt の修正が必要となる。

# Add the standard library to the build
target_link_libraries(EasyOnetimeCode
        pico_stdlib
        # pico_multicore
        pico_unique_id 
        pico_sha256 
        pico_flash
        pico_rand
        )

link するライブラリに pico_multicore が入っており、これが原因でマルチコア動作していることが原因だった。

pico_multicore をコメントアウトしたことで解決した。

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?