armmbed / storage-selector Goto Github PK
View Code? Open in Web Editor NEWDEPRECATED Statically select a Block Device (and optionally a File System) for an Mbed OS application
License: Apache License 2.0
DEPRECATED Statically select a Block Device (and optionally a File System) for an Mbed OS application
License: Apache License 2.0
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:
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
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-
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.
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
[ERROR] Library name 'littlefs' is not unique (defined in '/builds/ws/myapp/myapp/storage-selector/littlefs/mbed_lib.json' and '/builds/ws/myapp/myapp/mbed-os/features/filesystem/littlefs/mbed_lib.json')
Broken with this commit:
[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
https://github.com/ARMmbed/storage-selector/blob/master/storage-selector.h#L42 is not working for secondary partition. It uses mount point for primary partition.
Mount point for secondary partition has been defined through https://github.com/ARMmbed/mbed-client-pal/blob/master/Configs/pal_config/palInclude_mbedOS.h#L34
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.
while compiling the Odin W2 module using SPI Flash I got a compilation error in the 'options/sd_card.cpp' file
this file should not compile if not choosing the sd card option in the mbed_app.json file
workaround: delete this file manually
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.