Date   

Re: [Zephyr-devel] FW: support for NFFS file system

Vikrant More <vikrant8051@...>
 

I forgot to inform that, we have to add ext/fs/nffs/include into list of include directories.

For that edit $zephyr_base/CMakeLists.txt as follow .... so it will looks like..

zephyr_include_directories(
  kernel/include
  arch/${ARCH}/include
  arch/${ARCH}/soc/${SOC_PATH}
  arch/${ARCH}/soc/${SOC_PATH}/include
  arch/${ARCH}/soc/${SOC_FAMILY}/include
  ${BOARD_DIR}
  include
  include/drivers
  ${PROJECT_BINARY_DIR}/include/generated
  ${USERINCLUDE}
  ${STDINCLUDE}
  ext/fs/nffs/include
)


I have also corrected my main.c. Plz consider it.


On Mon, Jan 29, 2018 at 12:19 PM, Vikrant More <vikrant8051@...> wrote:
Thanks Michael !!

Now I can access flash of nRF52840 using NFFS file system APIs.

I request Zephyr OS maintainer to create & add following attached main.c under $zephyr_base/samples/boards/nrf52/nffs/src

& prj.conf under $zephyr_base/samples/boards/nrf52/nffs/ on Github.

Thank You !!

On Fri, Jan 26, 2018 at 1:43 AM, Michael Hope <michaelh@...> wrote:
You can look up the error numbers to see what they mean in:


-19 is ENODEV which suggests you have a flash driver configuration problem.

I put together a little sample at https://github.com/nzmichaelh/zephyr_mini_samples  I tested it on an Arduino Zero, not a NRF5 board, so you will need to update prj.conf but I hope it helps.

-- Michael

On Thu, 25 Jan 2018 at 05:37 Vikrant More <vikrant8051@...> wrote:
fs_open( ) returns -19 instead of 0.

On Thu, Jan 25, 2018 at 12:10 AM, Michael Hope <michaelh@...> wrote:
Hi Vikrant.  I'm pretty sure you're reading past the end of the file - you'll need to close and reopen it before you can read back what you just wrote.  Try something like:

fs_open(...)
fs_write(...)
fs_close(...)

fs_open(...)
fs_read(...)

I also recommend checking the return value when you're experimenting.  In this case, you'll find that fs_read() is returning zero, i.e. it read zero bytes which is a good clue as to why there's no data in the buffer.

-- Michael

On Wed, 24 Jan 2018 at 13:29 Vikrant More <vikrant8051@...> wrote:
Hi Vinayak, it works !!

I make following changes .....

    fs_file_t my_zfp;
    unsigned char ptr[32];

    for(cntr=0;cntr<=31;cntr++)
    {
        ptr[cntr]='@';
    }

    fs_open(&my_zfp,"mesh.prv");
    fs_write(&my_zfp,"0123456789ABCDEF",16);
    fs_read(&my_zfp,ptr,32);
    fs_close(&my_zfp);

    for(cntr=0;cntr<=31;cntr++)
    {
        printk("%c",ptr[cntr]);
    }

But it prints --> @@@@@@@@@@@@@@@@
instead of --> 0123456789ABCDEF

Any clue ??

Thanks !!

On Wed, Jan 24, 2018 at 5:41 PM, Chettimada, Vinayak Kariappa <vinayak.kariappa.chettimada@nordicsemi.no> wrote:

Its:

 

fs_file_t my_zfp; // no * please;

 

and

 

fs_open(&my_zfp,"mesh.prv"); // & please J

 

That said, I am not expert on FS!

 

-Vinayak

 

From: zephyr-devel-bounces@...hyrproject.org [mailto:zephyr-devel-bounces@lists.zephyrproject.org] On Behalf Of Vikrant More
Sent: Wednesday, January 24, 2018 1:06 PM
To: Michael Hope <michaelh@...>
Cc: zephyr-users@...ct.org; zephyr-devel@...ct.org
Subject: Re: [Zephyr-devel] FW: support for NFFS file system

 

I copied & pasted $zephyr/ext/fs/nffs directory into $zephyr_base/include
----------------------------------------------------------------------------------------------------------------------

& edit $zephyr_base/include/fs/nffs_fs.h as follow

/*
 * Copyright (c) 2017 Codecoup
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#ifndef _NFFS_FS_H_
#define _NFFS_FS_H_

#include <sys/types.h>
#include <nffs/include/nffs/nffs.h>

#ifdef __cplusplus
extern "C" {
#endif

FS_FILE_DEFINE(struct nffs_file *fp);
FS_DIR_DEFINE(struct nffs_dir *dp);

#define MAX_FILE_NAME 256

#ifdef __cplusplus
}
#endif

#endif /* _NFFS_FS_H_ */

-------------------------------------------------------------------------------------------------------------------------

& add following config into my prj.conf

CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y
CONFIG_SOC_FLASH_NRF5=y
CONFIG_SOC_FLASH_NRF5_DEV_NAME="NRF52_FLASH"
CONFIG_SOC_FLASH_NRF5_RADIO_SYNC=y
CONFIG_ZTEST_STACKSIZE=2048
CONFIG_MAIN_STACK_SIZE=1024
CONFIG_HEAP_MEM_POOL_SIZE=1024


CONFIG_FILE_SYSTEM=y
CONFIG_FILE_SYSTEM_NFFS=y
CONFIG_FS_NFFS_NUM_FILES=4
CONFIG_FS_NFFS_NUM_DIRS=4
CONFIG_FS_NFFS_NUM_INODES=1024
CONFIG_FS_NFFS_NUM_BLOCKS=1024
CONFIG_FS_NFFS_NUM_CACHE_INODES=1
CONFIG_FS_NFFS_NUM_CACHE_BLOCKS=1
CONFIG_FILE_SYSTEM_NFFS=y
CONFIG_NFFS_FILESYSTEM_MAX_AREAS=12

------------------------------------------------------------------------------------------------------------------------

& add following lines in main.c

#include <fs.h>

void main( )
{
    fs_file_t *my_zfp;
    unsigned char ptr[32];


    fs_open(my_zfp,"mesh.prv");
    fs_write(my_zfp,"Hello World !! ",16);
    fs_read(my_zfp,ptr,32);
    fs_close(my_zfp);

    printk("%s",ptr);
}

After all this every thing gets compiled with warning :

 

warning: ‘my_zfp’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  fs_open(my_zfp,"mesh.prv");

Could you please help me, how to initialized my_zfp here ?

 

 

On Tue, Jan 23, 2018 at 1:15 AM, Michael Hope <michaelh@...> wrote:

Hi Vikrant.  You also need to enable NFFS in your configuration - try 'make menuconfig' > File Systems > File system support = y; Supported file systems -> NFFS.

You can also check out the NFFS test case under tests/subsys/fs and especially the configuration in https://github.com/zephyrproject-rtos/zephyr/blob/master/tests/subsys/fs/nffs_fs_api/nrf5x.conf

-- Michael

 

On Fri, 19 Jan 2018 at 11:46 Vikrant More <vikrant8051@...> wrote:

#include <fs.h>

void main( )
{
    fs_file_t *my_zfp;
    unsigned char ptr[32];


    fs_open(my_zfp,"mesh.prv");
    fs_write(my_zfp,"Hello World !! ",16);
    fs_read(my_zfp,ptr,32);
    fs_close(my_zfp);

    printk("%s",ptr);
}

I've edited main.c in my project as mentioned above.

And add CONFIG_FILE_SYSTEM_NFFS=y in prj.conf

 

1st time I got following error,

 

In file included from /home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:3:0:
/home/vikrant/projects/zephyr/zephyr/include/fs.h:66:12: error: ‘MAX_FILE_NAME’ undeclared here (not in a function)
  char name[MAX_FILE_NAME + 1];
            ^~~~~~~~~~~~~
