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

[Rev 3] SPI Hardware NSS Pulse config issue

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

メンテナーはふだん 3 日以内に返信

@MasterUser43 がすでに取り組んでいます。

2026年8月5日 から。

評価

この issue はまだ評価されていません。

説明

bug

Version/Project: Flight Computer rev3

Describe the bug
Currently, SPI1 (IMU) and SPI3 (LoRa) are configured in CubeMX to use Hardware NSS management.
Looking at main.c, this results in the following configurations:

  • hspi.Init.NSS = SPI_NSS_HARD_OUTPUT;
  • hspi.Init.NSSPMode = SPI_NSS_PULSE_ENABLE;

Given LoRa and IMU approach to DMA w.r.t. how Chip Select is handled, current .ioc NSS Pulse Mode automatically drives the Chip Select line HIGH for one clock cycle between every single transmitted byte. Respective DMA implementations were intended to follow datasheet guidelines for each developed file:

  • The LSM6DSV320X (IMU) datasheet requires CS to be held low for the entire duration of a multi-byte FIFO read.
  • The RFM95 (LoRa) datasheet (Page 75) explicitly states: "The NSS pin goes low at the beginning of the frame and stays low between each byte."

Because of this hardware pulsing, we cannot use DMA to burst-read the IMU or LoRa FIFOs. The peripherals will see the CS pulse, assume the transaction was aborted, and return garbage data.

Luckily, this is an easy fix to be implemented/considered during integration phases of drivers. It is simple .ioc edit. Only holding off this personally b/c aforementioned integration concerns.

  1. Connectivity -> SPI1 and SPI3.
  2. Change Hardware NSS Signal to Disable.
  3. In the Pinout View, make physical pins currently assigned to the IMU and LoRa Chip Selects and change them to standard GPIO_Output.
  4. In System Core -> GPIO, configure these two pins as:
    • Output Level: High (to keep the chips off at boot)
    • Mode: Output Push Pull
    • Pull-up/Pull-down: Pull-up
    • Maximum output speed: Very High

This will return Init.NSS to SPI_NSS_SOFT in main.c, allowing driver callbacks (HAL_GPIO_WritePin) to properly hold the Chip Select low during multi-byte DMA transfers.

To Reproduce
Not applicable

Expected behavior
Prevent junk data from false Chip Select config

Screenshots/Pictures/Video
If applicable, add screenshots to help explain your problem.

Image

Additional context
Add any other context about the problem here.

Points of Contact
@MasterUser43
Add a tag for the component owners, leads, and/or a senior engineer to serve as primary point of contact.

主要言語
C
スター
8
フォーク
6
平均マージ
5日 6時間
マージ済み PR(30日)
5

環境構築

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

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

SunDevilRocketry/Flight-Computer-Firmware のほかの issue

SunDevilRocketry/Flight-Computer-Firmware の issue をすべて見る

似ている issue

C の issue をもっと見る

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

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