nRF52840DK Matter samples assume 8MB external flash. How to configure for 2MB external flash instead?

Hello,

We are developing a product using the nRF52840 and have most of our h/w turned on except we haven’t activated the external flash yet. We have been successful at interacting with the internal flash. We have that working. We are using the library calls flash_erase(), flash_write() and flash_read() for that (#include <zephyr/drivers/flash.h>).

Initially we would like (if possible) to use that same library interface for interacting with the external flash? One issue is that the external flash component we are using is not the same size as the one on the nRF52840DK board, and we’re having trouble learning what changes will be needed for our prj.conf and/or *.overlay files. The part we are using is the  MX25R1635FZUIH0 (2Mx8). I glanced around the Nordic doc sites but so far no luck (e.g. infocenter.nordicsemi.com/…).

It seems the various Nordic matter samples assume an external flash part of mx25r64 which I believe is the 8MB version of the 2MB version we have loaded. Any ideas on how we can get configured for the MX25R16? And if we can use the zephyr/drivers/flash.h interface for interacting with it?

Thank you in advance!
Steve K.
PuzL Labs, LLC

Parents
  • Hi Steve

    Correct, you need to change size, and possibly JEDEC ID and/or sfdp-bfp. Yes you can add this to an overlay on your end. What these should be is specified in the product datasheet.

    Yes, you can also add the pm-ext-flash to your overlay, but I think you should name it mx25r16 to avoid confusion (just common developer sense).

    Best regards,

    Simon

  • Simon,

    I am a colleague of Steve Kranz.  We have made the changes that you suggested.  However, we have a problem with the last line of following code:

    &qspi {
            status = "okay";
            pinctrl-0 = <&qspi_default>;
            pinctrl-1 = <&qspi_sleep>;
            pinctrl-names = "default", "sleep";
            mx25r16: mx25r6435f@0 {

    If we change the mx25r6435f@0 to mx25r1635f@0, we get a compile error.  When I searched through the SDK, I found a definition of the mx25r6435f in the file:

    /opt/nordic/ncs/v2.5.0/zephyr/dts/bindings/flash_controller/st,stm32-qspi-nor.yaml

    I suppose that the question is whether we can continue to use the mx2566435f reference.  I believe that the settings in the yaml file are correct for the mx25r1635f part, except for the size.  I would suspect that when we setup the "qspi" data structure, that size value we set in this declaration will override the default size defined in the yaml file.

    On the other hand, do we need to create a new yaml file to define the mx25r1635f part?

    Thanks,

    Gene

Reply
  • Simon,

    I am a colleague of Steve Kranz.  We have made the changes that you suggested.  However, we have a problem with the last line of following code:

    &qspi {
            status = "okay";
            pinctrl-0 = <&qspi_default>;
            pinctrl-1 = <&qspi_sleep>;
            pinctrl-names = "default", "sleep";
            mx25r16: mx25r6435f@0 {

    If we change the mx25r6435f@0 to mx25r1635f@0, we get a compile error.  When I searched through the SDK, I found a definition of the mx25r6435f in the file:

    /opt/nordic/ncs/v2.5.0/zephyr/dts/bindings/flash_controller/st,stm32-qspi-nor.yaml

    I suppose that the question is whether we can continue to use the mx2566435f reference.  I believe that the settings in the yaml file are correct for the mx25r1635f part, except for the size.  I would suspect that when we setup the "qspi" data structure, that size value we set in this declaration will override the default size defined in the yaml file.

    On the other hand, do we need to create a new yaml file to define the mx25r1635f part?

    Thanks,

    Gene

Children
Related