CMakeFiles/app.dir/build.make:302: recipe for target 'CMakeFiles/app.dir/src/main.c.obj' failed
make[2]: *** [CMakeFiles/app.dir/src/main.c.obj] Error 1
CMakeFiles/Makefile2:259: recipe for target 'CMakeFiles/app.dir/all' failed
make[1]: *** [CMakeFiles/app.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

 

To overcome it I added ,    #define MAX_FILE_NAME 10   in zephyr/include/fs.h

 

After this I got following error,

 

../libapp.a(main.c.obj): In function `main':
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:226: undefined reference to `fs_open'
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:227: undefined reference to `fs_write'
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:228: undefined reference to `fs_read'
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:229: undefined reference to `fs_close'
collect2: error: ld returned 1 exit status
zephyr/CMakeFiles/zephyr_prebuilt.dir/build.make:104: recipe for target 'zephyr/zephyr_prebuilt.elf' failed
make[2]: *** [zephyr/zephyr_prebuilt.elf] Error 1
CMakeFiles/Makefile2:569: recipe for target 'zephyr/CMakeFiles/zephyr_prebuilt.dir/all' failed
make[1]: *** [zephyr/CMakeFiles/zephyr_prebuilt.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

 

 

 

 

Following line are already present in zephyr/boards/arm/nrf52840_pca10056/nrf52840_pca10056.dts

 


#if defined(CONFIG_FILE_SYSTEM_NFFS)
        nffs_partition: partition@fc000 {
            label = "nffs";
            reg = <0x000fc000 0x00004000>;
        };
#endif

 

Could you please tell me what I'm missing ?

 

Thank You !!

 

On Fri, Jan 19, 2018 at 12:15 AM, Michael Hope <michaelh@...> wrote:

 

1. Ensure the board has a nffs partition defined in Device Tree.  See here for an example.

2. Turn on CONFIG_FILE_SYSTEM_NFFS in the config

3. Use the APIs in include/fs.h such as fs_open() etc

If you turn on CONFIG_FILE_SYSTEM_SHELL then you'll also get a simple interactive shell where you can list directories etc.

-- Michael

 

On Thu, 18 Jan 2018 at 15:16 Vikrant More <vikrant8051@...> wrote:

Thanks for reply.

 

Where I will find APIs & sample codes based on it to access internal flash of nrf52840 ?

 

 

On Jan 18, 2018 3:38 PM, "Puzdrowski, Andrzej" <Andrzej.Puzdrowski@nordicsemi.no> wrote:

NFFS Is supported since 1.10 release:

https://www.zephyrproject.org/releases/1-10-release-december-2017/

 

Andrzej

From: zephyr-devel-bounces@...hyrproject.org [mailto:zephyr-devel-bounces@lists.zephyrproject.org] On Behalf Of Vikrant More
Sent: Thursday, January 18, 2018 10:09 AM
To: zephyr-devel@...ct.org; zephyr-users@...ct.org
Subject: [Zephyr-devel] support for NFFS file system

 

Hello World !!

 

My question is related to this link's requirement,
https://lists.zephyrproject.org/pipermail/zephyr-devel/2017-July/007888.html

Is Zephyr going to add support for NFFS file system in upcoming 1.11 (March 20148) release ?

What is current status of NFFS file system development ?

Could anybody explain me from Zephyr Core developer team ?

Thank You !! 


_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@...ct.org
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel

_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@...ct.org
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel

 

 



On Wed, Jan 24, 2018 at 5:41 PM, Chettimada, Vinayak Kariappa <vinayak.kariappa.chettimada@nordicsemi.no> wrote:

Its:

 

fs_file_t my_zfp; // no * please;

 

and

 

fs_open(&my_zfp,"mesh.prv"); // & please J

 

That said, I am not expert on FS!

 

-Vinayak

 

From: zephyr-devel-bounces@...hyrproject.org [mailto:zephyr-devel-bounces@lists.zephyrproject.org] On Behalf Of Vikrant More
Sent: Wednesday, January 24, 2018 1:06 PM
To: Michael Hope <michaelh@...>
Cc: zephyr-users@...ct.org; zephyr-devel@...ct.org
Subject: Re: [Zephyr-devel] FW: support for NFFS file system

 

I copied & pasted $zephyr/ext/fs/nffs directory into $zephyr_base/include
----------------------------------------------------------------------------------------------------------------------

& edit $zephyr_base/include/fs/nffs_fs.h as follow

/*
 * Copyright (c) 2017 Codecoup
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#ifndef _NFFS_FS_H_
#define _NFFS_FS_H_

#include <sys/types.h>
#include <nffs/include/nffs/nffs.h>

#ifdef __cplusplus
extern "C" {
#endif

FS_FILE_DEFINE(struct nffs_file *fp);
FS_DIR_DEFINE(struct nffs_dir *dp);

#define MAX_FILE_NAME 256

#ifdef __cplusplus
}
#endif

#endif /* _NFFS_FS_H_ */

-------------------------------------------------------------------------------------------------------------------------

& add following config into my prj.conf

CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y
CONFIG_SOC_FLASH_NRF5=y
CONFIG_SOC_FLASH_NRF5_DEV_NAME="NRF52_FLASH"
CONFIG_SOC_FLASH_NRF5_RADIO_SYNC=y
CONFIG_ZTEST_STACKSIZE=2048
CONFIG_MAIN_STACK_SIZE=1024
CONFIG_HEAP_MEM_POOL_SIZE=1024


CONFIG_FILE_SYSTEM=y
CONFIG_FILE_SYSTEM_NFFS=y
CONFIG_FS_NFFS_NUM_FILES=4
CONFIG_FS_NFFS_NUM_DIRS=4
CONFIG_FS_NFFS_NUM_INODES=1024
CONFIG_FS_NFFS_NUM_BLOCKS=1024
CONFIG_FS_NFFS_NUM_CACHE_INODES=1
CONFIG_FS_NFFS_NUM_CACHE_BLOCKS=1
CONFIG_FILE_SYSTEM_NFFS=y
CONFIG_NFFS_FILESYSTEM_MAX_AREAS=12

------------------------------------------------------------------------------------------------------------------------

& add following lines in main.c

#include <fs.h>

void main( )
{
    fs_file_t *my_zfp;
    unsigned char ptr[32];


    fs_open(my_zfp,"mesh.prv");
    fs_write(my_zfp,"Hello World !! ",16);
    fs_read(my_zfp,ptr,32);
    fs_close(my_zfp);

    printk("%s",ptr);
}

After all this every thing gets compiled with warning :

 

warning: ‘my_zfp’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  fs_open(my_zfp,"mesh.prv");

Could you please help me, how to initialized my_zfp here ?

 

 

On Tue, Jan 23, 2018 at 1:15 AM, Michael Hope <michaelh@...> wrote:

Hi Vikrant.  You also need to enable NFFS in your configuration - try 'make menuconfig' > File Systems > File system support = y; Supported file systems -> NFFS.

You can also check out the NFFS test case under tests/subsys/fs and especially the configuration in https://github.com/zephyrproject-rtos/zephyr/blob/master/tests/subsys/fs/nffs_fs_api/nrf5x.conf

-- Michael

 

On Fri, 19 Jan 2018 at 11:46 Vikrant More <vikrant8051@...> wrote:

#include <fs.h>

void main( )
{
    fs_file_t *my_zfp;
    unsigned char ptr[32];


    fs_open(my_zfp,"mesh.prv");
    fs_write(my_zfp,"Hello World !! ",16);
    fs_read(my_zfp,ptr,32);
    fs_close(my_zfp);

    printk("%s",ptr);
}

I've edited main.c in my project as mentioned above.

And add CONFIG_FILE_SYSTEM_NFFS=y in prj.conf

 

1st time I got following error,

 

In file included from /home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:3:0:
/home/vikrant/projects/zephyr/zephyr/include/fs.h:66:12: error: ‘MAX_FILE_NAME’ undeclared here (not in a function)
  char name[MAX_FILE_NAME + 1];
            ^~~~~~~~~~~~~
CMakeFiles/app.dir/build.make:302: recipe for target 'CMakeFiles/app.dir/src/main.c.obj' failed
make[2]: *** [CMakeFiles/app.dir/src/main.c.obj] Error 1
CMakeFiles/Makefile2:259: recipe for target 'CMakeFiles/app.dir/all' failed
make[1]: *** [CMakeFiles/app.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

 

To overcome it I added ,    #define MAX_FILE_NAME 10   in zephyr/include/fs.h

 

After this I got following error,

 

../libapp.a(main.c.obj): In function `main':
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:226: undefined reference to `fs_open'
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:227: undefined reference to `fs_write'
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:228: undefined reference to `fs_read'
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:229: undefined reference to `fs_close'
collect2: error: ld returned 1 exit status
zephyr/CMakeFiles/zephyr_prebuilt.dir/build.make:104: recipe for target 'zephyr/zephyr_prebuilt.elf' failed
make[2]: *** [zephyr/zephyr_prebuilt.elf] Error 1
CMakeFiles/Makefile2:569: recipe for target 'zephyr/CMakeFiles/zephyr_prebuilt.dir/all' failed
make[1]: *** [zephyr/CMakeFiles/zephyr_prebuilt.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

 

 

 

 

Following line are already present in zephyr/boards/arm/nrf52840_pca10056/nrf52840_pca10056.dts

 


#if defined(CONFIG_FILE_SYSTEM_NFFS)
        nffs_partition: partition@fc000 {
            label = "nffs";
            reg = <0x000fc000 0x00004000>;
        };
#endif

 

Could you please tell me what I'm missing ?

 

Thank You !!

 

On Fri, Jan 19, 2018 at 12:15 AM, Michael Hope <michaelh@...> wrote:

 

1. Ensure the board has a nffs partition defined in Device Tree.  See here for an example.

2. Turn on CONFIG_FILE_SYSTEM_NFFS in the config

3. Use the APIs in include/fs.h such as fs_open() etc

If you turn on CONFIG_FILE_SYSTEM_SHELL then you'll also get a simple interactive shell where you can list directories etc.

-- Michael

 

On Thu, 18 Jan 2018 at 15:16 Vikrant More <vikrant8051@...> wrote:

Thanks for reply.

 

Where I will find APIs & sample codes based on it to access internal flash of nrf52840 ?

 

 

On Jan 18, 2018 3:38 PM, "Puzdrowski, Andrzej" <Andrzej.Puzdrowski@nordicsemi.no> wrote:

NFFS Is supported since 1.10 release:

https://www.zephyrproject.org/releases/1-10-release-december-2017/

 

Andrzej

From: zephyr-devel-bounces@...hyrproject.org [mailto:zephyr-devel-bounces@lists.zephyrproject.org] On Behalf Of Vikrant More
Sent: Thursday, January 18, 2018 10:09 AM
To: zephyr-devel@...ct.org; zephyr-users@...ct.org
Subject: [Zephyr-devel] support for NFFS file system

 

Hello World !!

 

My question is related to this link's requirement,
https://lists.zephyrproject.org/pipermail/zephyr-devel/2017-July/007888.html

Is Zephyr going to add support for NFFS file system in upcoming 1.11 (March 20148) release ?

What is current status of NFFS file system development ?

Could anybody explain me from Zephyr Core developer team ?

Thank You !! 


_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@...ct.org
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel

_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@...ct.org
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel

 

 






Re: [Zephyr-devel] FW: support for NFFS file system

Vikrant More <vikrant8051@...>
 

Thanks Michael !!

Now I can access flash of nRF52840 using NFFS file system APIs.

I request Zephyr OS maintainer to create & add following attached main.c under $zephyr_base/samples/boards/nrf52/nffs/src

& prj.conf under $zephyr_base/samples/boards/nrf52/nffs/ on Github.

Thank You !!

On Fri, Jan 26, 2018 at 1:43 AM, Michael Hope <michaelh@...> wrote:
You can look up the error numbers to see what they mean in:


-19 is ENODEV which suggests you have a flash driver configuration problem.

I put together a little sample at https://github.com/nzmichaelh/zephyr_mini_samples  I tested it on an Arduino Zero, not a NRF5 board, so you will need to update prj.conf but I hope it helps.

-- Michael

On Thu, 25 Jan 2018 at 05:37 Vikrant More <vikrant8051@...> wrote:
fs_open( ) returns -19 instead of 0.

On Thu, Jan 25, 2018 at 12:10 AM, Michael Hope <michaelh@...> wrote:
Hi Vikrant.  I'm pretty sure you're reading past the end of the file - you'll need to close and reopen it before you can read back what you just wrote.  Try something like:

fs_open(...)
fs_write(...)
fs_close(...)

fs_open(...)
fs_read(...)

I also recommend checking the return value when you're experimenting.  In this case, you'll find that fs_read() is returning zero, i.e. it read zero bytes which is a good clue as to why there's no data in the buffer.

-- Michael

On Wed, 24 Jan 2018 at 13:29 Vikrant More <vikrant8051@...> wrote:
Hi Vinayak, it works !!

I make following changes .....

    fs_file_t my_zfp;
    unsigned char ptr[32];

    for(cntr=0;cntr<=31;cntr++)
    {
        ptr[cntr]='@';
    }

    fs_open(&my_zfp,"mesh.prv");
    fs_write(&my_zfp,"0123456789ABCDEF",16);
    fs_read(&my_zfp,ptr,32);
    fs_close(&my_zfp);

    for(cntr=0;cntr<=31;cntr++)
    {
        printk("%c",ptr[cntr]);
    }

But it prints --> @@@@@@@@@@@@@@@@
instead of --> 0123456789ABCDEF

Any clue ??

Thanks !!

On Wed, Jan 24, 2018 at 5:41 PM, Chettimada, Vinayak Kariappa <vinayak.kariappa.chettimada@nordicsemi.no> wrote:

Its:

 

fs_file_t my_zfp; // no * please;

 

and

 

fs_open(&my_zfp,"mesh.prv"); // & please J

 

That said, I am not expert on FS!

 

-Vinayak

 

From: zephyr-devel-bounces@lists.zephyrproject.org [mailto:zephyr-devel-bounces@lists.zephyrproject.org] On Behalf Of Vikrant More
Sent: Wednesday, January 24, 2018 1:06 PM
To: Michael Hope <michaelh@...>
Cc: zephyr-users@lists.zephyrproject.org; zephyr-devel@lists.zephyrproject.org
Subject: Re: [Zephyr-devel] FW: support for NFFS file system

 

I copied & pasted $zephyr/ext/fs/nffs directory into $zephyr_base/include
----------------------------------------------------------------------------------------------------------------------

& edit $zephyr_base/include/fs/nffs_fs.h as follow

/*
 * Copyright (c) 2017 Codecoup
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#ifndef _NFFS_FS_H_
#define _NFFS_FS_H_

#include <sys/types.h>
#include <nffs/include/nffs/nffs.h>

#ifdef __cplusplus
extern "C" {
#endif

FS_FILE_DEFINE(struct nffs_file *fp);
FS_DIR_DEFINE(struct nffs_dir *dp);

#define MAX_FILE_NAME 256

#ifdef __cplusplus
}
#endif

#endif /* _NFFS_FS_H_ */

-------------------------------------------------------------------------------------------------------------------------

& add following config into my prj.conf

CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y
CONFIG_SOC_FLASH_NRF5=y
CONFIG_SOC_FLASH_NRF5_DEV_NAME="NRF52_FLASH"
CONFIG_SOC_FLASH_NRF5_RADIO_SYNC=y
CONFIG_ZTEST_STACKSIZE=2048
CONFIG_MAIN_STACK_SIZE=1024
CONFIG_HEAP_MEM_POOL_SIZE=1024


CONFIG_FILE_SYSTEM=y
CONFIG_FILE_SYSTEM_NFFS=y
CONFIG_FS_NFFS_NUM_FILES=4
CONFIG_FS_NFFS_NUM_DIRS=4
CONFIG_FS_NFFS_NUM_INODES=1024
CONFIG_FS_NFFS_NUM_BLOCKS=1024
CONFIG_FS_NFFS_NUM_CACHE_INODES=1
CONFIG_FS_NFFS_NUM_CACHE_BLOCKS=1
CONFIG_FILE_SYSTEM_NFFS=y
CONFIG_NFFS_FILESYSTEM_MAX_AREAS=12

------------------------------------------------------------------------------------------------------------------------

& add following lines in main.c

#include <fs.h>

void main( )
{
    fs_file_t *my_zfp;
    unsigned char ptr[32];


    fs_open(my_zfp,"mesh.prv");
    fs_write(my_zfp,"Hello World !! ",16);
    fs_read(my_zfp,ptr,32);
    fs_close(my_zfp);

    printk("%s",ptr);
}

After all this every thing gets compiled with warning :

 

warning: ‘my_zfp’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  fs_open(my_zfp,"mesh.prv");

Could you please help me, how to initialized my_zfp here ?

 

 

On Tue, Jan 23, 2018 at 1:15 AM, Michael Hope <michaelh@...> wrote:

Hi Vikrant.  You also need to enable NFFS in your configuration - try 'make menuconfig' > File Systems > File system support = y; Supported file systems -> NFFS.

You can also check out the NFFS test case under tests/subsys/fs and especially the configuration in https://github.com/zephyrproject-rtos/zephyr/blob/master/tests/subsys/fs/nffs_fs_api/nrf5x.conf

-- Michael

 

On Fri, 19 Jan 2018 at 11:46 Vikrant More <vikrant8051@...> wrote:

#include <fs.h>

void main( )
{
    fs_file_t *my_zfp;
    unsigned char ptr[32];


    fs_open(my_zfp,"mesh.prv");
    fs_write(my_zfp,"Hello World !! ",16);
    fs_read(my_zfp,ptr,32);
    fs_close(my_zfp);

    printk("%s",ptr);
}

I've edited main.c in my project as mentioned above.

And add CONFIG_FILE_SYSTEM_NFFS=y in prj.conf

 

1st time I got following error,

 

In file included from /home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:3:0:
/home/vikrant/projects/zephyr/zephyr/include/fs.h:66:12: error: ‘MAX_FILE_NAME’ undeclared here (not in a function)
  char name[MAX_FILE_NAME + 1];
            ^~~~~~~~~~~~~
CMakeFiles/app.dir/build.make:302: recipe for target 'CMakeFiles/app.dir/src/main.c.obj' failed
make[2]: *** [CMakeFiles/app.dir/src/main.c.obj] Error 1
CMakeFiles/Makefile2:259: recipe for target 'CMakeFiles/app.dir/all' failed
make[1]: *** [CMakeFiles/app.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

 

To overcome it I added ,    #define MAX_FILE_NAME 10   in zephyr/include/fs.h

 

After this I got following error,

 

../libapp.a(main.c.obj): In function `main':
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:226: undefined reference to `fs_open'
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:227: undefined reference to `fs_write'
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:228: undefined reference to `fs_read'
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:229: undefined reference to `fs_close'
collect2: error: ld returned 1 exit status
zephyr/CMakeFiles/zephyr_prebuilt.dir/build.make:104: recipe for target 'zephyr/zephyr_prebuilt.elf' failed
make[2]: *** [zephyr/zephyr_prebuilt.elf] Error 1
CMakeFiles/Makefile2:569: recipe for target 'zephyr/CMakeFiles/zephyr_prebuilt.dir/all' failed
make[1]: *** [zephyr/CMakeFiles/zephyr_prebuilt.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

 

 

 

 

Following line are already present in zephyr/boards/arm/nrf52840_pca10056/nrf52840_pca10056.dts

 


#if defined(CONFIG_FILE_SYSTEM_NFFS)
        nffs_partition: partition@fc000 {
            label = "nffs";
            reg = <0x000fc000 0x00004000>;
        };
#endif

 

Could you please tell me what I'm missing ?

 

Thank You !!

 

On Fri, Jan 19, 2018 at 12:15 AM, Michael Hope <michaelh@...> wrote:

 

1. Ensure the board has a nffs partition defined in Device Tree.  See here for an example.

2. Turn on CONFIG_FILE_SYSTEM_NFFS in the config

3. Use the APIs in include/fs.h such as fs_open() etc

If you turn on CONFIG_FILE_SYSTEM_SHELL then you'll also get a simple interactive shell where you can list directories etc.

-- Michael

 

On Thu, 18 Jan 2018 at 15:16 Vikrant More <vikrant8051@...> wrote:

Thanks for reply.

 

Where I will find APIs & sample codes based on it to access internal flash of nrf52840 ?

 

 

On Jan 18, 2018 3:38 PM, "Puzdrowski, Andrzej" <Andrzej.Puzdrowski@nordicsemi.no> wrote:

NFFS Is supported since 1.10 release:

https://www.zephyrproject.org/releases/1-10-release-december-2017/

 

Andrzej

From: zephyr-devel-bounces@lists.zephyrproject.org [mailto:zephyr-devel-bounces@lists.zephyrproject.org] On Behalf Of Vikrant More
Sent: Thursday, January 18, 2018 10:09 AM
To: zephyr-devel@lists.zephyrproject.org; zephyr-users@lists.zephyrproject.org
Subject: [Zephyr-devel] support for NFFS file system

 

Hello World !!

 

My question is related to this link's requirement,
https://lists.zephyrproject.org/pipermail/zephyr-devel/2017-July/007888.html

Is Zephyr going to add support for NFFS file system in upcoming 1.11 (March 20148) release ?

What is current status of NFFS file system development ?

Could anybody explain me from Zephyr Core developer team ?

Thank You !! 


_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@lists.zephyrproject.org
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel

_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@lists.zephyrproject.org
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel

 

 



On Wed, Jan 24, 2018 at 5:41 PM, Chettimada, Vinayak Kariappa <vinayak.kariappa.chettimada@nordicsemi.no> wrote:

Its:

 

fs_file_t my_zfp; // no * please;

 

and

 

fs_open(&my_zfp,"mesh.prv"); // & please J

 

That said, I am not expert on FS!

 

-Vinayak

 

From: zephyr-devel-bounces@lists.zephyrproject.org [mailto:zephyr-devel-bounces@lists.zephyrproject.org] On Behalf Of Vikrant More
Sent: Wednesday, January 24, 2018 1:06 PM
To: Michael Hope <michaelh@...>
Cc: zephyr-users@lists.zephyrproject.org; zephyr-devel@lists.zephyrproject.org
Subject: Re: [Zephyr-devel] FW: support for NFFS file system

 

I copied & pasted $zephyr/ext/fs/nffs directory into $zephyr_base/include
----------------------------------------------------------------------------------------------------------------------

& edit $zephyr_base/include/fs/nffs_fs.h as follow

/*
 * Copyright (c) 2017 Codecoup
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#ifndef _NFFS_FS_H_
#define _NFFS_FS_H_

#include <sys/types.h>
#include <nffs/include/nffs/nffs.h>

#ifdef __cplusplus
extern "C" {
#endif

FS_FILE_DEFINE(struct nffs_file *fp);
FS_DIR_DEFINE(struct nffs_dir *dp);

#define MAX_FILE_NAME 256

#ifdef __cplusplus
}
#endif

#endif /* _NFFS_FS_H_ */

-------------------------------------------------------------------------------------------------------------------------

& add following config into my prj.conf

CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y
CONFIG_SOC_FLASH_NRF5=y
CONFIG_SOC_FLASH_NRF5_DEV_NAME="NRF52_FLASH"
CONFIG_SOC_FLASH_NRF5_RADIO_SYNC=y
CONFIG_ZTEST_STACKSIZE=2048
CONFIG_MAIN_STACK_SIZE=1024
CONFIG_HEAP_MEM_POOL_SIZE=1024


CONFIG_FILE_SYSTEM=y
CONFIG_FILE_SYSTEM_NFFS=y
CONFIG_FS_NFFS_NUM_FILES=4
CONFIG_FS_NFFS_NUM_DIRS=4
CONFIG_FS_NFFS_NUM_INODES=1024
CONFIG_FS_NFFS_NUM_BLOCKS=1024
CONFIG_FS_NFFS_NUM_CACHE_INODES=1
CONFIG_FS_NFFS_NUM_CACHE_BLOCKS=1
CONFIG_FILE_SYSTEM_NFFS=y
CONFIG_NFFS_FILESYSTEM_MAX_AREAS=12

------------------------------------------------------------------------------------------------------------------------

& add following lines in main.c

#include <fs.h>

void main( )
{
    fs_file_t *my_zfp;
    unsigned char ptr[32];


    fs_open(my_zfp,"mesh.prv");
    fs_write(my_zfp,"Hello World !! ",16);
    fs_read(my_zfp,ptr,32);
    fs_close(my_zfp);

    printk("%s",ptr);
}

After all this every thing gets compiled with warning :

 

warning: ‘my_zfp’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  fs_open(my_zfp,"mesh.prv");

Could you please help me, how to initialized my_zfp here ?

 

 

On Tue, Jan 23, 2018 at 1:15 AM, Michael Hope <michaelh@...> wrote:

Hi Vikrant.  You also need to enable NFFS in your configuration - try 'make menuconfig' > File Systems > File system support = y; Supported file systems -> NFFS.

You can also check out the NFFS test case under tests/subsys/fs and especially the configuration in https://github.com/zephyrproject-rtos/zephyr/blob/master/tests/subsys/fs/nffs_fs_api/nrf5x.conf

-- Michael

 

On Fri, 19 Jan 2018 at 11:46 Vikrant More <vikrant8051@...> wrote:

#include <fs.h>

void main( )
{
    fs_file_t *my_zfp;
    unsigned char ptr[32];


    fs_open(my_zfp,"mesh.prv");
    fs_write(my_zfp,"Hello World !! ",16);
    fs_read(my_zfp,ptr,32);
    fs_close(my_zfp);

    printk("%s",ptr);
}

I've edited main.c in my project as mentioned above.

And add CONFIG_FILE_SYSTEM_NFFS=y in prj.conf

 

1st time I got following error,

 

In file included from /home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:3:0:
/home/vikrant/projects/zephyr/zephyr/include/fs.h:66:12: error: ‘MAX_FILE_NAME’ undeclared here (not in a function)
  char name[MAX_FILE_NAME + 1];
            ^~~~~~~~~~~~~
CMakeFiles/app.dir/build.make:302: recipe for target 'CMakeFiles/app.dir/src/main.c.obj' failed
make[2]: *** [CMakeFiles/app.dir/src/main.c.obj] Error 1
CMakeFiles/Makefile2:259: recipe for target 'CMakeFiles/app.dir/all' failed
make[1]: *** [CMakeFiles/app.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

 

To overcome it I added ,    #define MAX_FILE_NAME 10   in zephyr/include/fs.h

 

After this I got following error,

 

../libapp.a(main.c.obj): In function `main':
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:226: undefined reference to `fs_open'
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:227: undefined reference to `fs_write'
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:228: undefined reference to `fs_read'
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:229: undefined reference to `fs_close'
collect2: error: ld returned 1 exit status
zephyr/CMakeFiles/zephyr_prebuilt.dir/build.make:104: recipe for target 'zephyr/zephyr_prebuilt.elf' failed
make[2]: *** [zephyr/zephyr_prebuilt.elf] Error 1
CMakeFiles/Makefile2:569: recipe for target 'zephyr/CMakeFiles/zephyr_prebuilt.dir/all' failed
make[1]: *** [zephyr/CMakeFiles/zephyr_prebuilt.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

 

 

 

 

Following line are already present in zephyr/boards/arm/nrf52840_pca10056/nrf52840_pca10056.dts

 


#if defined(CONFIG_FILE_SYSTEM_NFFS)
        nffs_partition: partition@fc000 {
            label = "nffs";
            reg = <0x000fc000 0x00004000>;
        };
#endif

 

Could you please tell me what I'm missing ?

 

Thank You !!

 

On Fri, Jan 19, 2018 at 12:15 AM, Michael Hope <michaelh@...> wrote:

 

1. Ensure the board has a nffs partition defined in Device Tree.  See here for an example.

2. Turn on CONFIG_FILE_SYSTEM_NFFS in the config

3. Use the APIs in include/fs.h such as fs_open() etc

If you turn on CONFIG_FILE_SYSTEM_SHELL then you'll also get a simple interactive shell where you can list directories etc.

-- Michael

 

On Thu, 18 Jan 2018 at 15:16 Vikrant More <vikrant8051@...> wrote:

Thanks for reply.

 

Where I will find APIs & sample codes based on it to access internal flash of nrf52840 ?

 

 

On Jan 18, 2018 3:38 PM, "Puzdrowski, Andrzej" <Andrzej.Puzdrowski@nordicsemi.no> wrote:

NFFS Is supported since 1.10 release:

https://www.zephyrproject.org/releases/1-10-release-december-2017/

 

Andrzej

From: zephyr-devel-bounces@lists.zephyrproject.org [mailto:zephyr-devel-bounces@lists.zephyrproject.org] On Behalf Of Vikrant More
Sent: Thursday, January 18, 2018 10:09 AM
To: zephyr-devel@lists.zephyrproject.org; zephyr-users@lists.zephyrproject.org
Subject: [Zephyr-devel] support for NFFS file system

 

Hello World !!

 

My question is related to this link's requirement,
https://lists.zephyrproject.org/pipermail/zephyr-devel/2017-July/007888.html

Is Zephyr going to add support for NFFS file system in upcoming 1.11 (March 20148) release ?

What is current status of NFFS file system development ?

Could anybody explain me from Zephyr Core developer team ?

Thank You !! 


_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@lists.zephyrproject.org
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel

_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@lists.zephyrproject.org
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel

 

 





Re: [Zephyr-devel] FW: support for NFFS file system

Michael Hope
 

You can look up the error numbers to see what they mean in:


-19 is ENODEV which suggests you have a flash driver configuration problem.

I put together a little sample at https://github.com/nzmichaelh/zephyr_mini_samples  I tested it on an Arduino Zero, not a NRF5 board, so you will need to update prj.conf but I hope it helps.

-- Michael

On Thu, 25 Jan 2018 at 05:37 Vikrant More <vikrant8051@...> wrote:
fs_open( ) returns -19 instead of 0.

On Thu, Jan 25, 2018 at 12:10 AM, Michael Hope <michaelh@...> wrote:
Hi Vikrant.  I'm pretty sure you're reading past the end of the file - you'll need to close and reopen it before you can read back what you just wrote.  Try something like:

fs_open(...)
fs_write(...)
fs_close(...)

fs_open(...)
fs_read(...)

I also recommend checking the return value when you're experimenting.  In this case, you'll find that fs_read() is returning zero, i.e. it read zero bytes which is a good clue as to why there's no data in the buffer.

-- Michael

On Wed, 24 Jan 2018 at 13:29 Vikrant More <vikrant8051@...> wrote:
Hi Vinayak, it works !!

I make following changes .....

    fs_file_t my_zfp;
    unsigned char ptr[32];

    for(cntr=0;cntr<=31;cntr++)
    {
        ptr[cntr]='@';
    }

    fs_open(&my_zfp,"mesh.prv");
    fs_write(&my_zfp,"0123456789ABCDEF",16);
    fs_read(&my_zfp,ptr,32);
    fs_close(&my_zfp);

    for(cntr=0;cntr<=31;cntr++)
    {
        printk("%c",ptr[cntr]);
    }

But it prints --> @@@@@@@@@@@@@@@@
instead of --> 0123456789ABCDEF

Any clue ??

Thanks !!

On Wed, Jan 24, 2018 at 5:41 PM, Chettimada, Vinayak Kariappa <vinayak.kariappa.chettimada@...> wrote:

Its:

 

fs_file_t my_zfp; // no * please;

 

and

 

fs_open(&my_zfp,"mesh.prv"); // & please J

 

That said, I am not expert on FS!

 

-Vinayak

 

From: zephyr-devel-bounces@... [mailto:zephyr-devel-bounces@...] On Behalf Of Vikrant More
Sent: Wednesday, January 24, 2018 1:06 PM
To: Michael Hope <michaelh@...>
Cc: zephyr-users@...; zephyr-devel@...
Subject: Re: [Zephyr-devel] FW: support for NFFS file system

 

I copied & pasted $zephyr/ext/fs/nffs directory into $zephyr_base/include
----------------------------------------------------------------------------------------------------------------------

& edit $zephyr_base/include/fs/nffs_fs.h as follow

/*
 * Copyright (c) 2017 Codecoup
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#ifndef _NFFS_FS_H_
#define _NFFS_FS_H_

#include <sys/types.h>
#include <nffs/include/nffs/nffs.h>

#ifdef __cplusplus
extern "C" {
#endif

FS_FILE_DEFINE(struct nffs_file *fp);
FS_DIR_DEFINE(struct nffs_dir *dp);

#define MAX_FILE_NAME 256

#ifdef __cplusplus
}
#endif

#endif /* _NFFS_FS_H_ */

-------------------------------------------------------------------------------------------------------------------------

& add following config into my prj.conf

CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y
CONFIG_SOC_FLASH_NRF5=y
CONFIG_SOC_FLASH_NRF5_DEV_NAME="NRF52_FLASH"
CONFIG_SOC_FLASH_NRF5_RADIO_SYNC=y
CONFIG_ZTEST_STACKSIZE=2048
CONFIG_MAIN_STACK_SIZE=1024
CONFIG_HEAP_MEM_POOL_SIZE=1024


CONFIG_FILE_SYSTEM=y
CONFIG_FILE_SYSTEM_NFFS=y
CONFIG_FS_NFFS_NUM_FILES=4
CONFIG_FS_NFFS_NUM_DIRS=4
CONFIG_FS_NFFS_NUM_INODES=1024
CONFIG_FS_NFFS_NUM_BLOCKS=1024
CONFIG_FS_NFFS_NUM_CACHE_INODES=1
CONFIG_FS_NFFS_NUM_CACHE_BLOCKS=1
CONFIG_FILE_SYSTEM_NFFS=y
CONFIG_NFFS_FILESYSTEM_MAX_AREAS=12

------------------------------------------------------------------------------------------------------------------------

& add following lines in main.c

#include <fs.h>

void main( )
{
    fs_file_t *my_zfp;
    unsigned char ptr[32];


    fs_open(my_zfp,"mesh.prv");
    fs_write(my_zfp,"Hello World !! ",16);
    fs_read(my_zfp,ptr,32);
    fs_close(my_zfp);

    printk("%s",ptr);
}

After all this every thing gets compiled with warning :

 

warning: ‘my_zfp’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  fs_open(my_zfp,"mesh.prv");

Could you please help me, how to initialized my_zfp here ?

 

 

On Tue, Jan 23, 2018 at 1:15 AM, Michael Hope <michaelh@...> wrote:

Hi Vikrant.  You also need to enable NFFS in your configuration - try 'make menuconfig' > File Systems > File system support = y; Supported file systems -> NFFS.

You can also check out the NFFS test case under tests/subsys/fs and especially the configuration in https://github.com/zephyrproject-rtos/zephyr/blob/master/tests/subsys/fs/nffs_fs_api/nrf5x.conf

-- Michael

 

On Fri, 19 Jan 2018 at 11:46 Vikrant More <vikrant8051@...> wrote:

#include <fs.h>

void main( )
{
    fs_file_t *my_zfp;
    unsigned char ptr[32];


    fs_open(my_zfp,"mesh.prv");
    fs_write(my_zfp,"Hello World !! ",16);
    fs_read(my_zfp,ptr,32);
    fs_close(my_zfp);

    printk("%s",ptr);
}

I've edited main.c in my project as mentioned above.

And add CONFIG_FILE_SYSTEM_NFFS=y in prj.conf

 

1st time I got following error,

 

In file included from /home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:3:0:
/home/vikrant/projects/zephyr/zephyr/include/fs.h:66:12: error: ‘MAX_FILE_NAME’ undeclared here (not in a function)
  char name[MAX_FILE_NAME + 1];
            ^~~~~~~~~~~~~
CMakeFiles/app.dir/build.make:302: recipe for target 'CMakeFiles/app.dir/src/main.c.obj' failed
make[2]: *** [CMakeFiles/app.dir/src/main.c.obj] Error 1
CMakeFiles/Makefile2:259: recipe for target 'CMakeFiles/app.dir/all' failed
make[1]: *** [CMakeFiles/app.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

 

To overcome it I added ,    #define MAX_FILE_NAME 10   in zephyr/include/fs.h

 

After this I got following error,

 

../libapp.a(main.c.obj): In function `main':
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:226: undefined reference to `fs_open'
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:227: undefined reference to `fs_write'
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:228: undefined reference to `fs_read'
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:229: undefined reference to `fs_close'
collect2: error: ld returned 1 exit status
zephyr/CMakeFiles/zephyr_prebuilt.dir/build.make:104: recipe for target 'zephyr/zephyr_prebuilt.elf' failed
make[2]: *** [zephyr/zephyr_prebuilt.elf] Error 1
CMakeFiles/Makefile2:569: recipe for target 'zephyr/CMakeFiles/zephyr_prebuilt.dir/all' failed
make[1]: *** [zephyr/CMakeFiles/zephyr_prebuilt.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

 

 

 

 

Following line are already present in zephyr/boards/arm/nrf52840_pca10056/nrf52840_pca10056.dts

 


#if defined(CONFIG_FILE_SYSTEM_NFFS)
        nffs_partition: partition@fc000 {
            label = "nffs";
            reg = <0x000fc000 0x00004000>;
        };
#endif

 

Could you please tell me what I'm missing ?

 

Thank You !!

 

On Fri, Jan 19, 2018 at 12:15 AM, Michael Hope <michaelh@...> wrote:

 

1. Ensure the board has a nffs partition defined in Device Tree.  See here for an example.

2. Turn on CONFIG_FILE_SYSTEM_NFFS in the config

3. Use the APIs in include/fs.h such as fs_open() etc

If you turn on CONFIG_FILE_SYSTEM_SHELL then you'll also get a simple interactive shell where you can list directories etc.

-- Michael

 

On Thu, 18 Jan 2018 at 15:16 Vikrant More <vikrant8051@...> wrote:

Thanks for reply.

 

Where I will find APIs & sample codes based on it to access internal flash of nrf52840 ?

 

 

On Jan 18, 2018 3:38 PM, "Puzdrowski, Andrzej" <Andrzej.Puzdrowski@...> wrote:

NFFS Is supported since 1.10 release:

https://www.zephyrproject.org/releases/1-10-release-december-2017/

 

Andrzej

From: zephyr-devel-bounces@... [mailto:zephyr-devel-bounces@...] On Behalf Of Vikrant More
Sent: Thursday, January 18, 2018 10:09 AM
To: zephyr-devel@...; zephyr-users@...
Subject: [Zephyr-devel] support for NFFS file system

 

Hello World !!

 

My question is related to this link's requirement,
https://lists.zephyrproject.org/pipermail/zephyr-devel/2017-July/007888.html

Is Zephyr going to add support for NFFS file system in upcoming 1.11 (March 20148) release ?

What is current status of NFFS file system development ?

Could anybody explain me from Zephyr Core developer team ?

Thank You !! 


_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@...
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel

_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@...
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel

 

 



On Wed, Jan 24, 2018 at 5:41 PM, Chettimada, Vinayak Kariappa <vinayak.kariappa.chettimada@...> wrote:

Its:

 

fs_file_t my_zfp; // no * please;

 

and

 

fs_open(&my_zfp,"mesh.prv"); // & please J

 

That said, I am not expert on FS!

 

-Vinayak

 

From: zephyr-devel-bounces@... [mailto:zephyr-devel-bounces@...] On Behalf Of Vikrant More
Sent: Wednesday, January 24, 2018 1:06 PM
To: Michael Hope <michaelh@...>
Cc: zephyr-users@...; zephyr-devel@...
Subject: Re: [Zephyr-devel] FW: support for NFFS file system

 

I copied & pasted $zephyr/ext/fs/nffs directory into $zephyr_base/include
----------------------------------------------------------------------------------------------------------------------

& edit $zephyr_base/include/fs/nffs_fs.h as follow

/*
 * Copyright (c) 2017 Codecoup
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#ifndef _NFFS_FS_H_
#define _NFFS_FS_H_

#include <sys/types.h>
#include <nffs/include/nffs/nffs.h>

#ifdef __cplusplus
extern "C" {
#endif

FS_FILE_DEFINE(struct nffs_file *fp);
FS_DIR_DEFINE(struct nffs_dir *dp);

#define MAX_FILE_NAME 256

#ifdef __cplusplus
}
#endif

#endif /* _NFFS_FS_H_ */

-------------------------------------------------------------------------------------------------------------------------

& add following config into my prj.conf

CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y
CONFIG_SOC_FLASH_NRF5=y
CONFIG_SOC_FLASH_NRF5_DEV_NAME="NRF52_FLASH"
CONFIG_SOC_FLASH_NRF5_RADIO_SYNC=y
CONFIG_ZTEST_STACKSIZE=2048
CONFIG_MAIN_STACK_SIZE=1024
CONFIG_HEAP_MEM_POOL_SIZE=1024


CONFIG_FILE_SYSTEM=y
CONFIG_FILE_SYSTEM_NFFS=y
CONFIG_FS_NFFS_NUM_FILES=4
CONFIG_FS_NFFS_NUM_DIRS=4
CONFIG_FS_NFFS_NUM_INODES=1024
CONFIG_FS_NFFS_NUM_BLOCKS=1024
CONFIG_FS_NFFS_NUM_CACHE_INODES=1
CONFIG_FS_NFFS_NUM_CACHE_BLOCKS=1
CONFIG_FILE_SYSTEM_NFFS=y
CONFIG_NFFS_FILESYSTEM_MAX_AREAS=12

------------------------------------------------------------------------------------------------------------------------

& add following lines in main.c

#include <fs.h>

void main( )
{
    fs_file_t *my_zfp;
    unsigned char ptr[32];


    fs_open(my_zfp,"mesh.prv");
    fs_write(my_zfp,"Hello World !! ",16);
    fs_read(my_zfp,ptr,32);
    fs_close(my_zfp);

    printk("%s",ptr);
}

After all this every thing gets compiled with warning :

 

warning: ‘my_zfp’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  fs_open(my_zfp,"mesh.prv");

Could you please help me, how to initialized my_zfp here ?

 

 

On Tue, Jan 23, 2018 at 1:15 AM, Michael Hope <michaelh@...> wrote:

Hi Vikrant.  You also need to enable NFFS in your configuration - try 'make menuconfig' > File Systems > File system support = y; Supported file systems -> NFFS.

You can also check out the NFFS test case under tests/subsys/fs and especially the configuration in https://github.com/zephyrproject-rtos/zephyr/blob/master/tests/subsys/fs/nffs_fs_api/nrf5x.conf

-- Michael

 

On Fri, 19 Jan 2018 at 11:46 Vikrant More <vikrant8051@...> wrote:

#include <fs.h>

void main( )
{
    fs_file_t *my_zfp;
    unsigned char ptr[32];


    fs_open(my_zfp,"mesh.prv");
    fs_write(my_zfp,"Hello World !! ",16);
    fs_read(my_zfp,ptr,32);
    fs_close(my_zfp);

    printk("%s",ptr);
}

I've edited main.c in my project as mentioned above.

And add CONFIG_FILE_SYSTEM_NFFS=y in prj.conf

 

1st time I got following error,

 

In file included from /home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:3:0:
/home/vikrant/projects/zephyr/zephyr/include/fs.h:66:12: error: ‘MAX_FILE_NAME’ undeclared here (not in a function)
  char name[MAX_FILE_NAME + 1];
            ^~~~~~~~~~~~~
CMakeFiles/app.dir/build.make:302: recipe for target 'CMakeFiles/app.dir/src/main.c.obj' failed
make[2]: *** [CMakeFiles/app.dir/src/main.c.obj] Error 1
CMakeFiles/Makefile2:259: recipe for target 'CMakeFiles/app.dir/all' failed
make[1]: *** [CMakeFiles/app.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

 

To overcome it I added ,    #define MAX_FILE_NAME 10   in zephyr/include/fs.h

 

After this I got following error,

 

../libapp.a(main.c.obj): In function `main':
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:226: undefined reference to `fs_open'
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:227: undefined reference to `fs_write'
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:228: undefined reference to `fs_read'
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:229: undefined reference to `fs_close'
collect2: error: ld returned 1 exit status
zephyr/CMakeFiles/zephyr_prebuilt.dir/build.make:104: recipe for target 'zephyr/zephyr_prebuilt.elf' failed
make[2]: *** [zephyr/zephyr_prebuilt.elf] Error 1
CMakeFiles/Makefile2:569: recipe for target 'zephyr/CMakeFiles/zephyr_prebuilt.dir/all' failed
make[1]: *** [zephyr/CMakeFiles/zephyr_prebuilt.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

 

 

 

 

Following line are already present in zephyr/boards/arm/nrf52840_pca10056/nrf52840_pca10056.dts

 


#if defined(CONFIG_FILE_SYSTEM_NFFS)
        nffs_partition: partition@fc000 {
            label = "nffs";
            reg = <0x000fc000 0x00004000>;
        };
#endif

 

Could you please tell me what I'm missing ?

 

Thank You !!

 

On Fri, Jan 19, 2018 at 12:15 AM, Michael Hope <michaelh@...> wrote:

 

1. Ensure the board has a nffs partition defined in Device Tree.  See here for an example.

2. Turn on CONFIG_FILE_SYSTEM_NFFS in the config

3. Use the APIs in include/fs.h such as fs_open() etc

If you turn on CONFIG_FILE_SYSTEM_SHELL then you'll also get a simple interactive shell where you can list directories etc.

-- Michael

 

On Thu, 18 Jan 2018 at 15:16 Vikrant More <vikrant8051@...> wrote:

Thanks for reply.

 

Where I will find APIs & sample codes based on it to access internal flash of nrf52840 ?

 

 

On Jan 18, 2018 3:38 PM, "Puzdrowski, Andrzej" <Andrzej.Puzdrowski@...> wrote:

NFFS Is supported since 1.10 release:

https://www.zephyrproject.org/releases/1-10-release-december-2017/

 

Andrzej

From: zephyr-devel-bounces@... [mailto:zephyr-devel-bounces@...] On Behalf Of Vikrant More
Sent: Thursday, January 18, 2018 10:09 AM
To: zephyr-devel@...; zephyr-users@...
Subject: [Zephyr-devel] support for NFFS file system

 

Hello World !!

 

My question is related to this link's requirement,
https://lists.zephyrproject.org/pipermail/zephyr-devel/2017-July/007888.html

Is Zephyr going to add support for NFFS file system in upcoming 1.11 (March 20148) release ?

What is current status of NFFS file system development ?

Could anybody explain me from Zephyr Core developer team ?

Thank You !! 


_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@...
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel

_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@...
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel

 

 




hiding GATT peripheral services till Passkey pairing

Vikrant More <vikrant8051@...>
 

Hello World !!
I modified $zephyr_base/sample/bluetooth/peripheral/src/main.c as mentioned above.

Using nRF Blinky Android App, I can toggle LED1 on nRF52840-PDK board & can read & receive notification about Button1 status.

But anyone with that App can access my peripheral device.

If I enabled  BT_GATT_PERM_READ_AUTHEN & BT_GATT_PERM_WRITE_AUTHEN for characteristic using BT_GATT_DESCRIPTOR then only paired device could access it.

For password based pairing, we have to access peripheral's UART terminal since it throws random passkey on it.

How to make it static one?

If I reboot the board, why MAC address get updated ?

If I reboot the board, I have to pair it again with Smartphone. Why it so ?
How to avoid this ?

What changes I have to make, so that once paired peripheral will not allow other device to access it unless & until I pressed some button on it ?

How to enable GATT connection, only after password protected pairing process has completed with Smartphone ?

When I do experiments with nRF connect App I can connect to other BLE devices surrounding to me but I can't see services running on them. How to achive that ?

Thank You !!







Re: [Zephyr-devel] FW: support for NFFS file system

Vikrant More <vikrant8051@...>
 

fs_open( ) returns -19 instead of 0.

On Thu, Jan 25, 2018 at 12:10 AM, Michael Hope <michaelh@...> wrote:
Hi Vikrant.  I'm pretty sure you're reading past the end of the file - you'll need to close and reopen it before you can read back what you just wrote.  Try something like:

fs_open(...)
fs_write(...)
fs_close(...)

fs_open(...)
fs_read(...)

I also recommend checking the return value when you're experimenting.  In this case, you'll find that fs_read() is returning zero, i.e. it read zero bytes which is a good clue as to why there's no data in the buffer.

-- Michael

On Wed, 24 Jan 2018 at 13:29 Vikrant More <vikrant8051@...> wrote:
Hi Vinayak, it works !!

I make following changes .....

    fs_file_t my_zfp;
    unsigned char ptr[32];

    for(cntr=0;cntr<=31;cntr++)
    {
        ptr[cntr]='@';
    }

    fs_open(&my_zfp,"mesh.prv");
    fs_write(&my_zfp,"0123456789ABCDEF",16);
    fs_read(&my_zfp,ptr,32);
    fs_close(&my_zfp);

    for(cntr=0;cntr<=31;cntr++)
    {
        printk("%c",ptr[cntr]);
    }

But it prints --> @@@@@@@@@@@@@@@@
instead of --> 0123456789ABCDEF

Any clue ??

Thanks !!

On Wed, Jan 24, 2018 at 5:41 PM, Chettimada, Vinayak Kariappa <vinayak.kariappa.chettimada@nordicsemi.no> wrote:

Its:

 

fs_file_t my_zfp; // no * please;

 

and

 

fs_open(&my_zfp,"mesh.prv"); // & please J

 

That said, I am not expert on FS!

 

-Vinayak

 

From: zephyr-devel-bounces@lists.zephyrproject.org [mailto:zephyr-devel-bounces@lists.zephyrproject.org] On Behalf Of Vikrant More
Sent: Wednesday, January 24, 2018 1:06 PM
To: Michael Hope <michaelh@...>
Cc: zephyr-users@lists.zephyrproject.org; zephyr-devel@lists.zephyrproject.org
Subject: Re: [Zephyr-devel] FW: support for NFFS file system

 

I copied & pasted $zephyr/ext/fs/nffs directory into $zephyr_base/include
----------------------------------------------------------------------------------------------------------------------

& edit $zephyr_base/include/fs/nffs_fs.h as follow

/*
 * Copyright (c) 2017 Codecoup
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#ifndef _NFFS_FS_H_
#define _NFFS_FS_H_

#include <sys/types.h>
#include <nffs/include/nffs/nffs.h>

#ifdef __cplusplus
extern "C" {
#endif

FS_FILE_DEFINE(struct nffs_file *fp);
FS_DIR_DEFINE(struct nffs_dir *dp);

#define MAX_FILE_NAME 256

#ifdef __cplusplus
}
#endif

#endif /* _NFFS_FS_H_ */

-------------------------------------------------------------------------------------------------------------------------

& add following config into my prj.conf

CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y
CONFIG_SOC_FLASH_NRF5=y
CONFIG_SOC_FLASH_NRF5_DEV_NAME="NRF52_FLASH"
CONFIG_SOC_FLASH_NRF5_RADIO_SYNC=y
CONFIG_ZTEST_STACKSIZE=2048
CONFIG_MAIN_STACK_SIZE=1024
CONFIG_HEAP_MEM_POOL_SIZE=1024


CONFIG_FILE_SYSTEM=y
CONFIG_FILE_SYSTEM_NFFS=y
CONFIG_FS_NFFS_NUM_FILES=4
CONFIG_FS_NFFS_NUM_DIRS=4
CONFIG_FS_NFFS_NUM_INODES=1024
CONFIG_FS_NFFS_NUM_BLOCKS=1024
CONFIG_FS_NFFS_NUM_CACHE_INODES=1
CONFIG_FS_NFFS_NUM_CACHE_BLOCKS=1
CONFIG_FILE_SYSTEM_NFFS=y
CONFIG_NFFS_FILESYSTEM_MAX_AREAS=12

------------------------------------------------------------------------------------------------------------------------

& add following lines in main.c

#include <fs.h>

void main( )
{
    fs_file_t *my_zfp;
    unsigned char ptr[32];


    fs_open(my_zfp,"mesh.prv");
    fs_write(my_zfp,"Hello World !! ",16);
    fs_read(my_zfp,ptr,32);
    fs_close(my_zfp);

    printk("%s",ptr);
}

After all this every thing gets compiled with warning :

 

warning: ‘my_zfp’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  fs_open(my_zfp,"mesh.prv");

Could you please help me, how to initialized my_zfp here ?

 

 

On Tue, Jan 23, 2018 at 1:15 AM, Michael Hope <michaelh@...> wrote:

Hi Vikrant.  You also need to enable NFFS in your configuration - try 'make menuconfig' > File Systems > File system support = y; Supported file systems -> NFFS.

You can also check out the NFFS test case under tests/subsys/fs and especially the configuration in https://github.com/zephyrproject-rtos/zephyr/blob/master/tests/subsys/fs/nffs_fs_api/nrf5x.conf

-- Michael

 

On Fri, 19 Jan 2018 at 11:46 Vikrant More <vikrant8051@...> wrote:

#include <fs.h>

void main( )
{
    fs_file_t *my_zfp;
    unsigned char ptr[32];


    fs_open(my_zfp,"mesh.prv");
    fs_write(my_zfp,"Hello World !! ",16);
    fs_read(my_zfp,ptr,32);
    fs_close(my_zfp);

    printk("%s",ptr);
}

I've edited main.c in my project as mentioned above.

And add CONFIG_FILE_SYSTEM_NFFS=y in prj.conf

 

1st time I got following error,

 

In file included from /home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:3:0:
/home/vikrant/projects/zephyr/zephyr/include/fs.h:66:12: error: ‘MAX_FILE_NAME’ undeclared here (not in a function)
  char name[MAX_FILE_NAME + 1];
            ^~~~~~~~~~~~~
CMakeFiles/app.dir/build.make:302: recipe for target 'CMakeFiles/app.dir/src/main.c.obj' failed
make[2]: *** [CMakeFiles/app.dir/src/main.c.obj] Error 1
CMakeFiles/Makefile2:259: recipe for target 'CMakeFiles/app.dir/all' failed
make[1]: *** [CMakeFiles/app.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

 

To overcome it I added ,    #define MAX_FILE_NAME 10   in zephyr/include/fs.h

 

After this I got following error,

 

../libapp.a(main.c.obj): In function `main':
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:226: undefined reference to `fs_open'
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:227: undefined reference to `fs_write'
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:228: undefined reference to `fs_read'
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:229: undefined reference to `fs_close'
collect2: error: ld returned 1 exit status
zephyr/CMakeFiles/zephyr_prebuilt.dir/build.make:104: recipe for target 'zephyr/zephyr_prebuilt.elf' failed
make[2]: *** [zephyr/zephyr_prebuilt.elf] Error 1
CMakeFiles/Makefile2:569: recipe for target 'zephyr/CMakeFiles/zephyr_prebuilt.dir/all' failed
make[1]: *** [zephyr/CMakeFiles/zephyr_prebuilt.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

 

 

 

 

Following line are already present in zephyr/boards/arm/nrf52840_pca10056/nrf52840_pca10056.dts

 


#if defined(CONFIG_FILE_SYSTEM_NFFS)
        nffs_partition: partition@fc000 {
            label = "nffs";
            reg = <0x000fc000 0x00004000>;
        };
#endif

 

Could you please tell me what I'm missing ?

 

Thank You !!

 

On Fri, Jan 19, 2018 at 12:15 AM, Michael Hope <michaelh@...> wrote:

 

1. Ensure the board has a nffs partition defined in Device Tree.  See here for an example.

2. Turn on CONFIG_FILE_SYSTEM_NFFS in the config

3. Use the APIs in include/fs.h such as fs_open() etc

If you turn on CONFIG_FILE_SYSTEM_SHELL then you'll also get a simple interactive shell where you can list directories etc.

-- Michael

 

On Thu, 18 Jan 2018 at 15:16 Vikrant More <vikrant8051@...> wrote:

Thanks for reply.

 

Where I will find APIs & sample codes based on it to access internal flash of nrf52840 ?

 

 

On Jan 18, 2018 3:38 PM, "Puzdrowski, Andrzej" <Andrzej.Puzdrowski@nordicsemi.no> wrote:

NFFS Is supported since 1.10 release:

https://www.zephyrproject.org/releases/1-10-release-december-2017/

 

Andrzej

From: zephyr-devel-bounces@lists.zephyrproject.org [mailto:zephyr-devel-bounces@lists.zephyrproject.org] On Behalf Of Vikrant More
Sent: Thursday, January 18, 2018 10:09 AM
To: zephyr-devel@lists.zephyrproject.org; zephyr-users@lists.zephyrproject.org
Subject: [Zephyr-devel] support for NFFS file system

 

Hello World !!

 

My question is related to this link's requirement,
https://lists.zephyrproject.org/pipermail/zephyr-devel/2017-July/007888.html

Is Zephyr going to add support for NFFS file system in upcoming 1.11 (March 20148) release ?

What is current status of NFFS file system development ?

Could anybody explain me from Zephyr Core developer team ?

Thank You !! 


_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@lists.zephyrproject.org
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel

_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@lists.zephyrproject.org
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel

 

 



On Wed, Jan 24, 2018 at 5:41 PM, Chettimada, Vinayak Kariappa <vinayak.kariappa.chettimada@nordicsemi.no> wrote:

Its:

 

fs_file_t my_zfp; // no * please;

 

and

 

fs_open(&my_zfp,"mesh.prv"); // & please J

 

That said, I am not expert on FS!

 

-Vinayak

 

From: zephyr-devel-bounces@lists.zephyrproject.org [mailto:zephyr-devel-bounces@lists.zephyrproject.org] On Behalf Of Vikrant More
Sent: Wednesday, January 24, 2018 1:06 PM
To: Michael Hope <michaelh@...>
Cc: zephyr-users@lists.zephyrproject.org; zephyr-devel@lists.zephyrproject.org
Subject: Re: [Zephyr-devel] FW: support for NFFS file system

 

I copied & pasted $zephyr/ext/fs/nffs directory into $zephyr_base/include
----------------------------------------------------------------------------------------------------------------------

& edit $zephyr_base/include/fs/nffs_fs.h as follow

/*
 * Copyright (c) 2017 Codecoup
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#ifndef _NFFS_FS_H_
#define _NFFS_FS_H_

#include <sys/types.h>
#include <nffs/include/nffs/nffs.h>

#ifdef __cplusplus
extern "C" {
#endif

FS_FILE_DEFINE(struct nffs_file *fp);
FS_DIR_DEFINE(struct nffs_dir *dp);

#define MAX_FILE_NAME 256

#ifdef __cplusplus
}
#endif

#endif /* _NFFS_FS_H_ */

-------------------------------------------------------------------------------------------------------------------------

& add following config into my prj.conf

CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y
CONFIG_SOC_FLASH_NRF5=y
CONFIG_SOC_FLASH_NRF5_DEV_NAME="NRF52_FLASH"
CONFIG_SOC_FLASH_NRF5_RADIO_SYNC=y
CONFIG_ZTEST_STACKSIZE=2048
CONFIG_MAIN_STACK_SIZE=1024
CONFIG_HEAP_MEM_POOL_SIZE=1024


CONFIG_FILE_SYSTEM=y
CONFIG_FILE_SYSTEM_NFFS=y
CONFIG_FS_NFFS_NUM_FILES=4
CONFIG_FS_NFFS_NUM_DIRS=4
CONFIG_FS_NFFS_NUM_INODES=1024
CONFIG_FS_NFFS_NUM_BLOCKS=1024
CONFIG_FS_NFFS_NUM_CACHE_INODES=1
CONFIG_FS_NFFS_NUM_CACHE_BLOCKS=1
CONFIG_FILE_SYSTEM_NFFS=y
CONFIG_NFFS_FILESYSTEM_MAX_AREAS=12

------------------------------------------------------------------------------------------------------------------------

& add following lines in main.c

#include <fs.h>

void main( )
{
    fs_file_t *my_zfp;
    unsigned char ptr[32];


    fs_open(my_zfp,"mesh.prv");
    fs_write(my_zfp,"Hello World !! ",16);
    fs_read(my_zfp,ptr,32);
    fs_close(my_zfp);

    printk("%s",ptr);
}

After all this every thing gets compiled with warning :

 

warning: ‘my_zfp’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  fs_open(my_zfp,"mesh.prv");

Could you please help me, how to initialized my_zfp here ?

 

 

On Tue, Jan 23, 2018 at 1:15 AM, Michael Hope <michaelh@...> wrote:

Hi Vikrant.  You also need to enable NFFS in your configuration - try 'make menuconfig' > File Systems > File system support = y; Supported file systems -> NFFS.

You can also check out the NFFS test case under tests/subsys/fs and especially the configuration in https://github.com/zephyrproject-rtos/zephyr/blob/master/tests/subsys/fs/nffs_fs_api/nrf5x.conf

-- Michael

 

On Fri, 19 Jan 2018 at 11:46 Vikrant More <vikrant8051@...> wrote:

#include <fs.h>

void main( )
{
    fs_file_t *my_zfp;
    unsigned char ptr[32];


    fs_open(my_zfp,"mesh.prv");
    fs_write(my_zfp,"Hello World !! ",16);
    fs_read(my_zfp,ptr,32);
    fs_close(my_zfp);

    printk("%s",ptr);
}

I've edited main.c in my project as mentioned above.

And add CONFIG_FILE_SYSTEM_NFFS=y in prj.conf

 

1st time I got following error,

 

In file included from /home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:3:0:
/home/vikrant/projects/zephyr/zephyr/include/fs.h:66:12: error: ‘MAX_FILE_NAME’ undeclared here (not in a function)
  char name[MAX_FILE_NAME + 1];
            ^~~~~~~~~~~~~
CMakeFiles/app.dir/build.make:302: recipe for target 'CMakeFiles/app.dir/src/main.c.obj' failed
make[2]: *** [CMakeFiles/app.dir/src/main.c.obj] Error 1
CMakeFiles/Makefile2:259: recipe for target 'CMakeFiles/app.dir/all' failed
make[1]: *** [CMakeFiles/app.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

 

To overcome it I added ,    #define MAX_FILE_NAME 10   in zephyr/include/fs.h

 

After this I got following error,

 

../libapp.a(main.c.obj): In function `main':
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:226: undefined reference to `fs_open'
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:227: undefined reference to `fs_write'
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:228: undefined reference to `fs_read'
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:229: undefined reference to `fs_close'
collect2: error: ld returned 1 exit status
zephyr/CMakeFiles/zephyr_prebuilt.dir/build.make:104: recipe for target 'zephyr/zephyr_prebuilt.elf' failed
make[2]: *** [zephyr/zephyr_prebuilt.elf] Error 1
CMakeFiles/Makefile2:569: recipe for target 'zephyr/CMakeFiles/zephyr_prebuilt.dir/all' failed
make[1]: *** [zephyr/CMakeFiles/zephyr_prebuilt.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

 

 

 

 

Following line are already present in zephyr/boards/arm/nrf52840_pca10056/nrf52840_pca10056.dts

 


#if defined(CONFIG_FILE_SYSTEM_NFFS)
        nffs_partition: partition@fc000 {
            label = "nffs";
            reg = <0x000fc000 0x00004000>;
        };
#endif

 

Could you please tell me what I'm missing ?

 

Thank You !!

 

On Fri, Jan 19, 2018 at 12:15 AM, Michael Hope <michaelh@...> wrote:

 

1. Ensure the board has a nffs partition defined in Device Tree.  See here for an example.

2. Turn on CONFIG_FILE_SYSTEM_NFFS in the config

3. Use the APIs in include/fs.h such as fs_open() etc

If you turn on CONFIG_FILE_SYSTEM_SHELL then you'll also get a simple interactive shell where you can list directories etc.

-- Michael

 

On Thu, 18 Jan 2018 at 15:16 Vikrant More <vikrant8051@...> wrote:

Thanks for reply.

 

Where I will find APIs & sample codes based on it to access internal flash of nrf52840 ?

 

 

On Jan 18, 2018 3:38 PM, "Puzdrowski, Andrzej" <Andrzej.Puzdrowski@nordicsemi.no> wrote:

NFFS Is supported since 1.10 release:

https://www.zephyrproject.org/releases/1-10-release-december-2017/

 

Andrzej

From: zephyr-devel-bounces@lists.zephyrproject.org [mailto:zephyr-devel-bounces@lists.zephyrproject.org] On Behalf Of Vikrant More
Sent: Thursday, January 18, 2018 10:09 AM
To: zephyr-devel@lists.zephyrproject.org; zephyr-users@lists.zephyrproject.org
Subject: [Zephyr-devel] support for NFFS file system

 

Hello World !!

 

My question is related to this link's requirement,
https://lists.zephyrproject.org/pipermail/zephyr-devel/2017-July/007888.html

Is Zephyr going to add support for NFFS file system in upcoming 1.11 (March 20148) release ?

What is current status of NFFS file system development ?

Could anybody explain me from Zephyr Core developer team ?

Thank You !! 


_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@lists.zephyrproject.org
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel

_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@lists.zephyrproject.org
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel

 

 




Re: [Zephyr-devel] FW: support for NFFS file system

Michael Hope
 

Hi Vikrant.  I'm pretty sure you're reading past the end of the file - you'll need to close and reopen it before you can read back what you just wrote.  Try something like:

fs_open(...)
fs_write(...)
fs_close(...)

fs_open(...)
fs_read(...)

I also recommend checking the return value when you're experimenting.  In this case, you'll find that fs_read() is returning zero, i.e. it read zero bytes which is a good clue as to why there's no data in the buffer.

-- Michael

On Wed, 24 Jan 2018 at 13:29 Vikrant More <vikrant8051@...> wrote:
Hi Vinayak, it works !!

I make following changes .....

    fs_file_t my_zfp;
    unsigned char ptr[32];

    for(cntr=0;cntr<=31;cntr++)
    {
        ptr[cntr]='@';
    }

    fs_open(&my_zfp,"mesh.prv");
    fs_write(&my_zfp,"0123456789ABCDEF",16);
    fs_read(&my_zfp,ptr,32);
    fs_close(&my_zfp);

    for(cntr=0;cntr<=31;cntr++)
    {
        printk("%c",ptr[cntr]);
    }

But it prints --> @@@@@@@@@@@@@@@@
instead of --> 0123456789ABCDEF

Any clue ??

Thanks !!

On Wed, Jan 24, 2018 at 5:41 PM, Chettimada, Vinayak Kariappa <vinayak.kariappa.chettimada@...> wrote:

Its:

 

fs_file_t my_zfp; // no * please;

 

and

 

fs_open(&my_zfp,"mesh.prv"); // & please J

 

That said, I am not expert on FS!

 

-Vinayak

 

From: zephyr-devel-bounces@... [mailto:zephyr-devel-bounces@...] On Behalf Of Vikrant More
Sent: Wednesday, January 24, 2018 1:06 PM
To: Michael Hope <michaelh@...>
Cc: zephyr-users@...; zephyr-devel@...
Subject: Re: [Zephyr-devel] FW: support for NFFS file system

 

I copied & pasted $zephyr/ext/fs/nffs directory into $zephyr_base/include
----------------------------------------------------------------------------------------------------------------------

& edit $zephyr_base/include/fs/nffs_fs.h as follow

/*
 * Copyright (c) 2017 Codecoup
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#ifndef _NFFS_FS_H_
#define _NFFS_FS_H_

#include <sys/types.h>
#include <nffs/include/nffs/nffs.h>

#ifdef __cplusplus
extern "C" {
#endif

FS_FILE_DEFINE(struct nffs_file *fp);
FS_DIR_DEFINE(struct nffs_dir *dp);

#define MAX_FILE_NAME 256

#ifdef __cplusplus
}
#endif

#endif /* _NFFS_FS_H_ */

-------------------------------------------------------------------------------------------------------------------------

& add following config into my prj.conf

CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y
CONFIG_SOC_FLASH_NRF5=y
CONFIG_SOC_FLASH_NRF5_DEV_NAME="NRF52_FLASH"
CONFIG_SOC_FLASH_NRF5_RADIO_SYNC=y
CONFIG_ZTEST_STACKSIZE=2048
CONFIG_MAIN_STACK_SIZE=1024
CONFIG_HEAP_MEM_POOL_SIZE=1024


CONFIG_FILE_SYSTEM=y
CONFIG_FILE_SYSTEM_NFFS=y
CONFIG_FS_NFFS_NUM_FILES=4
CONFIG_FS_NFFS_NUM_DIRS=4
CONFIG_FS_NFFS_NUM_INODES=1024
CONFIG_FS_NFFS_NUM_BLOCKS=1024
CONFIG_FS_NFFS_NUM_CACHE_INODES=1
CONFIG_FS_NFFS_NUM_CACHE_BLOCKS=1
CONFIG_FILE_SYSTEM_NFFS=y
CONFIG_NFFS_FILESYSTEM_MAX_AREAS=12

------------------------------------------------------------------------------------------------------------------------

& add following lines in main.c

#include <fs.h>

void main( )
{
    fs_file_t *my_zfp;
    unsigned char ptr[32];


    fs_open(my_zfp,"mesh.prv");
    fs_write(my_zfp,"Hello World !! ",16);
    fs_read(my_zfp,ptr,32);
    fs_close(my_zfp);

    printk("%s",ptr);
}

After all this every thing gets compiled with warning :

 

warning: ‘my_zfp’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  fs_open(my_zfp,"mesh.prv");

Could you please help me, how to initialized my_zfp here ?

 

 

On Tue, Jan 23, 2018 at 1:15 AM, Michael Hope <michaelh@...> wrote:

Hi Vikrant.  You also need to enable NFFS in your configuration - try 'make menuconfig' > File Systems > File system support = y; Supported file systems -> NFFS.

You can also check out the NFFS test case under tests/subsys/fs and especially the configuration in https://github.com/zephyrproject-rtos/zephyr/blob/master/tests/subsys/fs/nffs_fs_api/nrf5x.conf

-- Michael

 

On Fri, 19 Jan 2018 at 11:46 Vikrant More <vikrant8051@...> wrote:

#include <fs.h>

void main( )
{
    fs_file_t *my_zfp;
    unsigned char ptr[32];


    fs_open(my_zfp,"mesh.prv");
    fs_write(my_zfp,"Hello World !! ",16);
    fs_read(my_zfp,ptr,32);
    fs_close(my_zfp);

    printk("%s",ptr);
}

I've edited main.c in my project as mentioned above.

And add CONFIG_FILE_SYSTEM_NFFS=y in prj.conf

 

1st time I got following error,

 

In file included from /home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:3:0:
/home/vikrant/projects/zephyr/zephyr/include/fs.h:66:12: error: ‘MAX_FILE_NAME’ undeclared here (not in a function)
  char name[MAX_FILE_NAME + 1];
            ^~~~~~~~~~~~~
CMakeFiles/app.dir/build.make:302: recipe for target 'CMakeFiles/app.dir/src/main.c.obj' failed
make[2]: *** [CMakeFiles/app.dir/src/main.c.obj] Error 1
CMakeFiles/Makefile2:259: recipe for target 'CMakeFiles/app.dir/all' failed
make[1]: *** [CMakeFiles/app.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

 

To overcome it I added ,    #define MAX_FILE_NAME 10   in zephyr/include/fs.h

 

After this I got following error,

 

../libapp.a(main.c.obj): In function `main':
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:226: undefined reference to `fs_open'
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:227: undefined reference to `fs_write'
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:228: undefined reference to `fs_read'
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:229: undefined reference to `fs_close'
collect2: error: ld returned 1 exit status
zephyr/CMakeFiles/zephyr_prebuilt.dir/build.make:104: recipe for target 'zephyr/zephyr_prebuilt.elf' failed
make[2]: *** [zephyr/zephyr_prebuilt.elf] Error 1
CMakeFiles/Makefile2:569: recipe for target 'zephyr/CMakeFiles/zephyr_prebuilt.dir/all' failed
make[1]: *** [zephyr/CMakeFiles/zephyr_prebuilt.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

 

 

 

 

Following line are already present in zephyr/boards/arm/nrf52840_pca10056/nrf52840_pca10056.dts

 


#if defined(CONFIG_FILE_SYSTEM_NFFS)
        nffs_partition: partition@fc000 {
            label = "nffs";
            reg = <0x000fc000 0x00004000>;
        };
#endif

 

Could you please tell me what I'm missing ?

 

Thank You !!

 

On Fri, Jan 19, 2018 at 12:15 AM, Michael Hope <michaelh@...> wrote:

 

1. Ensure the board has a nffs partition defined in Device Tree.  See here for an example.

2. Turn on CONFIG_FILE_SYSTEM_NFFS in the config

3. Use the APIs in include/fs.h such as fs_open() etc

If you turn on CONFIG_FILE_SYSTEM_SHELL then you'll also get a simple interactive shell where you can list directories etc.

-- Michael

 

On Thu, 18 Jan 2018 at 15:16 Vikrant More <vikrant8051@...> wrote:

Thanks for reply.

 

Where I will find APIs & sample codes based on it to access internal flash of nrf52840 ?

 

 

On Jan 18, 2018 3:38 PM, "Puzdrowski, Andrzej" <Andrzej.Puzdrowski@...> wrote:

NFFS Is supported since 1.10 release:

https://www.zephyrproject.org/releases/1-10-release-december-2017/

 

Andrzej

From: zephyr-devel-bounces@... [mailto:zephyr-devel-bounces@...] On Behalf Of Vikrant More
Sent: Thursday, January 18, 2018 10:09 AM
To: zephyr-devel@...; zephyr-users@...
Subject: [Zephyr-devel] support for NFFS file system

 

Hello World !!

 

My question is related to this link's requirement,
https://lists.zephyrproject.org/pipermail/zephyr-devel/2017-July/007888.html

Is Zephyr going to add support for NFFS file system in upcoming 1.11 (March 20148) release ?

What is current status of NFFS file system development ?

Could anybody explain me from Zephyr Core developer team ?

Thank You !! 


_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@...
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel

_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@...
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel

 

 



On Wed, Jan 24, 2018 at 5:41 PM, Chettimada, Vinayak Kariappa <vinayak.kariappa.chettimada@...> wrote:

Its:

 

fs_file_t my_zfp; // no * please;

 

and

 

fs_open(&my_zfp,"mesh.prv"); // & please J

 

That said, I am not expert on FS!

 

-Vinayak

 

From: zephyr-devel-bounces@... [mailto:zephyr-devel-bounces@...] On Behalf Of Vikrant More
Sent: Wednesday, January 24, 2018 1:06 PM
To: Michael Hope <michaelh@...>
Cc: zephyr-users@...; zephyr-devel@...
Subject: Re: [Zephyr-devel] FW: support for NFFS file system

 

I copied & pasted $zephyr/ext/fs/nffs directory into $zephyr_base/include
----------------------------------------------------------------------------------------------------------------------

& edit $zephyr_base/include/fs/nffs_fs.h as follow

/*
 * Copyright (c) 2017 Codecoup
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#ifndef _NFFS_FS_H_
#define _NFFS_FS_H_

#include <sys/types.h>
#include <nffs/include/nffs/nffs.h>

#ifdef __cplusplus
extern "C" {
#endif

FS_FILE_DEFINE(struct nffs_file *fp);
FS_DIR_DEFINE(struct nffs_dir *dp);

#define MAX_FILE_NAME 256

#ifdef __cplusplus
}
#endif

#endif /* _NFFS_FS_H_ */

-------------------------------------------------------------------------------------------------------------------------

& add following config into my prj.conf

CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y
CONFIG_SOC_FLASH_NRF5=y
CONFIG_SOC_FLASH_NRF5_DEV_NAME="NRF52_FLASH"
CONFIG_SOC_FLASH_NRF5_RADIO_SYNC=y
CONFIG_ZTEST_STACKSIZE=2048
CONFIG_MAIN_STACK_SIZE=1024
CONFIG_HEAP_MEM_POOL_SIZE=1024


CONFIG_FILE_SYSTEM=y
CONFIG_FILE_SYSTEM_NFFS=y
CONFIG_FS_NFFS_NUM_FILES=4
CONFIG_FS_NFFS_NUM_DIRS=4
CONFIG_FS_NFFS_NUM_INODES=1024
CONFIG_FS_NFFS_NUM_BLOCKS=1024
CONFIG_FS_NFFS_NUM_CACHE_INODES=1
CONFIG_FS_NFFS_NUM_CACHE_BLOCKS=1
CONFIG_FILE_SYSTEM_NFFS=y
CONFIG_NFFS_FILESYSTEM_MAX_AREAS=12

------------------------------------------------------------------------------------------------------------------------

& add following lines in main.c

#include <fs.h>

void main( )
{
    fs_file_t *my_zfp;
    unsigned char ptr[32];


    fs_open(my_zfp,"mesh.prv");
    fs_write(my_zfp,"Hello World !! ",16);
    fs_read(my_zfp,ptr,32);
    fs_close(my_zfp);

    printk("%s",ptr);
}

After all this every thing gets compiled with warning :

 

warning: ‘my_zfp’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  fs_open(my_zfp,"mesh.prv");

Could you please help me, how to initialized my_zfp here ?

 

 

On Tue, Jan 23, 2018 at 1:15 AM, Michael Hope <michaelh@...> wrote:

Hi Vikrant.  You also need to enable NFFS in your configuration - try 'make menuconfig' > File Systems > File system support = y; Supported file systems -> NFFS.

You can also check out the NFFS test case under tests/subsys/fs and especially the configuration in https://github.com/zephyrproject-rtos/zephyr/blob/master/tests/subsys/fs/nffs_fs_api/nrf5x.conf

-- Michael

 

On Fri, 19 Jan 2018 at 11:46 Vikrant More <vikrant8051@...> wrote:

#include <fs.h>

void main( )
{
    fs_file_t *my_zfp;
    unsigned char ptr[32];


    fs_open(my_zfp,"mesh.prv");
    fs_write(my_zfp,"Hello World !! ",16);
    fs_read(my_zfp,ptr,32);
    fs_close(my_zfp);

    printk("%s",ptr);
}

I've edited main.c in my project as mentioned above.

And add CONFIG_FILE_SYSTEM_NFFS=y in prj.conf

 

1st time I got following error,

 

In file included from /home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:3:0:
/home/vikrant/projects/zephyr/zephyr/include/fs.h:66:12: error: ‘MAX_FILE_NAME’ undeclared here (not in a function)
  char name[MAX_FILE_NAME + 1];
            ^~~~~~~~~~~~~
CMakeFiles/app.dir/build.make:302: recipe for target 'CMakeFiles/app.dir/src/main.c.obj' failed
make[2]: *** [CMakeFiles/app.dir/src/main.c.obj] Error 1
CMakeFiles/Makefile2:259: recipe for target 'CMakeFiles/app.dir/all' failed
make[1]: *** [CMakeFiles/app.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

 

To overcome it I added ,    #define MAX_FILE_NAME 10   in zephyr/include/fs.h

 

After this I got following error,

 

../libapp.a(main.c.obj): In function `main':
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:226: undefined reference to `fs_open'
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:227: undefined reference to `fs_write'
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:228: undefined reference to `fs_read'
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:229: undefined reference to `fs_close'
collect2: error: ld returned 1 exit status
zephyr/CMakeFiles/zephyr_prebuilt.dir/build.make:104: recipe for target 'zephyr/zephyr_prebuilt.elf' failed
make[2]: *** [zephyr/zephyr_prebuilt.elf] Error 1
CMakeFiles/Makefile2:569: recipe for target 'zephyr/CMakeFiles/zephyr_prebuilt.dir/all' failed
make[1]: *** [zephyr/CMakeFiles/zephyr_prebuilt.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

 

 

 

 

Following line are already present in zephyr/boards/arm/nrf52840_pca10056/nrf52840_pca10056.dts

 


#if defined(CONFIG_FILE_SYSTEM_NFFS)
        nffs_partition: partition@fc000 {
            label = "nffs";
            reg = <0x000fc000 0x00004000>;
        };
#endif

 

Could you please tell me what I'm missing ?

 

Thank You !!

 

On Fri, Jan 19, 2018 at 12:15 AM, Michael Hope <michaelh@...> wrote:

 

1. Ensure the board has a nffs partition defined in Device Tree.  See here for an example.

2. Turn on CONFIG_FILE_SYSTEM_NFFS in the config

3. Use the APIs in include/fs.h such as fs_open() etc

If you turn on CONFIG_FILE_SYSTEM_SHELL then you'll also get a simple interactive shell where you can list directories etc.

-- Michael

 

On Thu, 18 Jan 2018 at 15:16 Vikrant More <vikrant8051@...> wrote:

Thanks for reply.

 

Where I will find APIs & sample codes based on it to access internal flash of nrf52840 ?

 

 

On Jan 18, 2018 3:38 PM, "Puzdrowski, Andrzej" <Andrzej.Puzdrowski@...> wrote:

NFFS Is supported since 1.10 release:

https://www.zephyrproject.org/releases/1-10-release-december-2017/

 

Andrzej

From: zephyr-devel-bounces@... [mailto:zephyr-devel-bounces@...] On Behalf Of Vikrant More
Sent: Thursday, January 18, 2018 10:09 AM
To: zephyr-devel@...; zephyr-users@...
Subject: [Zephyr-devel] support for NFFS file system

 

Hello World !!

 

My question is related to this link's requirement,
https://lists.zephyrproject.org/pipermail/zephyr-devel/2017-July/007888.html

Is Zephyr going to add support for NFFS file system in upcoming 1.11 (March 20148) release ?

What is current status of NFFS file system development ?

Could anybody explain me from Zephyr Core developer team ?

Thank You !! 


_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@...
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel

_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@...
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel

 

 



Re: [Zephyr-devel] FW: support for NFFS file system

Vikrant More <vikrant8051@...>
 

Hi Vinayak, it works !!

I make following changes .....

    fs_file_t my_zfp;
    unsigned char ptr[32];

    for(cntr=0;cntr<=31;cntr++)
    {
        ptr[cntr]='@';
    }

    fs_open(&my_zfp,"mesh.prv");
    fs_write(&my_zfp,"0123456789ABCDEF",16);
    fs_read(&my_zfp,ptr,32);
    fs_close(&my_zfp);

    for(cntr=0;cntr<=31;cntr++)
    {
        printk("%c",ptr[cntr]);
    }

But it prints --> @@@@@@@@@@@@@@@@
instead of --> 0123456789ABCDEF

Any clue ??

Thanks !!

On Wed, Jan 24, 2018 at 5:41 PM, Chettimada, Vinayak Kariappa <vinayak.kariappa.chettimada@...> wrote:

Its:

 

fs_file_t my_zfp; // no * please;

 

and

 

fs_open(&my_zfp,"mesh.prv"); // & please J

 

That said, I am not expert on FS!

 

-Vinayak

 

From: zephyr-devel-bounces@lists.zephyrproject.org [mailto:zephyr-devel-bounces@lists.zephyrproject.org] On Behalf Of Vikrant More
Sent: Wednesday, January 24, 2018 1:06 PM
To: Michael Hope <michaelh@...>
Cc: zephyr-users@lists.zephyrproject.org; zephyr-devel@lists.zephyrproject.org
Subject: Re: [Zephyr-devel] FW: support for NFFS file system

 

I copied & pasted $zephyr/ext/fs/nffs directory into $zephyr_base/include
----------------------------------------------------------------------------------------------------------------------

& edit $zephyr_base/include/fs/nffs_fs.h as follow

/*
 * Copyright (c) 2017 Codecoup
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#ifndef _NFFS_FS_H_
#define _NFFS_FS_H_

#include <sys/types.h>
#include <nffs/include/nffs/nffs.h>

#ifdef __cplusplus
extern "C" {
#endif

FS_FILE_DEFINE(struct nffs_file *fp);
FS_DIR_DEFINE(struct nffs_dir *dp);

#define MAX_FILE_NAME 256

#ifdef __cplusplus
}
#endif

#endif /* _NFFS_FS_H_ */

-------------------------------------------------------------------------------------------------------------------------

& add following config into my prj.conf

CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y
CONFIG_SOC_FLASH_NRF5=y
CONFIG_SOC_FLASH_NRF5_DEV_NAME="NRF52_FLASH"
CONFIG_SOC_FLASH_NRF5_RADIO_SYNC=y
CONFIG_ZTEST_STACKSIZE=2048
CONFIG_MAIN_STACK_SIZE=1024
CONFIG_HEAP_MEM_POOL_SIZE=1024


CONFIG_FILE_SYSTEM=y
CONFIG_FILE_SYSTEM_NFFS=y
CONFIG_FS_NFFS_NUM_FILES=4
CONFIG_FS_NFFS_NUM_DIRS=4
CONFIG_FS_NFFS_NUM_INODES=1024
CONFIG_FS_NFFS_NUM_BLOCKS=1024
CONFIG_FS_NFFS_NUM_CACHE_INODES=1
CONFIG_FS_NFFS_NUM_CACHE_BLOCKS=1
CONFIG_FILE_SYSTEM_NFFS=y
CONFIG_NFFS_FILESYSTEM_MAX_AREAS=12

------------------------------------------------------------------------------------------------------------------------

& add following lines in main.c

#include <fs.h>

void main( )
{
    fs_file_t *my_zfp;
    unsigned char ptr[32];


    fs_open(my_zfp,"mesh.prv");
    fs_write(my_zfp,"Hello World !! ",16);
    fs_read(my_zfp,ptr,32);
    fs_close(my_zfp);

    printk("%s",ptr);
}

After all this every thing gets compiled with warning :

 

warning: ‘my_zfp’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  fs_open(my_zfp,"mesh.prv");

Could you please help me, how to initialized my_zfp here ?

 

 

On Tue, Jan 23, 2018 at 1:15 AM, Michael Hope <michaelh@...> wrote:

Hi Vikrant.  You also need to enable NFFS in your configuration - try 'make menuconfig' > File Systems > File system support = y; Supported file systems -> NFFS.

You can also check out the NFFS test case under tests/subsys/fs and especially the configuration in https://github.com/zephyrproject-rtos/zephyr/blob/master/tests/subsys/fs/nffs_fs_api/nrf5x.conf

-- Michael

 

On Fri, 19 Jan 2018 at 11:46 Vikrant More <vikrant8051@...> wrote:

#include <fs.h>

void main( )
{
    fs_file_t *my_zfp;
    unsigned char ptr[32];


    fs_open(my_zfp,"mesh.prv");
    fs_write(my_zfp,"Hello World !! ",16);
    fs_read(my_zfp,ptr,32);
    fs_close(my_zfp);

    printk("%s",ptr);
}

I've edited main.c in my project as mentioned above.

And add CONFIG_FILE_SYSTEM_NFFS=y in prj.conf

 

1st time I got following error,

 

In file included from /home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:3:0:
/home/vikrant/projects/zephyr/zephyr/include/fs.h:66:12: error: ‘MAX_FILE_NAME’ undeclared here (not in a function)
  char name[MAX_FILE_NAME + 1];
            ^~~~~~~~~~~~~
CMakeFiles/app.dir/build.make:302: recipe for target 'CMakeFiles/app.dir/src/main.c.obj' failed
make[2]: *** [CMakeFiles/app.dir/src/main.c.obj] Error 1
CMakeFiles/Makefile2:259: recipe for target 'CMakeFiles/app.dir/all' failed
make[1]: *** [CMakeFiles/app.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

 

To overcome it I added ,    #define MAX_FILE_NAME 10   in zephyr/include/fs.h

 

After this I got following error,

 

../libapp.a(main.c.obj): In function `main':
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:226: undefined reference to `fs_open'
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:227: undefined reference to `fs_write'
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:228: undefined reference to `fs_read'
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:229: undefined reference to `fs_close'
collect2: error: ld returned 1 exit status
zephyr/CMakeFiles/zephyr_prebuilt.dir/build.make:104: recipe for target 'zephyr/zephyr_prebuilt.elf' failed
make[2]: *** [zephyr/zephyr_prebuilt.elf] Error 1
CMakeFiles/Makefile2:569: recipe for target 'zephyr/CMakeFiles/zephyr_prebuilt.dir/all' failed
make[1]: *** [zephyr/CMakeFiles/zephyr_prebuilt.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

 

 

 

 

Following line are already present in zephyr/boards/arm/nrf52840_pca10056/nrf52840_pca10056.dts

 


#if defined(CONFIG_FILE_SYSTEM_NFFS)
        nffs_partition: partition@fc000 {
            label = "nffs";
            reg = <0x000fc000 0x00004000>;
        };
#endif

 

Could you please tell me what I'm missing ?

 

Thank You !!

 

On Fri, Jan 19, 2018 at 12:15 AM, Michael Hope <michaelh@...> wrote:

 

1. Ensure the board has a nffs partition defined in Device Tree.  See here for an example.

2. Turn on CONFIG_FILE_SYSTEM_NFFS in the config

3. Use the APIs in include/fs.h such as fs_open() etc

If you turn on CONFIG_FILE_SYSTEM_SHELL then you'll also get a simple interactive shell where you can list directories etc.

-- Michael

 

On Thu, 18 Jan 2018 at 15:16 Vikrant More <vikrant8051@...> wrote:

Thanks for reply.

 

Where I will find APIs & sample codes based on it to access internal flash of nrf52840 ?

 

 

On Jan 18, 2018 3:38 PM, "Puzdrowski, Andrzej" <Andrzej.Puzdrowski@nordicsemi.no> wrote:

NFFS Is supported since 1.10 release:

https://www.zephyrproject.org/releases/1-10-release-december-2017/

 

Andrzej

From: zephyr-devel-bounces@lists.zephyrproject.org [mailto:zephyr-devel-bounces@lists.zephyrproject.org] On Behalf Of Vikrant More
Sent: Thursday, January 18, 2018 10:09 AM
To: zephyr-devel@lists.zephyrproject.org; zephyr-users@lists.zephyrproject.org
Subject: [Zephyr-devel] support for NFFS file system

 

Hello World !!

 

My question is related to this link's requirement,
https://lists.zephyrproject.org/pipermail/zephyr-devel/2017-July/007888.html

Is Zephyr going to add support for NFFS file system in upcoming 1.11 (March 20148) release ?

What is current status of NFFS file system development ?

Could anybody explain me from Zephyr Core developer team ?

Thank You !! 


_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@lists.zephyrproject.org
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel

_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@lists.zephyrproject.org
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel

 

 



On Wed, Jan 24, 2018 at 5:41 PM, Chettimada, Vinayak Kariappa <vinayak.kariappa.chettimada@...> wrote:

Its:

 

fs_file_t my_zfp; // no * please;

 

and

 

fs_open(&my_zfp,"mesh.prv"); // & please J

 

That said, I am not expert on FS!

 

-Vinayak

 

From: zephyr-devel-bounces@lists.zephyrproject.org [mailto:zephyr-devel-bounces@lists.zephyrproject.org] On Behalf Of Vikrant More
Sent: Wednesday, January 24, 2018 1:06 PM
To: Michael Hope <michaelh@...>
Cc: zephyr-users@lists.zephyrproject.org; zephyr-devel@lists.zephyrproject.org
Subject: Re: [Zephyr-devel] FW: support for NFFS file system

 

I copied & pasted $zephyr/ext/fs/nffs directory into $zephyr_base/include
----------------------------------------------------------------------------------------------------------------------

& edit $zephyr_base/include/fs/nffs_fs.h as follow

/*
 * Copyright (c) 2017 Codecoup
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#ifndef _NFFS_FS_H_
#define _NFFS_FS_H_

#include <sys/types.h>
#include <nffs/include/nffs/nffs.h>

#ifdef __cplusplus
extern "C" {
#endif

FS_FILE_DEFINE(struct nffs_file *fp);
FS_DIR_DEFINE(struct nffs_dir *dp);

#define MAX_FILE_NAME 256

#ifdef __cplusplus
}
#endif

#endif /* _NFFS_FS_H_ */

-------------------------------------------------------------------------------------------------------------------------

& add following config into my prj.conf

CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y
CONFIG_SOC_FLASH_NRF5=y
CONFIG_SOC_FLASH_NRF5_DEV_NAME="NRF52_FLASH"
CONFIG_SOC_FLASH_NRF5_RADIO_SYNC=y
CONFIG_ZTEST_STACKSIZE=2048
CONFIG_MAIN_STACK_SIZE=1024
CONFIG_HEAP_MEM_POOL_SIZE=1024


CONFIG_FILE_SYSTEM=y
CONFIG_FILE_SYSTEM_NFFS=y
CONFIG_FS_NFFS_NUM_FILES=4
CONFIG_FS_NFFS_NUM_DIRS=4
CONFIG_FS_NFFS_NUM_INODES=1024
CONFIG_FS_NFFS_NUM_BLOCKS=1024
CONFIG_FS_NFFS_NUM_CACHE_INODES=1
CONFIG_FS_NFFS_NUM_CACHE_BLOCKS=1
CONFIG_FILE_SYSTEM_NFFS=y
CONFIG_NFFS_FILESYSTEM_MAX_AREAS=12

------------------------------------------------------------------------------------------------------------------------

& add following lines in main.c

#include <fs.h>

void main( )
{
    fs_file_t *my_zfp;
    unsigned char ptr[32];


    fs_open(my_zfp,"mesh.prv");
    fs_write(my_zfp,"Hello World !! ",16);
    fs_read(my_zfp,ptr,32);
    fs_close(my_zfp);

    printk("%s",ptr);
}

After all this every thing gets compiled with warning :

 

warning: ‘my_zfp’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  fs_open(my_zfp,"mesh.prv");

Could you please help me, how to initialized my_zfp here ?

 

 

On Tue, Jan 23, 2018 at 1:15 AM, Michael Hope <michaelh@...> wrote:

Hi Vikrant.  You also need to enable NFFS in your configuration - try 'make menuconfig' > File Systems > File system support = y; Supported file systems -> NFFS.

You can also check out the NFFS test case under tests/subsys/fs and especially the configuration in https://github.com/zephyrproject-rtos/zephyr/blob/master/tests/subsys/fs/nffs_fs_api/nrf5x.conf

-- Michael

 

On Fri, 19 Jan 2018 at 11:46 Vikrant More <vikrant8051@...> wrote:

#include <fs.h>

void main( )
{
    fs_file_t *my_zfp;
    unsigned char ptr[32];


    fs_open(my_zfp,"mesh.prv");
    fs_write(my_zfp,"Hello World !! ",16);
    fs_read(my_zfp,ptr,32);
    fs_close(my_zfp);

    printk("%s",ptr);
}

I've edited main.c in my project as mentioned above.

And add CONFIG_FILE_SYSTEM_NFFS=y in prj.conf

 

1st time I got following error,

 

In file included from /home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:3:0:
/home/vikrant/projects/zephyr/zephyr/include/fs.h:66:12: error: ‘MAX_FILE_NAME’ undeclared here (not in a function)
  char name[MAX_FILE_NAME + 1];
            ^~~~~~~~~~~~~
CMakeFiles/app.dir/build.make:302: recipe for target 'CMakeFiles/app.dir/src/main.c.obj' failed
make[2]: *** [CMakeFiles/app.dir/src/main.c.obj] Error 1
CMakeFiles/Makefile2:259: recipe for target 'CMakeFiles/app.dir/all' failed
make[1]: *** [CMakeFiles/app.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

 

To overcome it I added ,    #define MAX_FILE_NAME 10   in zephyr/include/fs.h

 

After this I got following error,

 

../libapp.a(main.c.obj): In function `main':
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:226: undefined reference to `fs_open'
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:227: undefined reference to `fs_write'
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:228: undefined reference to `fs_read'
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:229: undefined reference to `fs_close'
collect2: error: ld returned 1 exit status
zephyr/CMakeFiles/zephyr_prebuilt.dir/build.make:104: recipe for target 'zephyr/zephyr_prebuilt.elf' failed
make[2]: *** [zephyr/zephyr_prebuilt.elf] Error 1
CMakeFiles/Makefile2:569: recipe for target 'zephyr/CMakeFiles/zephyr_prebuilt.dir/all' failed
make[1]: *** [zephyr/CMakeFiles/zephyr_prebuilt.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

 

 

 

 

Following line are already present in zephyr/boards/arm/nrf52840_pca10056/nrf52840_pca10056.dts

 


#if defined(CONFIG_FILE_SYSTEM_NFFS)
        nffs_partition: partition@fc000 {
            label = "nffs";
            reg = <0x000fc000 0x00004000>;
        };
#endif

 

Could you please tell me what I'm missing ?

 

Thank You !!

 

On Fri, Jan 19, 2018 at 12:15 AM, Michael Hope <michaelh@...> wrote:

 

1. Ensure the board has a nffs partition defined in Device Tree.  See here for an example.

2. Turn on CONFIG_FILE_SYSTEM_NFFS in the config

3. Use the APIs in include/fs.h such as fs_open() etc

If you turn on CONFIG_FILE_SYSTEM_SHELL then you'll also get a simple interactive shell where you can list directories etc.

-- Michael

 

On Thu, 18 Jan 2018 at 15:16 Vikrant More <vikrant8051@...> wrote:

Thanks for reply.

 

Where I will find APIs & sample codes based on it to access internal flash of nrf52840 ?

 

 

On Jan 18, 2018 3:38 PM, "Puzdrowski, Andrzej" <Andrzej.Puzdrowski@nordicsemi.no> wrote:

NFFS Is supported since 1.10 release:

https://www.zephyrproject.org/releases/1-10-release-december-2017/

 

Andrzej

From: zephyr-devel-bounces@lists.zephyrproject.org [mailto:zephyr-devel-bounces@lists.zephyrproject.org] On Behalf Of Vikrant More
Sent: Thursday, January 18, 2018 10:09 AM
To: zephyr-devel@lists.zephyrproject.org; zephyr-users@lists.zephyrproject.org
Subject: [Zephyr-devel] support for NFFS file system

 

Hello World !!

 

My question is related to this link's requirement,
https://lists.zephyrproject.org/pipermail/zephyr-devel/2017-July/007888.html

Is Zephyr going to add support for NFFS file system in upcoming 1.11 (March 20148) release ?

What is current status of NFFS file system development ?

Could anybody explain me from Zephyr Core developer team ?

Thank You !! 


_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@lists.zephyrproject.org
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel

_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@lists.zephyrproject.org
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel

 

 



Re: [Zephyr-devel] FW: support for NFFS file system

Chettimada, Vinayak Kariappa
 

Its:

 

fs_file_t my_zfp; // no * please;

 

and

 

fs_open(&my_zfp,"mesh.prv"); // & please J

 

That said, I am not expert on FS!

 

-Vinayak

 

From: zephyr-devel-bounces@... [mailto:zephyr-devel-bounces@...] On Behalf Of Vikrant More
Sent: Wednesday, January 24, 2018 1:06 PM
To: Michael Hope <michaelh@...>
Cc: zephyr-users@...; zephyr-devel@...
Subject: Re: [Zephyr-devel] FW: support for NFFS file system

 

I copied & pasted $zephyr/ext/fs/nffs directory into $zephyr_base/include
----------------------------------------------------------------------------------------------------------------------

& edit $zephyr_base/include/fs/nffs_fs.h as follow

/*
 * Copyright (c) 2017 Codecoup
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#ifndef _NFFS_FS_H_
#define _NFFS_FS_H_

#include <sys/types.h>
#include <nffs/include/nffs/nffs.h>

#ifdef __cplusplus
extern "C" {
#endif

FS_FILE_DEFINE(struct nffs_file *fp);
FS_DIR_DEFINE(struct nffs_dir *dp);

#define MAX_FILE_NAME 256

#ifdef __cplusplus
}
#endif

#endif /* _NFFS_FS_H_ */

-------------------------------------------------------------------------------------------------------------------------

& add following config into my prj.conf

CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y
CONFIG_SOC_FLASH_NRF5=y
CONFIG_SOC_FLASH_NRF5_DEV_NAME="NRF52_FLASH"
CONFIG_SOC_FLASH_NRF5_RADIO_SYNC=y
CONFIG_ZTEST_STACKSIZE=2048
CONFIG_MAIN_STACK_SIZE=1024
CONFIG_HEAP_MEM_POOL_SIZE=1024


CONFIG_FILE_SYSTEM=y
CONFIG_FILE_SYSTEM_NFFS=y
CONFIG_FS_NFFS_NUM_FILES=4
CONFIG_FS_NFFS_NUM_DIRS=4
CONFIG_FS_NFFS_NUM_INODES=1024
CONFIG_FS_NFFS_NUM_BLOCKS=1024
CONFIG_FS_NFFS_NUM_CACHE_INODES=1
CONFIG_FS_NFFS_NUM_CACHE_BLOCKS=1
CONFIG_FILE_SYSTEM_NFFS=y
CONFIG_NFFS_FILESYSTEM_MAX_AREAS=12

------------------------------------------------------------------------------------------------------------------------

& add following lines in main.c

#include <fs.h>

void main( )
{
    fs_file_t *my_zfp;
    unsigned char ptr[32];


    fs_open(my_zfp,"mesh.prv");
    fs_write(my_zfp,"Hello World !! ",16);
    fs_read(my_zfp,ptr,32);
    fs_close(my_zfp);

    printk("%s",ptr);
}

After all this every thing gets compiled with warning :

 

warning: ‘my_zfp’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  fs_open(my_zfp,"mesh.prv");

Could you please help me, how to initialized my_zfp here ?

 

 

On Tue, Jan 23, 2018 at 1:15 AM, Michael Hope <michaelh@...> wrote:

Hi Vikrant.  You also need to enable NFFS in your configuration - try 'make menuconfig' > File Systems > File system support = y; Supported file systems -> NFFS.

You can also check out the NFFS test case under tests/subsys/fs and especially the configuration in https://github.com/zephyrproject-rtos/zephyr/blob/master/tests/subsys/fs/nffs_fs_api/nrf5x.conf

-- Michael

 

On Fri, 19 Jan 2018 at 11:46 Vikrant More <vikrant8051@...> wrote:

#include <fs.h>

void main( )
{
    fs_file_t *my_zfp;
    unsigned char ptr[32];


    fs_open(my_zfp,"mesh.prv");
    fs_write(my_zfp,"Hello World !! ",16);
    fs_read(my_zfp,ptr,32);
    fs_close(my_zfp);

    printk("%s",ptr);
}

I've edited main.c in my project as mentioned above.

And add CONFIG_FILE_SYSTEM_NFFS=y in prj.conf

 

1st time I got following error,

 

In file included from /home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:3:0:
/home/vikrant/projects/zephyr/zephyr/include/fs.h:66:12: error: ‘MAX_FILE_NAME’ undeclared here (not in a function)
  char name[MAX_FILE_NAME + 1];
            ^~~~~~~~~~~~~
CMakeFiles/app.dir/build.make:302: recipe for target 'CMakeFiles/app.dir/src/main.c.obj' failed
make[2]: *** [CMakeFiles/app.dir/src/main.c.obj] Error 1
CMakeFiles/Makefile2:259: recipe for target 'CMakeFiles/app.dir/all' failed
make[1]: *** [CMakeFiles/app.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

 

To overcome it I added ,    #define MAX_FILE_NAME 10   in zephyr/include/fs.h

 

After this I got following error,

 

../libapp.a(main.c.obj): In function `main':
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:226: undefined reference to `fs_open'
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:227: undefined reference to `fs_write'
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:228: undefined reference to `fs_read'
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:229: undefined reference to `fs_close'
collect2: error: ld returned 1 exit status
zephyr/CMakeFiles/zephyr_prebuilt.dir/build.make:104: recipe for target 'zephyr/zephyr_prebuilt.elf' failed
make[2]: *** [zephyr/zephyr_prebuilt.elf] Error 1
CMakeFiles/Makefile2:569: recipe for target 'zephyr/CMakeFiles/zephyr_prebuilt.dir/all' failed
make[1]: *** [zephyr/CMakeFiles/zephyr_prebuilt.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

 

 

 

 

Following line are already present in zephyr/boards/arm/nrf52840_pca10056/nrf52840_pca10056.dts

 


#if defined(CONFIG_FILE_SYSTEM_NFFS)
        nffs_partition: partition@fc000 {
            label = "nffs";
            reg = <0x000fc000 0x00004000>;
        };
#endif

 

Could you please tell me what I'm missing ?

 

Thank You !!

 

On Fri, Jan 19, 2018 at 12:15 AM, Michael Hope <michaelh@...> wrote:

 

1. Ensure the board has a nffs partition defined in Device Tree.  See here for an example.

2. Turn on CONFIG_FILE_SYSTEM_NFFS in the config

3. Use the APIs in include/fs.h such as fs_open() etc

If you turn on CONFIG_FILE_SYSTEM_SHELL then you'll also get a simple interactive shell where you can list directories etc.

-- Michael

 

On Thu, 18 Jan 2018 at 15:16 Vikrant More <vikrant8051@...> wrote:

Thanks for reply.

 

Where I will find APIs & sample codes based on it to access internal flash of nrf52840 ?

 

 

On Jan 18, 2018 3:38 PM, "Puzdrowski, Andrzej" <Andrzej.Puzdrowski@...> wrote:

NFFS Is supported since 1.10 release:

https://www.zephyrproject.org/releases/1-10-release-december-2017/

 

Andrzej

From: zephyr-devel-bounces@... [mailto:zephyr-devel-bounces@...] On Behalf Of Vikrant More
Sent: Thursday, January 18, 2018 10:09 AM
To: zephyr-devel@...; zephyr-users@...
Subject: [Zephyr-devel] support for NFFS file system

 

Hello World !!

 

My question is related to this link's requirement,
https://lists.zephyrproject.org/pipermail/zephyr-devel/2017-July/007888.html

Is Zephyr going to add support for NFFS file system in upcoming 1.11 (March 20148) release ?

What is current status of NFFS file system development ?

Could anybody explain me from Zephyr Core developer team ?

Thank You !! 


_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@...
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel

_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@...
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel

 

 


Re: [Zephyr-devel] FW: support for NFFS file system

Vikrant More <vikrant8051@...>
 

I copied & pasted $zephyr/ext/fs/nffs directory into $zephyr_base/include
----------------------------------------------------------------------------------------------------------------------
& edit $zephyr_base/include/fs/nffs_fs.h as follow

/*
 * Copyright (c) 2017 Codecoup
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#ifndef _NFFS_FS_H_
#define _NFFS_FS_H_

#include <sys/types.h>
#include <nffs/include/nffs/nffs.h>

#ifdef __cplusplus
extern "C" {
#endif

FS_FILE_DEFINE(struct nffs_file *fp);
FS_DIR_DEFINE(struct nffs_dir *dp);

#define MAX_FILE_NAME 256

#ifdef __cplusplus
}
#endif

#endif /* _NFFS_FS_H_ */

-------------------------------------------------------------------------------------------------------------------------
& add following config into my prj.conf

CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y
CONFIG_SOC_FLASH_NRF5=y
CONFIG_SOC_FLASH_NRF5_DEV_NAME="NRF52_FLASH"
CONFIG_SOC_FLASH_NRF5_RADIO_SYNC=y
CONFIG_ZTEST_STACKSIZE=2048
CONFIG_MAIN_STACK_SIZE=1024
CONFIG_HEAP_MEM_POOL_SIZE=1024


CONFIG_FILE_SYSTEM=y
CONFIG_FILE_SYSTEM_NFFS=y
CONFIG_FS_NFFS_NUM_FILES=4
CONFIG_FS_NFFS_NUM_DIRS=4
CONFIG_FS_NFFS_NUM_INODES=1024
CONFIG_FS_NFFS_NUM_BLOCKS=1024
CONFIG_FS_NFFS_NUM_CACHE_INODES=1
CONFIG_FS_NFFS_NUM_CACHE_BLOCKS=1
CONFIG_FILE_SYSTEM_NFFS=y
CONFIG_NFFS_FILESYSTEM_MAX_AREAS=12

------------------------------------------------------------------------------------------------------------------------

& add following lines in main.c

#include <fs.h>

void main( )
{
    fs_file_t *my_zfp;
    unsigned char ptr[32];


    fs_open(my_zfp,"mesh.prv");
    fs_write(my_zfp,"Hello World !! ",16);
    fs_read(my_zfp,ptr,32);
    fs_close(my_zfp);

    printk("%s",ptr);
}


After all this every thing gets compiled with warning :

warning: ‘my_zfp’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  fs_open(my_zfp,"mesh.prv");


Could you please help me, how to initialized my_zfp here ?



On Tue, Jan 23, 2018 at 1:15 AM, Michael Hope <michaelh@...> wrote:
Hi Vikrant.  You also need to enable NFFS in your configuration - try 'make menuconfig' > File Systems > File system support = y; Supported file systems -> NFFS.

You can also check out the NFFS test case under tests/subsys/fs and especially the configuration in https://github.com/zephyrproject-rtos/zephyr/blob/master/tests/subsys/fs/nffs_fs_api/nrf5x.conf

-- Michael

On Fri, 19 Jan 2018 at 11:46 Vikrant More <vikrant8051@...> wrote:
#include <fs.h>

void main( )
{
    fs_file_t *my_zfp;
    unsigned char ptr[32];


    fs_open(my_zfp,"mesh.prv");
    fs_write(my_zfp,"Hello World !! ",16);
    fs_read(my_zfp,ptr,32);
    fs_close(my_zfp);

    printk("%s",ptr);
}

I've edited main.c in my project as mentioned above.

And add CONFIG_FILE_SYSTEM_NFFS=y in prj.conf

1st time I got following error,

In file included from /home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:3:0:
/home/vikrant/projects/zephyr/zephyr/include/fs.h:66:12: error: ‘MAX_FILE_NAME’ undeclared here (not in a function)
  char name[MAX_FILE_NAME + 1];
            ^~~~~~~~~~~~~
CMakeFiles/app.dir/build.make:302: recipe for target 'CMakeFiles/app.dir/src/main.c.obj' failed
make[2]: *** [CMakeFiles/app.dir/src/main.c.obj] Error 1
CMakeFiles/Makefile2:259: recipe for target 'CMakeFiles/app.dir/all' failed
make[1]: *** [CMakeFiles/app.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

To overcome it I added ,    #define MAX_FILE_NAME 10   in zephyr/include/fs.h

After this I got following error,

../libapp.a(main.c.obj): In function `main':
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:226: undefined reference to `fs_open'
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:227: undefined reference to `fs_write'
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:228: undefined reference to `fs_read'
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:229: undefined reference to `fs_close'
collect2: error: ld returned 1 exit status
zephyr/CMakeFiles/zephyr_prebuilt.dir/build.make:104: recipe for target 'zephyr/zephyr_prebuilt.elf' failed
make[2]: *** [zephyr/zephyr_prebuilt.elf] Error 1
CMakeFiles/Makefile2:569: recipe for target 'zephyr/CMakeFiles/zephyr_prebuilt.dir/all' failed
make[1]: *** [zephyr/CMakeFiles/zephyr_prebuilt.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2




Following line are already present in zephyr/boards/arm/nrf52840_pca10056/nrf52840_pca10056.dts


#if defined(CONFIG_FILE_SYSTEM_NFFS)
        nffs_partition: partition@fc000 {
            label = "nffs";
            reg = <0x000fc000 0x00004000>;
        };
#endif

Could you please tell me what I'm missing ?

Thank You !!

On Fri, Jan 19, 2018 at 12:15 AM, Michael Hope <michaelh@...> wrote:

1. Ensure the board has a nffs partition defined in Device Tree.  See here for an example.
2. Turn on CONFIG_FILE_SYSTEM_NFFS in the config
3. Use the APIs in include/fs.h such as fs_open() etc

If you turn on CONFIG_FILE_SYSTEM_SHELL then you'll also get a simple interactive shell where you can list directories etc.

-- Michael


On Thu, 18 Jan 2018 at 15:16 Vikrant More <vikrant8051@...> wrote:
Thanks for reply.

Where I will find APIs & sample codes based on it to access internal flash of nrf52840 ?


On Jan 18, 2018 3:38 PM, "Puzdrowski, Andrzej" <Andrzej.Puzdrowski@nordicsemi.no> wrote:

NFFS Is supported since 1.10 release:

https://www.zephyrproject.org/releases/1-10-release-december-2017/

 

Andrzej

From: zephyr-devel-bounces@lists.zephyrproject.org [mailto:zephyr-devel-bounces@lists.zephyrproject.org] On Behalf Of Vikrant More
Sent: Thursday, January 18, 2018 10:09 AM
To: zephyr-devel@lists.zephyrproject.org; zephyr-users@lists.zephyrproject.org
Subject: [Zephyr-devel] support for NFFS file system

 

Hello World !!

 

My question is related to this link's requirement,
https://lists.zephyrproject.org/pipermail/zephyr-devel/2017-July/007888.html

Is Zephyr going to add support for NFFS file system in upcoming 1.11 (March 20148) release ?

What is current status of NFFS file system development ?

Could anybody explain me from Zephyr Core developer team ?

Thank You !! 


_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@lists.zephyrproject.org
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel

_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@lists.zephyrproject.org
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel



About the usage of bluetooth api for audio

陈闯 <chenchuangchn@...>
 

Hi,
    I want to create a master that can connect to a bluetooth headset. In this way, the master can receive  my voice via bluetooth headset. I have seen the bluetooth api in  document and bluetooth samples in source, but neither did I find an api, nor could I find a demo. Is there any examples for audio eg a2dp avrcp that I can use?
--------------------------------------------------------------------------
Best Regards
Name: ChenChuang
--------------------------------------------------------------------------


Re: [Zephyr-devel] FW: support for NFFS file system

Michael Hope
 

Hi Vikrant.  You also need to enable NFFS in your configuration - try 'make menuconfig' > File Systems > File system support = y; Supported file systems -> NFFS.

You can also check out the NFFS test case under tests/subsys/fs and especially the configuration in https://github.com/zephyrproject-rtos/zephyr/blob/master/tests/subsys/fs/nffs_fs_api/nrf5x.conf

-- Michael

On Fri, 19 Jan 2018 at 11:46 Vikrant More <vikrant8051@...> wrote:
#include <fs.h>

void main( )
{
    fs_file_t *my_zfp;
    unsigned char ptr[32];


    fs_open(my_zfp,"mesh.prv");
    fs_write(my_zfp,"Hello World !! ",16);
    fs_read(my_zfp,ptr,32);
    fs_close(my_zfp);

    printk("%s",ptr);
}

I've edited main.c in my project as mentioned above.

And add CONFIG_FILE_SYSTEM_NFFS=y in prj.conf

1st time I got following error,

In file included from /home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:3:0:
/home/vikrant/projects/zephyr/zephyr/include/fs.h:66:12: error: ‘MAX_FILE_NAME’ undeclared here (not in a function)
  char name[MAX_FILE_NAME + 1];
            ^~~~~~~~~~~~~
CMakeFiles/app.dir/build.make:302: recipe for target 'CMakeFiles/app.dir/src/main.c.obj' failed
make[2]: *** [CMakeFiles/app.dir/src/main.c.obj] Error 1
CMakeFiles/Makefile2:259: recipe for target 'CMakeFiles/app.dir/all' failed
make[1]: *** [CMakeFiles/app.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

To overcome it I added ,    #define MAX_FILE_NAME 10   in zephyr/include/fs.h

After this I got following error,

../libapp.a(main.c.obj): In function `main':
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:226: undefined reference to `fs_open'
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:227: undefined reference to `fs_write'
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:228: undefined reference to `fs_read'
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:229: undefined reference to `fs_close'
collect2: error: ld returned 1 exit status
zephyr/CMakeFiles/zephyr_prebuilt.dir/build.make:104: recipe for target 'zephyr/zephyr_prebuilt.elf' failed
make[2]: *** [zephyr/zephyr_prebuilt.elf] Error 1
CMakeFiles/Makefile2:569: recipe for target 'zephyr/CMakeFiles/zephyr_prebuilt.dir/all' failed
make[1]: *** [zephyr/CMakeFiles/zephyr_prebuilt.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2




Following line are already present in zephyr/boards/arm/nrf52840_pca10056/nrf52840_pca10056.dts


#if defined(CONFIG_FILE_SYSTEM_NFFS)
        nffs_partition: partition@fc000 {
            label = "nffs";
            reg = <0x000fc000 0x00004000>;
        };
#endif

Could you please tell me what I'm missing ?

Thank You !!

On Fri, Jan 19, 2018 at 12:15 AM, Michael Hope <michaelh@...> wrote:

1. Ensure the board has a nffs partition defined in Device Tree.  See here for an example.
2. Turn on CONFIG_FILE_SYSTEM_NFFS in the config
3. Use the APIs in include/fs.h such as fs_open() etc

If you turn on CONFIG_FILE_SYSTEM_SHELL then you'll also get a simple interactive shell where you can list directories etc.

-- Michael


On Thu, 18 Jan 2018 at 15:16 Vikrant More <vikrant8051@...> wrote:
Thanks for reply.

Where I will find APIs & sample codes based on it to access internal flash of nrf52840 ?


On Jan 18, 2018 3:38 PM, "Puzdrowski, Andrzej" <Andrzej.Puzdrowski@...> wrote:

NFFS Is supported since 1.10 release:

https://www.zephyrproject.org/releases/1-10-release-december-2017/

 

Andrzej

From: zephyr-devel-bounces@... [mailto:zephyr-devel-bounces@...] On Behalf Of Vikrant More
Sent: Thursday, January 18, 2018 10:09 AM
To: zephyr-devel@...; zephyr-users@...
Subject: [Zephyr-devel] support for NFFS file system

 

Hello World !!

 

My question is related to this link's requirement,
https://lists.zephyrproject.org/pipermail/zephyr-devel/2017-July/007888.html

Is Zephyr going to add support for NFFS file system in upcoming 1.11 (March 20148) release ?

What is current status of NFFS file system development ?

Could anybody explain me from Zephyr Core developer team ?

Thank You !! 


_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@...
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel

_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@...
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel


I2C working example for nrf5

ashish.shukla@corvi.com <ashish.shukla@...>
 

Hi everyone,

I'm working with /zephyr/samples/drivers/i2c_fujitsu_fram

I configured it for nrf5. The example seems to read data from EEPROM, but it can't write anything.

I tried various APIs available in "i2c.h" , nothing seems to work. Can someone share a working example code for nrf5.   

--
Warm regards,
Ashish Shukla
Jr. Embedded Engineer
Research & Development


Please consider the environment before printing this e-mail or its attachments.

Disclaimer: The information contained herein (including any accompanying documents) is confidential and is intended solely for the addressee(s). If you have erroneously received this message, please immediately delete it and notify the sender. Also, if you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this message or any accompanying document is strictly prohibited and is unlawful. The organization is not responsible for any damage caused by a virus or alteration of the e-mail by a third party or otherwise. The contents of this message may not necessarily represent the views or policies of Corvi


Re: understanding of #BluetoothMesh OOB authentication procedure #bluetoothmesh

Johan Hedberg
 

Hi Vikrant,

On Sat, Jan 20, 2018, Vikrant More wrote:
But as per this link,
https://blog.bluetooth.com/provisioning-a-bluetooth-mesh-network-part-1 ,

In the exchange public keys phase, there are two possible ways for ECDH
public keys to be exchanged.
They can be exchanged over a Bluetooth link or through an OOB tunnel.
*In the provisioning invitation phase, the unprovisioned device has already
reported whether or not it supports sending its public key via an OOB
tunnel. *
If it does, the provisioner can proceed to use it and informs the
unprovisioned device by sending a Provisioning Start PDU.

could you please tell me, is this taken care by you ?
Where to edit, when I want to send ECDH public keys over OOB tunnel ?
Or is it also in development phase ?
I answered this already here:

https://lists.zephyrproject.org/pipermail/zephyr-devel/2018-January/008734.html

I'm sure we'll eventually have proper support for it, but if you want to
get it sooner feel free to send patches for it.

Johan


Re: understanding of #BluetoothMesh OOB authentication procedure #bluetoothmesh

Vikrant More <vikrant8051@...>
 

>> How provisioner will understand from where to received/read DEVICE
>> public key out of *Bluetooth-Link* or *OOB* channel ?

>I believe this is out of scope for the specification, since any OOB
>channel is by definition something else than Bluetooth. In practice this
>would then have to be a vendor-specific solution. There could e.g. be
>hints in the advertsing data, or behind the optional URL in the
>advertising data, as to what kind of OOB channel the unprovisioned node
>wants to use.

But as per this link, https://blog.bluetooth.com/provisioning-a-bluetooth-mesh-network-part-1 ,

In the exchange public keys phase, there are two possible ways for ECDH public keys to be exchanged.
They can be exchanged over a Bluetooth link or through an OOB tunnel.
In the provisioning invitation phase, the unprovisioned device has already reported whether or not it supports sending its public key via an OOB tunnel.
If it does, the provisioner can proceed to use it and informs the unprovisioned device by sending a Provisioning Start PDU.

could you please tell me, is this taken care by you ?
Where to edit, when I want to send ECDH public keys over OOB tunnel ?
Or is it also in development phase ?


Thank You !!

On Wed, Jan 17, 2018 at 2:15 PM, Johan Hedberg <johan.hedberg@...> wrote:
Hi Vikrant,

On Tue, Jan 16, 2018, Vikrant More wrote:
> When I comment-out following lines as below
>
> static const struct bt_mesh_prov prov =
> {
>     .uuid = dev_uuid,
>
>
> * //.output_size = 4,    //.output_actions = BT_MESH_BLINK | BT_MESH_BEEP |
> BT_MESH_VIBRATE | BT_MESH_DISPLAY_NUMBER | BT_MESH_DISPLAY_STRING,
> //.output_number = output_number,*
>     .complete = prov_complete,
>     .reset = prov_reset,
> };
>
> , flowchart (5.4.2) follows path as per attached FlowChart_1.pdf. Am I
> right ?

Yes.

> & when I uncomment following lines as below
>
> static const struct bt_mesh_prov prov =
> {
>     .uuid = dev_uuid,
>
>
> * .output_size = 4,    .output_actions = BT_MESH_BLINK | BT_MESH_BEEP |
> BT_MESH_VIBRATE | BT_MESH_DISPLAY_NUMBER | BT_MESH_DISPLAY_STRING,
> .output_number = output_number,*
>     .complete = prov_complete,
>     .reset = prov_reset,
> };
>
> , flowchart follows path as per attached FlowChart_2.pdf. Am I right ?

Yes.


> DEVICE's Public key can be static or dynamic plus it can exchange over
> Bluetooth-Link or OOB. Am I right ?

Yes.

> As per current implementation, we are using *dynamic Public Key*
> *& *both sides public keys are get exchanged over Bluetooth-Link instead of
> OOB. Am I right ?

Yes.

> But when I want to use static Public-Private keys for DEVICE (provisioner
> may have dynamic pair), how & where to edit so that provisioner will
> understand that DEVICE has static public key ?

The provisioner doesn't really need to know if the key is static or
public. It just needs to know which key to use for the provisioning.

What the implementation is missing right now is a way to use a static
private-public keypair instead of a dynamically generated one. We would
probably need to introduce new Kconfig option and extra code to the
current ECDH implementation (in subsys/bluetooth/host/hci_ecc.c) to read
a pre-existing public key from some persistent location instead of
generating a new key pair.

> How provisioner will understand from where to received/read DEVICE
> public key out of *Bluetooth-Link* or *OOB* channel ?

I believe this is out of scope for the specification, since any OOB
channel is by definition something else than Bluetooth. In practice this
would then have to be a vendor-specific solution. There could e.g. be
hints in the advertsing data, or behind the optional URL in the
advertising data, as to what kind of OOB channel the unprovisioned node
wants to use.

> If public keys get exchanged over insecure channel, then what is
> significance of OOB tunnel over Bluetooth-Link ?

You might want to read up on how Diffie-Hellman key exchange works:
https://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange

You essentially acheive confidentiality for the link with the peer
you've exchanged public keys with, but only through the OOB
authentication phase will you be able to authenticate that the peer
really is who you think it is.

Johan


Meaning of static OOB?

ashish.shukla@corvi.com <ashish.shukla@...>
 

Hi everyone,

During Authentication stage of provisioning, I understand meaning of Output OOB, Input OOB.
In case of NO OOB, value paired with Confirmation value is 0x00.
What happens in case of static OOB? 

What I interpret is : static value generated at device end is send to provisioner via an OOB tunnel which will be paired with Confirmation value calculated at provisioner end. Is that correct? 

--
Warm regards,
Ashish Shukla
Jr. Embedded Engineer
Research & Development


Please consider the environment before printing this e-mail or its attachments.

Disclaimer: The information contained herein (including any accompanying documents) is confidential and is intended solely for the addressee(s). If you have erroneously received this message, please immediately delete it and notify the sender. Also, if you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this message or any accompanying document is strictly prohibited and is unlawful. The organization is not responsible for any damage caused by a virus or alteration of the e-mail by a third party or otherwise. The contents of this message may not necessarily represent the views or policies of Corvi


Re: [Zephyr-devel] FW: support for NFFS file system

Vikrant More <vikrant8051@...>
 

#include <fs.h>

void main( )
{
    fs_file_t *my_zfp;
    unsigned char ptr[32];


    fs_open(my_zfp,"mesh.prv");
    fs_write(my_zfp,"Hello World !! ",16);
    fs_read(my_zfp,ptr,32);
    fs_close(my_zfp);

    printk("%s",ptr);
}

I've edited main.c in my project as mentioned above.

And add CONFIG_FILE_SYSTEM_NFFS=y in prj.conf

1st time I got following error,

In file included from /home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:3:0:
/home/vikrant/projects/zephyr/zephyr/include/fs.h:66:12: error: ‘MAX_FILE_NAME’ undeclared here (not in a function)
  char name[MAX_FILE_NAME + 1];
            ^~~~~~~~~~~~~
CMakeFiles/app.dir/build.make:302: recipe for target 'CMakeFiles/app.dir/src/main.c.obj' failed
make[2]: *** [CMakeFiles/app.dir/src/main.c.obj] Error 1
CMakeFiles/Makefile2:259: recipe for target 'CMakeFiles/app.dir/all' failed
make[1]: *** [CMakeFiles/app.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

To overcome it I added ,    #define MAX_FILE_NAME 10   in zephyr/include/fs.h

After this I got following error,

../libapp.a(main.c.obj): In function `main':
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:226: undefined reference to `fs_open'
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:227: undefined reference to `fs_write'
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:228: undefined reference to `fs_read'
/home/vikrant/projects/zephyr/zephyr/samples/bluetooth/mesh/src/main.c:229: undefined reference to `fs_close'
collect2: error: ld returned 1 exit status
zephyr/CMakeFiles/zephyr_prebuilt.dir/build.make:104: recipe for target 'zephyr/zephyr_prebuilt.elf' failed
make[2]: *** [zephyr/zephyr_prebuilt.elf] Error 1
CMakeFiles/Makefile2:569: recipe for target 'zephyr/CMakeFiles/zephyr_prebuilt.dir/all' failed
make[1]: *** [zephyr/CMakeFiles/zephyr_prebuilt.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2




Following line are already present in zephyr/boards/arm/nrf52840_pca10056/nrf52840_pca10056.dts


#if defined(CONFIG_FILE_SYSTEM_NFFS)
        nffs_partition: partition@fc000 {
            label = "nffs";
            reg = <0x000fc000 0x00004000>;
        };
#endif

Could you please tell me what I'm missing ?

Thank You !!

On Fri, Jan 19, 2018 at 12:15 AM, Michael Hope <michaelh@...> wrote:

1. Ensure the board has a nffs partition defined in Device Tree.  See here for an example.
2. Turn on CONFIG_FILE_SYSTEM_NFFS in the config
3. Use the APIs in include/fs.h such as fs_open() etc

If you turn on CONFIG_FILE_SYSTEM_SHELL then you'll also get a simple interactive shell where you can list directories etc.

-- Michael


On Thu, 18 Jan 2018 at 15:16 Vikrant More <vikrant8051@...> wrote:
Thanks for reply.

Where I will find APIs & sample codes based on it to access internal flash of nrf52840 ?


On Jan 18, 2018 3:38 PM, "Puzdrowski, Andrzej" <Andrzej.Puzdrowski@nordicsemi.no> wrote:

NFFS Is supported since 1.10 release:

https://www.zephyrproject.org/releases/1-10-release-december-2017/

 

Andrzej

From: zephyr-devel-bounces@lists.zephyrproject.org [mailto:zephyr-devel-bounces@lists.zephyrproject.org] On Behalf Of Vikrant More
Sent: Thursday, January 18, 2018 10:09 AM
To: zephyr-devel@lists.zephyrproject.org; zephyr-users@lists.zephyrproject.org
Subject: [Zephyr-devel] support for NFFS file system

 

Hello World !!

 

My question is related to this link's requirement,
https://lists.zephyrproject.org/pipermail/zephyr-devel/2017-July/007888.html

Is Zephyr going to add support for NFFS file system in upcoming 1.11 (March 20148) release ?

What is current status of NFFS file system development ?

Could anybody explain me from Zephyr Core developer team ?

Thank You !! 


_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@lists.zephyrproject.org
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel

_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@lists.zephyrproject.org
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel


Re: [Zephyr-devel] Working with flash on nrf52840

ashish.shukla@corvi.com <ashish.shukla@...>
 

It runs successfully. Thanks !


--
Warm regards,
Ashish Shukla
Jr. Embedded Engineer
Research & Development


Please consider the environment before printing this e-mail or its attachments.

Disclaimer: The information contained herein (including any accompanying documents) is confidential and is intended solely for the addressee(s). If you have erroneously received this message, please immediately delete it and notify the sender. Also, if you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this message or any accompanying document is strictly prohibited and is unlawful. The organization is not responsible for any damage caused by a virus or alteration of the e-mail by a third party or otherwise. The contents of this message may not necessarily represent the views or policies of Corvi


On Fri, Jan 19, 2018 at 12:39 PM, Puzdrowski, Andrzej <Andrzej.Puzdrowski@...> wrote:

Add configuration CONFIG_MPU_ALLOW_FLASH_WRITE=y to the project (or select via Kconfig).

This should help.

 

Andrzej

 

From: zephyr-devel-bounces@lists.zephyrproject.org [mailto:zephyr-devel-bounces@lists.zephyrproject.org] On Behalf Of ashish.shukla@...
Sent: Friday, January 19, 2018 7:09 AM
To: zephyr-devel@lists.zephyrproject.org; zephyr-users@lists.zephyrproject.org
Subject: [Zephyr-devel] Working with flash on nrf52840

 

Hello all !!

I'm working with /zephyr/samples/driver/soc_flash_nrf5. when I run this example, flash erase is successful,but it fails to write anything, resulting in error

 Data Access Violation

 Address : 0x40000

 

Changing the offset address, results in failure in flash erase itself. I guess it's something to do with offset address I'm working with. Can someone throw some light what's happening in case of nrf52840.

 

Has anyone succeeded in making it work? 


 

--

Warm regards,
Ashish Shukla

Jr. Embedded Engineer

Research & Development

 

Please consider the environment before printing this e-mail or its attachments.

 

Disclaimer: The information contained herein (including any accompanying documents) is confidential and is intended solely for the addressee(s). If you have erroneously received this message, please immediately delete it and notify the sender. Also, if you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this message or any accompanying document is strictly prohibited and is unlawful. The organization is not responsible for any damage caused by a virus or alteration of the e-mail by a third party or otherwise. The contents of this message may not necessarily represent the views or policies of Corvi

 



Re: [Zephyr-devel] Working with flash on nrf52840

Puzdrowski, Andrzej <Andrzej.Puzdrowski@...>
 

Add configuration CONFIG_MPU_ALLOW_FLASH_WRITE=y to the project (or select via Kconfig).

This should help.

 

Andrzej

 

From: zephyr-devel-bounces@... [mailto:zephyr-devel-bounces@...] On Behalf Of ashish.shukla@...
Sent: Friday, January 19, 2018 7:09 AM
To: zephyr-devel@...; zephyr-users@...
Subject: [Zephyr-devel] Working with flash on nrf52840

 

Hello all !!

I'm working with /zephyr/samples/driver/soc_flash_nrf5. when I run this example, flash erase is successful,but it fails to write anything, resulting in error

 Data Access Violation

 Address : 0x40000

 

Changing the offset address, results in failure in flash erase itself. I guess it's something to do with offset address I'm working with. Can someone throw some light what's happening in case of nrf52840.

 

Has anyone succeeded in making it work? 


 

--

Warm regards,
Ashish Shukla

Jr. Embedded Engineer

Research & Development

 

Please consider the environment before printing this e-mail or its attachments.

 

Disclaimer: The information contained herein (including any accompanying documents) is confidential and is intended solely for the addressee(s). If you have erroneously received this message, please immediately delete it and notify the sender. Also, if you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this message or any accompanying document is strictly prohibited and is unlawful. The organization is not responsible for any damage caused by a virus or alteration of the e-mail by a third party or otherwise. The contents of this message may not necessarily represent the views or policies of Corvi

 


Working with flash on nrf52840

ashish.shukla@corvi.com <ashish.shukla@...>
 

Hello all !!

I'm working with /zephyr/samples/driver/soc_flash_nrf5. when I run this example, flash erase is successful,but it fails to write anything, resulting in error

 Data Access Violation
 Address : 0x40000

Changing the offset address, results in failure in flash erase itself. I guess it's something to do with offset address I'm working with. Can someone throw some light what's happening in case of nrf52840.

Has anyone succeeded in making it work? 


--
Warm regards,
Ashish Shukla
Jr. Embedded Engineer
Research & Development


Please consider the environment before printing this e-mail or its attachments.

Disclaimer: The information contained herein (including any accompanying documents) is confidential and is intended solely for the addressee(s). If you have erroneously received this message, please immediately delete it and notify the sender. Also, if you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this message or any accompanying document is strictly prohibited and is unlawful. The organization is not responsible for any damage caused by a virus or alteration of the e-mail by a third party or otherwise. The contents of this message may not necessarily represent the views or policies of Corvi


support for NFFS file system

Vikrant More <vikrant8051@...>
 

Hello World !!

Is Zephyr going to add support for NFFS file system in upcoming 1.11 (March 20148) release ?

What is current status of NFFS file system development ?
Could anybody explain me from Zephyr Core developer team ?

Thank You !! 

2221 - 2240 of 2712