NCS 2.7.0 and "requires-ulbpr" for spi-nor

Hello,

I am currently migrating from NCS 2.6.0 to NCS 2.7.0 on my board with an NRF9160.

During that process I switched to the new hardware model and to sysbuild. As far as I see everything works as expected after the migration with NCS 2.7.0, except for writing to the SPI-NOR-Flash on my board. Reading from the SPI-NOR-Flash works with NCS 2.7.0.

I could narrow the issue down to the the requires_ulbpr setting, which is defined in the device tree for the SPI-NOR on my board:

&spi2 {
    compatible = "nordic,nrf-spim";
    status = "okay";
    cs-gpios = <&gpio0 4 GPIO_ACTIVE_LOW>;
    pinctrl-0 = <&spi2_default>;
    pinctrl-1 = <&spi2_sleep>;
    pinctrl-names = "default", "sleep";
    sst26vf016b: sst26vf016b@0 {
        compatible = "jedec,spi-nor";
        requires-ulbpr;
        reg = <0>;
        spi-max-frequency = <100000000>;
        size = <16777216>;
        has-dpd;
        t-enter-dpd = <3000>;
        t-exit-dpd = <5000>;
        jedec-id = [ bf 26 41 ];
    };
};

It seems in NCS 2.7.0 the setting is not evaluated correctly in spi_nor.c. In this version it is mapped to a bitfield, but the bit does not seem to be set, even if the requires-ulbpr is defined in the device-tree.

If I do the check the same it was done in NCS 2.6.0 instead of using the cfg->requires_ulbpr_exist bit (in function spi_nor_write_protection_set() of spi_nor.c) the setting is recognized correctly and writing is possible:

IS_ENABLED(DT_INST_PROP(0, requires_ulbpr)

Am I missing something? Is the bit field filled automatically or does it now require some initialization call for the SPI driver so it is working correctly?

Best regards

rw

Related