I'm doing some initial development using only the simulator (for
convenience sake), and was testing out 'newtmgr fs' support to quickly
get data to and from the simulator.
My sim target is setup to use NFFS using mostly default values:
# NFFS filesystem
FS_CLI: 1 # Include shell FS commands
CONFIG_NFFS: 1 # Initialize and configure NFFS into the
system
NFFS_DETECT_FAIL: 2 # Format a new NFFS file system on
failure to detect
Everything works fine from shell when I start the .elf file and create
an NFFS file in code, and I can see the file and contents via cat:
ls /cfg
604693 5 /cfg/id.txt
604693 1 files
604900 compat> cat /cfg/id.txt
5678
But when I try to do anything with 'newtmgr fs' (up or down) I always
get *error 5*, which I assume corresponds to
https://github.com/apache/mynewt-core/blob/master/fs/fs/include/fs/fs.h#L72:
$ newtmgr -c serialsim fs download /cfg/id.txt id.txt
Error: 5
The newtmgr connection is fine and of course the app is running:
$ newtmgr conn show
Connection profiles:
serialsim: type=serial, connstring='/dev/ttys002'
And here is a proof that newtmgr is behaving properly and is properly
configured:
$ newtmgr -c serialsim stat nffs_stats
stat group: nffs_stats
0 nffs_gccnt
5 nffs_hashcnt_ins
0 nffs_hashcnt_rm
52 nffs_iocnt_read
13 nffs_iocnt_write
0 nffs_object_count
1 nffs_readcnt_block
0 nffs_readcnt_copy
0 nffs_readcnt_crc
1 nffs_readcnt_data
2 nffs_readcnt_detect
6 nffs_readcnt_filename
0 nffs_readcnt_format
0 nffs_readcnt_gccollate
22 nffs_readcnt_inode
21 nffs_readcnt_inodeent
0 nffs_readcnt_object
0 nffs_readcnt_rename
1 nffs_readcnt_update
Is it normal that the fs support doesn't work in the simulator? Perhaps
the commands only work with FatFS, although I'd prefer to use the
smaller NFFS for now.
K.