Skip to content

[kvdb] Support 256bit write granularity for kvdb#396

Open
Baseline-K wants to merge 3 commits intoarmink:masterfrom
Baseline-K:kvdb_256bit
Open

[kvdb] Support 256bit write granularity for kvdb#396
Baseline-K wants to merge 3 commits intoarmink:masterfrom
Baseline-K:kvdb_256bit

Conversation

@Baseline-K
Copy link

  • Support 256bit write granularity
    The new stm32h7xx chips can only write double quad words, i.e. 256bits.

*Update fdb_tsdb.c to include 256bit option
*Update fdb_cfg.h to include 256it option.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds 256-bit flash write granularity support for KVDB to accommodate STM32H7 devices that require 256-bit (double quadword) programming, and updates related configuration/documentation and TSDB compile-time guards.

Changes:

  • Allow FDB_WRITE_GRAN == 256 in KVDB configuration checks.
  • Add 256-bit-specific alignment padding in KVDB sector/KV header structs.
  • Update TSDB compile-time error guard and the config template comment to mention 256-bit granularity.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/fdb_tsdb.c Extends TSDB’s compile-time unsupported-granularity check to include 256-bit.
src/fdb_kvdb.c Allows 256-bit granularity and adjusts header struct padding for alignment.
inc/fdb_cfg_template.h Documents 256-bit write granularity option for STM32H7 in the template config.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

#if (FDB_WRITE_GRAN == 64) || (FDB_WRITE_GRAN == 128)
#error "Flash 64 or 128 bits write granularity is not supported in TSDB yet!"
#if (FDB_WRITE_GRAN == 64) || (FDB_WRITE_GRAN == 128) || (FDB_WRITE_GRAN == 256)
#error "Flash 64 or 128 or 256 bits write granularity is not supported in TSDB yet!"
Copy link

Copilot AI Mar 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The TSDB compile-time error string could be made clearer/grammatically correct (e.g. "Flash write granularities 64/128/256 bits are not supported in TSDB yet"). This helps users quickly understand which configurations are invalid.

Suggested change
#error "Flash 64 or 128 or 256 bits write granularity is not supported in TSDB yet!"
#error "Flash write granularities 64/128/256 bits are not supported in TSDB yet."

Copilot uses AI. Check for mistakes.
Repository owner deleted a comment from Copilot AI Mar 5, 2026
Baseline-K and others added 2 commits March 12, 2026 12:00
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants