Update from nRF Connect SDK 1.7 to nRF Connect SDK 1.9.1

I am attempting to upgrade from nRF Connect SDK version 1.7 to version 1.9.1

My application is using the nrf52840 on a custom board.

I'm using Zephyr and created a board file based on the nrf52840-nrf52840-dk board (and an overlay file).

Everything seems to work using version 1.7 (Solution builds, etc.)

When I try to compile using version 1.9.1, I get two errors I haven't been able to resolve:

1.  I'm using LittleFS and the following error occurs when compiling littlefs_fs.c:

2> Compiling ‘littlefs_fs.c’
2> In file included from E:/N/S/v1.9.1/zephyr/include/sys/util_macro.h:34,
2>                  from E:/N/S/v1.9.1/zephyr/include/sys/atomic.h:16,
2>                  from E:/N/S/v1.9.1/zephyr/include/kernel_includes.h:21,
2>                  from E:/N/S/v1.9.1/zephyr/include/kernel.h:17,
2>                  from E:/N/S/v1.9.1/zephyr/subsys/fs/littlefs_fs.c:10:
2> E:/N/S/v1.9.1/zephyr/include/devicetree/fixed-partitions.h:53:9: error: 'DT_COMPAT_fixed_partitions_LABEL_storage_PARTITION_ID' undeclared here (not in a function); did you mean 'DT_COMPAT_fixed_partitions_LABEL_image_1_EXISTS'?

I'm using the same prj.conf and board files (and overlay files) as used with version 1.7 (and I didn't see any documentation identifying needed changes to move beyond version 1.7)

2.  I also use IRQ_CONNECT to capture interrupts from one of the TWIM devices.  The line of code is:

IRQ_CONNECT(SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1_IRQn,6,nrfx_isr,nrfx_twim_1_irq_handler,0);

and produces an error:

1> ../src/main.c:436:7: warning: unused variable 'err' [-Wunused-variable]
1> In file included from E:/N/S/v1.9.1/zephyr/include/toolchain.h:50,
1>                  from E:/N/S/v1.9.1/zephyr/lib/libc/minimal/include/string.h:13,
1>                  from ../src/include/Telemetry.h:7,
1>                  from ../src/main.c:9:
1> ../src/main.c: In function 'main':
1> E:/N/S/v1.9.1/zephyr/include/arch/arm/aarch32/irq.h:97:2: error: static assertion failed: "Invalid interrupt priority. Values must not exceed IRQ_PRIO_LOWEST"
1> E:/N/S/v1.9.1/zephyr/include/arch/arm/aarch32/irq.h:118:2: note: in expansion of macro '_CHECK_PRIO'
1> E:/N/S/v1.9.1/zephyr/include/irq.h:49:2: note: in expansion of macro 'ARCH_IRQ_CONNECT'
1> ../src/main.c:644:3: note: in expansion of macro 'IRQ_CONNECT'

Again, this works fine with version 1.7, but fails with version 1.9.1

Is there some new configuration setting needed?

Thanks!

P.S. Sorry for the weird formatting of the error messages from the copy/paste from the SES window...

Parents Reply Children
  • Hi Dejan,

    Thanks for the reply.

    I changed the priority in the IRQ_CONNECT() call from 6 to 5 and that seemed to clear that error. (But why?)

    I don't call DT_NODE_BY_FIXED_PARTITION_LABEL directly...   So it must be being called through this code:

    #if 1
    //
    // LITTLEFS declaration
    //
    #if DT_NODE_EXISTS(PARTITION_NODE)
    FS_FSTAB_DECLARE_ENTRY(PARTITION_NODE);
    #else /* PARTITION_NODE */
    FS_LITTLEFS_DECLARE_DEFAULT_CONFIG(storage);
    static struct fs_mount_t lfs_storage_mnt = {
    	.type = FS_LITTLEFS,
    	.fs_data = &storage,
    	.storage_dev = (void *)FLASH_AREA_ID(storage),
    	.mnt_point = "/lfs1",
    };
    #endif /* PARTITION_NODE */
    
    // For LITTLEFS
    void
    initFileSystem(fileSystemInfo *fs) {
      fs->mp=
    #if DT_NODE_EXISTS(PARTITION_NODE)
           &FS_FSTAB_ENTRY(PARTITION_NODE)
    #else
           &lfs_storage_mnt
    #endif
           ;
    
      int err= fs_mount(fs->mp);
      fs->devId= (uintptr_t)fs->mp->storage_dev;
    }
    
    
    
    
    #endif

    Note that   DT_NODE_EXISTS(PARTITION_NODE)   resolves to TRUE, so the first part of both #if clauses is used.

    Here is the region of portion of the .overlay file where the partition is defined:

    / {
    fstab {
      compatible = "zephyr,fstab";
        lfs1: lfs1 {  
          compatible = "zephyr,fstab,littlefs"; 
          mount-point = "/lfs1";
          partition = <&lfs1_part>;
      /*
          automount;
      */
          read-size = <16>;
          prog-size = <16>;
          cache-size = <64>;
          lookahead-size = <32>;
          block-cycles = <512>;
        };
      };
    };

    &mx25r64 {
      jedec-id = [01 20 18];
      size = <134217728>;
      partitions {
        compatible = "fixed-partitions";
        #address-cells = <1>;
        #size-cells = <1>;

        lfs1_part: partition@0 {
          label = "lfs1";
    /*
          reg = <0x00000000 0x02000000>;
    */
          reg = <0x00000000 0x00020000>;
       };
    };

    (Note that the above code doesn't "survive" being put into a "code box")

    But for both errors...    This all works fine with nRF Connect SDK version 1.7.1 

    But it fails for version 1.9.1 

    I need to understand what has changed in the OS that the IRQ level needs to change from 6 to 5 and the file specification doesn't work.   

    Thanks!

  • Here is the full error message:

    2> Compiling ‘littlefs_fs.c’
    2> In file included from [01m[KE:/N/S/v1.9.1/zephyr/include/sys/util_macro.h:34[m[K,
    2> from [01m[KE:/N/S/v1.9.1/zephyr/include/sys/atomic.h:16[m[K,
    2> from [01m[KE:/N/S/v1.9.1/zephyr/include/kernel_includes.h:21[m[K,
    2> from [01m[KE:/N/S/v1.9.1/zephyr/include/kernel.h:17[m[K,
    2> from [01m[KE:/N/S/v1.9.1/zephyr/subsys/fs/littlefs_fs.c:10[m[K:
    2> [01m[KE:/N/S/v1.9.1/zephyr/include/devicetree/fixed-partitions.h:53:9:[m[K [01;31m[Kerror: [m[K'[01m[KDT_COMPAT_fixed_partitions_LABEL_storage_PARTITION_ID[m[K' undeclared here (not in a function); did you mean '[01m[KDT_COMPAT_fixed_partitions_LABEL_image_1_EXISTS[m[K'?
    2> [01m[KE:/N/S/v1.9.1/zephyr/include/sys/util_internal.h:67:26:[m[K [01;36m[Knote: [m[Kin definition of macro '[01m[K__DEBRACKET[m[K'
    2> [01m[KE:/N/S/v1.9.1/zephyr/include/sys/util_internal.h:59:2:[m[K [01;36m[Knote: [m[Kin expansion of macro '[01m[K__GET_ARG2_DEBRACKET[m[K'
    2> [01m[KE:/N/S/v1.9.1/zephyr/include/sys/util_internal.h:54:2:[m[K [01;36m[Knote: [m[Kin expansion of macro '[01m[K__COND_CODE[m[K'
    2> [01m[KE:/N/S/v1.9.1/zephyr/include/sys/util_macro.h:157:2:[m[K [01;36m[Knote: [m[Kin expansion of macro '[01m[KZ_COND_CODE_1[m[K'
    2> [01m[KE:/N/S/v1.9.1/zephyr/include/devicetree.h:2873:2:[m[K [01;36m[Knote: [m[Kin expansion of macro '[01m[KCOND_CODE_1[m[K'
    2> [01m[KE:/N/S/v1.9.1/zephyr/include/sys/util_internal.h:64:53:[m[K [01;36m[Knote: [m[Kin expansion of macro '[01m[K__DEBRACKET[m[K'
    2> [01m[KE:/N/S/v1.9.1/zephyr/include/sys/util_internal.h:59:2:[m[K [01;36m[Knote: [m[Kin expansion of macro '[01m[K__GET_ARG2_DEBRACKET[m[K'
    2> [01m[KE:/N/S/v1.9.1/zephyr/include/sys/util_internal.h:54:2:[m[K [01;36m[Knote: [m[Kin expansion of macro '[01m[K__COND_CODE[m[K'
    2> [01m[KE:/N/S/v1.9.1/zephyr/include/sys/util_macro.h:157:2:[m[K [01;36m[Knote: [m[Kin expansion of macro '[01m[KZ_COND_CODE_1[m[K'
    2> [01m[KE:/N/S/v1.9.1/zephyr/subsys/fs/littlefs_fs.c:819:4:[m[K [01;36m[Knote: [m[Kin expansion of macro '[01m[KCOND_CODE_1[m[K'
    2> [01m[KE:/N/S/v1.9.1/zephyr/include/devicetree/fixed-partitions.h:69:40:[m[K [01;36m[Knote: [m[Kin expansion of macro '[01m[KDT_CAT[m[K'
    2> [01m[KE:/N/S/v1.9.1/zephyr/include/storage/flash_map.h:270:2:[m[K [01;36m[Knote: [m[Kin expansion of macro '[01m[KDT_FIXED_PARTITION_ID[m[K'
    2> [01m[KE:/N/S/v1.9.1/zephyr/include/devicetree/fixed-partitions.h:53:2:[m[K [01;36m[Knote: [m[Kin expansion of macro '[01m[KDT_CAT[m[K'
    2> [01m[KE:/N/S/v1.9.1/zephyr/include/storage/flash_map.h:270:24:[m[K [01;36m[Knote: [m[Kin expansion of macro '[01m[KDT_NODE_BY_FIXED_PARTITION_LABEL[m[K'
    2> [01m[KE:/N/S/v1.9.1/zephyr/subsys/fs/littlefs_fs.c:821:10:[m[K [01;36m[Knote: [m[Kin expansion of macro '[01m[KFLASH_AREA_ID[m[K'
    2> [01m[Kzephyr/include/generated/devicetree_unfixed.h:8231:56:[m[K [01;36m[Knote: [m[Kin expansion of macro '[01m[KDEFINE_FS[m[K'
    2> [01m[KE:/N/S/v1.9.1/zephyr/include/sys/util_internal.h:99:36:[m[K [01;36m[Knote: [m[Kin expansion of macro '[01m[KDT_FOREACH_OKAY_INST_zephyr_fstab_littlefs[m[K'
    2> [01m[KE:/N/S/v1.9.1/zephyr/subsys/fs/littlefs_fs.c:826:1:[m[K [01;36m[Knote: [m[Kin expansion of macro '[01m[KDT_INST_FOREACH_STATUS_OKAY[m[K'

  • Hi Ed,

    When using zero latency interrupt, 0-5 are available interrupt levels for the application.

    Regarding DT_NODE_BY_FIXED_PARTITION_LABEL, I have asked internally and I will get back to you with more information, possibly till the end of this week.

    Best regards,
    Dejan

  • Hi Ed,

    If you are using partition manager in your project, it is recommended to use macros from flash_map_pm.h instead of DT natives.

    Best regards,
    Dejan

  • But the calls I make come directly from the example in:

    zephyr/samples/subsys/fs/littlefs/src/main.c 

    Is there a different example I should be following?

Related