Coder Social home page Coder Social logo

storage-selector's Introduction

Deprecation note!

Please note: This repository is deprecated and it is no longer actively maintained.

Storage Selector

Starting with Mbed OS 5.10 the operating system itself offers facilities for handling the storage (get_default_instance). With Mbed OS 5.11 internal flash is also fully supported even for storage.

This repository will not be maintained going onwards, as the work will be done using the official Mbed OS repository.

For more details, please see Mbed OS storage documentation.

There are also multiple examples available:

Old README.md

Old README.md is still available.

storage-selector's People

Contributors

0xc0170 avatar bremoran avatar bridadan avatar geky avatar kegilbert avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

storage-selector's Issues

Compiler warnings

[Warning] SPIFBlockDevice.h@59,0:  #611-D: overloaded virtual function "BlockDevice::get_erase_size"  is only partially overridden in class "SPIFBlockDevice" 
[Warning] DataFlashBlockDevice.h@62,0:  #611-D: overloaded virtual function "BlockDevice::get_erase_size"  is only partially overridden in class "DataFlashBlockDevice" 
[Warning] FlashIAPBlockDevice.h@40,0:  #611-D: overloaded virtual function "BlockDevice::get_erase_size"  is only partially overridden in class "FlashIAPBlockDevice" 
Compile [ 99.9%]: SPIFBlockDevice.cpp
[Warning] SPIFBlockDevice.h@59,0:  #611-D: overloaded virtual function "BlockDevice::get_erase_size"  is only partially overridden in class "SPIFBlockDevice"

Compiling mbed-cloud-client-example with Mbed OS 5.9.0 and ARMCC5

Unaligned access on fileystem object

https://github.com/ARMmbed/storage-selector/blob/master/options/fat_filesystem.cpp#L21

The memory allocated to store the objects is a char array which is not garanteed to be 4-byte aligned.

Which means when you use this memory to create new objects, the objects can fall on unaligned addresses. Then when you try to access the members in this object, you end up with an unaligned memory access fault.

Solution to fix this problem with to force maximum alignment of the fs_instances array. @bremoran Can you explain your solution please: https://github.com/ARMmbed/core-util/blob/master/core-util/FunctionPointerBase.h#L88-L102 @pan-

link issue with header storage-selector.h

If header has been include from two separating file it will cause linking issue with symbols

ERROR with ARMCC
Error: L6200E: Symbol _filesystem_initialized multiply defined ...
Error: L6200E: Symbol storage_selector() multiply defined ...
Error: L6200E: Symbol filesystem_selector(const char*) multiply defined ...
Error: L6200E: Symbol filesystem_selector(const char*, BlockDevice*, unsigned) multiply defined ...

This can be solved e.g. with static definition.

Naming of options

Current options are SDCARD, HEAP, and SPIFLASH. @marcuschangarm has pointed out these are pretty ambiguous.

Can we suggest a few alternatives? The only stipulation is they must not contain - characters (or for that matter, any character not supported by C++ due to the macro mangling).

cc @geky

Questions about how to use Storage-Selector.

Seems the current document is not enough if new starter not read the code, need help for below questions and propose a clear rule how to configure storage-selector:

  1. Is there any more detail documents about storage-selector?
  2. Is this only impact the MCC relevant storage but not impact the others? e.g. flash code
  3. What is the level/relationship between the three configurations? .storage is mandatory others are optional? what is the valid of additional configuration for each storage option?
  4. Is there default .storage settings for all exist platforms? what is the default setting for each .storage option?
  5. Is there a way to check what .storage options is supported by particular platform? e.g. MTB
  6. Any recommendation settings?
    e.g. K64F": {"storage-selector.storage": "SPI_FLASH")
    "NUCLEO_F429ZI": {
    "storage-selector.filesystem": "FAT",
    "storage-selector.mount-point": ""sd""
    }

Can storage be mandatory parameter in mbed_lib.json?

Currently storage is mandatory parameter in mbed_lib.json:

        "storage": {
            "help": "Options are SD_CARD, SPI_FLASH, DATA_FLASH, INTERNAL_FLASH, and HEAP",
            "required": true
        },

My application would like to use storage-selector for one board, and other boards should be left without storage because of limited HW resources.

What should be set for storage option for boards that does not use storage? Having storage as mandatory parameter will fail a build if nothing is specified:

[ERROR] Required parameter 'storage-selector.storage' defined by 'library:storage-selector' doesn't have a value

Failed to use LittleFS with storage-selector

If storage-selector (445f0b5) is configured as follows:

  "storage-selector.storage": "SD_CARD",
  "storage-selector.filesystem": "LITTLE"

and filesystem is initialized like FileSystem *fs = filesystem_selector("fs"); then the application will print following error when accessing the file system:

assertion "block < lfs->cfg->block_count" failed: file "./mbed-os/features/filesystem/littlefs/littlefs/lfs.c", line 31, function: lfs_cache_read
lfs error: Corrupted dir pair at 0 1
lfs error: Invalid superblock at 536918624 536918824

The application is working OK if the application is configured to use FAT instead of LITTLE.

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.