Coder Social home page Coder Social logo

Comments (15)

armink avatar armink commented on August 30, 2024

理论上不存在这种情况,默认都是上电会检测 Flash 是否有做过格式化,必要时,系统会自动对 Flash 完成格式化动作

格式化时就会对 Flash 执行擦除动作

from flashdb.

xql923 avatar xql923 commented on August 30, 2024

from flashdb.

armink avatar armink commented on August 30, 2024

手动 fdb_kv_set_default 试一下?

from flashdb.

xql923 avatar xql923 commented on August 30, 2024

from flashdb.

xql923 avatar xql923 commented on August 30, 2024

from flashdb.

xql923 avatar xql923 commented on August 30, 2024

朱经理你好,在fdb_utils.c文件中,请问:
fdb_err_t _fdb_write_status(fdb_db_t db, uint32_t addr, uint8_t status_table[], size_t status_num, size_t status_index)
{
......

       #if (FDB_WRITE_GRAN == 1)

       -------//这个函数在运行之前,程序中,由针对addr + byte_index这个地址所在扇区进行格式化了吗?
       result = _fdb_flash_write(db, addr + byte_index, (uint32_t *)&status_table[byte_index], 1);

     #endif

........
}

from flashdb.

armink avatar armink commented on August 30, 2024

写之前肯定是有擦除,否则也没法写入的

from flashdb.

xql923 avatar xql923 commented on August 30, 2024

from flashdb.

armink avatar armink commented on August 30, 2024

用户不需要考虑擦写的时机,只需提供好移植函数就好,建议详细参考下 demo 文件下的示例,并在真机上试用

from flashdb.

xql923 avatar xql923 commented on August 30, 2024

from flashdb.

armink avatar armink commented on August 30, 2024

gitee 上也有,可以搜一下

from flashdb.

xql923 avatar xql923 commented on August 30, 2024

朱先生你好,我的SPI Flash并没有采用SFUD,而是FlashDB的fal port接口直接以扇区读、写和删除nor Flash,请问:
/* the flash write granularity, unit: bit

  • only support 1(nor flash)/ 8(stm32f2/f4)/ 32(stm32f1) */
    #define FDB_WRITE_GRAN 1

----请问这个需要设置为多少?

from flashdb.

xql923 avatar xql923 commented on August 30, 2024

使用的是SPI Flash:W25Q256,每个扇区的大小为:4096字节

from flashdb.

xql923 avatar xql923 commented on August 30, 2024

结帖。
将程序实现看了一遍,学习了朱先生的设计精巧之处。特别是针对Nor Flash的写入特点,巧妙的以bit设置状态位实现KV状态的设置,进而实现了所谓“掉电恢复”的功能。

from flashdb.

xql923 avatar xql923 commented on August 30, 2024

“磨损均衡”的实现也很巧妙。

from flashdb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.