nRF5340+nRF7002: How to program application and matter factory data?

Hi, 
We have an application based on Matter Template and we want to program our application and the matter factory data during production, how do we do that?

What we have tried so far:
In the application prj.conf we added:

CONFIG_CHIP_FACTORY_DATA=n

in sysbuild.conf:
SB_CONFIG_MATTER_FACTORY_DATA_GENERATE=n

We also generated the factory_data.hex, .bin and ..json following this: Configuring factory data for the nRF Connect examples   
(added this: --offset 0xff000 --size 0x1000)

The we program the factory_data.hex using the nrfutil: 
nrfutil device program --firmware factory_data.hex

After this, we program our applicaion using nRF connect programmer.

The problem:
we printed out the vendor name and id expecting our company name and id will be shown but it is still using the default Nordic vendor name and id(the default used in the template):
GetVendorName: Nordic Semiconductor ASA
GetVendorId: 0xFFF1     

We need to generate unique factory data then we program this data along with our application. What is the correct way of doing this? Also why is that we are still reading the vendor name Nordic even though we already disabled factory data generation in prj.conf and sysbuild.conf?

Thanks  
Parents
  • Hi,

    Could you expand a bit on why you disabled CONFIG_CHIP_FACTORY_DATA and SB_CONFIG_MATTER_FACTORY_DATA_GENERATE? I am a bit new to this topic, but I am getting the impression that it should be enabled.

    Regards,

    Elfving

  • Hi Elfving, 

    CONFIG_CHIP_FACTORY_DATA and SB_CONFIG_MATTER_FACTORY_DATA_GENERATE was disabled in the build system because factory data needs to be unique for each device for parameters such as serial number, etc. So factory data needs to be built externally using generate_nrfconnect_chip_factory_data.py so that we can modify parameters for each device. Then we just need to program the factory data to the factory_data partition which is what we need some guidance on how to properly do it.

    rgds

  • Thanks for the patience Winston.

    Could you let me know what NCS version you are using? Nevermind this.

    I have had a bit of a talk with the relevant R&D team.

    Winston A said:
    CONFIG_CHIP_FACTORY_DATA and SB_CONFIG_MATTER_FACTORY_DATA_GENERATE was disabled in the build system because factory data needs to be unique for each device for parameters such as serial number, etc. So factory data needs to be built externally using generate_nrfconnect_chip_factory_data.py so that we can modify parameters for each device. Then we just need to program the factory data to the factory_data partition which is what we need some guidance on how to properly do it.

    You are correct in your thinking here. Though CONFIG_CHIP_FACTORY_DATA needs to be enabled (=y). And then you need to set the sysbuild config SB_CONFIG_MATTER_FACTORY_DATA_MERGE_WITH_FIRMWARE=n.

    Then unique factory data.hex files can be generated and flashed to the devices. The latter config makes it so that the factory data is not merged with the firmware.

    Regards,

    Elfving

Reply
  • Thanks for the patience Winston.

    Could you let me know what NCS version you are using? Nevermind this.

    I have had a bit of a talk with the relevant R&D team.

    Winston A said:
    CONFIG_CHIP_FACTORY_DATA and SB_CONFIG_MATTER_FACTORY_DATA_GENERATE was disabled in the build system because factory data needs to be unique for each device for parameters such as serial number, etc. So factory data needs to be built externally using generate_nrfconnect_chip_factory_data.py so that we can modify parameters for each device. Then we just need to program the factory data to the factory_data partition which is what we need some guidance on how to properly do it.

    You are correct in your thinking here. Though CONFIG_CHIP_FACTORY_DATA needs to be enabled (=y). And then you need to set the sysbuild config SB_CONFIG_MATTER_FACTORY_DATA_MERGE_WITH_FIRMWARE=n.

    Then unique factory data.hex files can be generated and flashed to the devices. The latter config makes it so that the factory data is not merged with the firmware.

    Regards,

    Elfving

Children
Related