Matter Factory Data: use own module name for logger in FactoryDataProvider

Building the app with the factory data provider (CONFIG_CHIP_FACTORY_DATA), active logging for Matter (CONFIG_MATTER_LOG_LEVEL_DBG) and immediate logging (CONFIG_LOG_MODE_IMMEDIATE), I'll get a linker error:

modules/lib/matter/src/platform/nrfconnect/FactoryDataParser.c:146: undefined reference to `log_dynamic_app'

This happens in the build step Linking CXX executable zephyr/zephyr_pre0.elf

The problem can be solved by registering a module with the name "app" which is used in LOG_MODULE_DECLARE of the FactoryDataParser.c. It would be nice to register an module name by itself, so the error can be resolved more easily, since the error message does not help to figure out the underlying problem.

  • Hi Robert

    I just did a quick test on my end, and was able to build the light_bulb project with these configs, but it did not run as expected when specifically the CONFIG_CHIP_FACTORY_DATA config enabled. It seems like a bug in our Matter samples, so I have reported this internally in hopes that we can get to the bottom of it.

    What sample/project did you use when running into this linker error?

    Since we're closing in on the holiday season, we're low on staff, so delayed replies must be expected. Most likely I won't have an update for you until early January. Thank you for your patience, and happy holidays!

    Best regards,

    Simon

  • Hej Simon, no problem.
    I also circumvented the issue by registering the "app"-module in my main file.

    With the examples in Matter, I was able to reproduce it using the "lock-app". nrf-sdk Version is 2.2.0.

    Best regards.

  • I have also figured out that you cannot trigger the error, since LOG_MODULE_REGISTER is set to "app" in the light-bulb example. If you set LOG_MODULE_REGISTER(light_bulb_app, CONFIG_MATTER_LOG_LEVEL), the build will fail.

Related