Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

FS doesnt seem to work from BLE service - FileOpen, DirOpen etc

オープン
#2,262 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
30/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
cpp
領域
embedded-iot

調査の方向性

まず、TestService のコードを組み込みの Settings サービスおよびコントローラーと比較し、次に BLE サービス内での FS.FileOpen、FS.DirOpen、NimbleController の動作を調べます。F:/ パスと / パスのケースを再現し、Infinisim および watch-face の動作と比較します。サービスがこれらのエラーを受け取る、またはクラッシュする理由を特定し、動作するアクセスパターンを文書化できれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Im trying to implement a data file in my BLE service loaded by NimbleController, using FS, but have encountered a brick wall.

When using "F:/events.dat", I am constantly getting errors back - either -2 (no entry), or -84 (corrupt).
When using "/events.dat", the device just crashes.

The same things are happening for DirOpen, using "F:/" and "/" paths respectively.

Im trying to follow whats being done in built in services and controllers, like Settings, which seem to work without issue. Also, my code works fine on Infinisim.

This issue does not occur if I transplant my code into an app like a watch face.

Am I doing something wrong here?

debug_log is a function ive defined for logging to the screen, defined much like printf.

void TestService::SaveEventsLog() {
  debug_log("app", "SaveEventsLog");

  lfs_file_t saveFile;

  int file_operation_result = fs.FileOpen(&saveFile, "F:/events.dat", LFS_O_WRONLY | LFS_O_CREAT);
  if (file_operation_result < LFS_ERR_OK) {
    debug_log("app", "saveFile open failed: %d", file_operation_result);

    if (file_operation_result == LFS_ERR_CORRUPT) {
      fs.FileDelete("F:/events.dat");
      debug_log("app", "saveFile corrupt - deleting");
    }
    return;
  }

  debug_log("app", "saveFile opened");

  struct SaveData {
    uint8_t version = 1;
    std::vector<EventLogEntry> data;
  } saveData;

  saveData.data = eventLog;

  file_operation_result = fs.FileWrite(&saveFile, reinterpret_cast<uint8_t*>(&saveData), sizeof(saveData));
  if (file_operation_result < LFS_ERR_OK) {
    debug_log("app", "saveFile write failed: %d", file_operation_result);
  } else {
    debug_log("app", "saveFile saved");
  }

  file_operation_result = fs.FileClose(&saveFile);
  if (file_operation_result < LFS_ERR_OK) {
    debug_log("app", "saveFile close failed: %d", file_operation_result);
  } else {
    debug_log("app", "saveFile closed");
  }
}
主要言語
C
スター
3.4k
フォーク
1.1k
平均マージ
23時間 18分
マージ済み PR(30日)
1

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

InfiniTimeOrg/InfiniTime のほかの issue

InfiniTimeOrg/InfiniTime の issue をすべて見る

似ている issue

C の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。