Migrating to NCS v2.0.0 "error: NRFX_TWI (defined at C:\NCS\v2.0.0\zephyr\modules\hal_nordic\nrfx\Kconfig:277"

I've been working on porting a project to NCS using VS Code as my IDE. Now that NSC v2.0.0 is out, I wanted to move to that. I found the migration guide: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/migration/migration_guide_1.x_to_2.x.html. I re-targeted the toolchain, and I found the scripts to change the include paths and pin control setup. That made that change over pretty painless; however, it did not fix an issue I was having with a TWI definition: "error: NRFX_TWI (defined at C:\NCS\v2.0.0\zephyr\modules\hal_nordic\nrfx\Kconfig:277"

It went on the state that "\build\modules\hal_nordic\nrfx\Kconfig:277 is assigned in a configuration file, but is not directly user-
configurable (has no prompt). It gets its value indirectly from other symbols. See
docs.zephyrproject.org/.../kconfig.html and/or look up NRFX_TWI in the
menuconfig/guiconfig interface. The Application Development Primer, Setting Configuration Values,
and Kconfig - Tips and Best Practices sections of the manual might be helpful too."

I read some about those Kconfig files and compared the ones in v1.9.1 versus my new one in v2.0.0.

In v2.0.0 it looks like

config NRFX_TWI
	bool

In v1.9.1 it looks like

config NRFX_TWI
	bool "Enable TWI driver"
	depends on HAS_HW_NRF_TWI0 || HAS_HW_NRF_TWI1

The term "bool" without any value after it looks odd to me, but I'm still just learning how to understand these Kconfig files.I noticed that NRFX_TWIM is that same way along with several other entries. I tried copying the ones from v1.9.1 to v2.0.0 and it now objected to the NRFX_TWIM entry. So then I deleted it and it claimed I was over the memory boundary. I don't think that's a good fix. I couldn't find anyone else with the same problem.

Also, the link provided in the error "http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_NRFX_TWI" does not lead to valid search term. But when you take a "$" character off the end it show the values in the Kconfig file except for the ones with the empty "boot" terms.

Back to the issue, at this point I'm not sure where to look next. I doubt the Kconfig has an issue, but I'm still learning the basics of how that works.

Parents
  • Hi,

    If you were using CONFIG_NRFX_TWI, try using CONFIG_NRFX_TWI1 for example instead, replacing the number with the instance of i2c you are using. This is specifically if you are not using the Zephyr API. When using the Zephyr API just use CONFIG_I2C.

  • It looks like this project had both CONFIG_I2C and CONFIG_NRFX_TWI equaling 'y' and I suppose that led to a conflict that was not present in sdk versions older than 2.0.0. I commented out all the NRFX stuff:

    # I2C
    CONFIG_I2C=y
    CONFIG_I2C_NRFX=y
    # CONFIG_NRFX_TWI=y
    # CONFIG_NRFX_TWI0=y
    # CONFIG_NRFX_TWIM=y
    # CONFIG_NRFX_TWIM0=y
    CONFIG_I2C_LOG_LEVEL_DBG=y

    I still haven't gotten it to compile since the macro "DT_PROP" appears to use "DT_CAT" to concatenate some stuff to get the identifier for the i2c channel pin. That must have changed between the Zephyr usage and the NRFX usage. I'm digging to find out how to use something else in it's place, but it looks like you've got me on the right track.

Reply
  • It looks like this project had both CONFIG_I2C and CONFIG_NRFX_TWI equaling 'y' and I suppose that led to a conflict that was not present in sdk versions older than 2.0.0. I commented out all the NRFX stuff:

    # I2C
    CONFIG_I2C=y
    CONFIG_I2C_NRFX=y
    # CONFIG_NRFX_TWI=y
    # CONFIG_NRFX_TWI0=y
    # CONFIG_NRFX_TWIM=y
    # CONFIG_NRFX_TWIM0=y
    CONFIG_I2C_LOG_LEVEL_DBG=y

    I still haven't gotten it to compile since the macro "DT_PROP" appears to use "DT_CAT" to concatenate some stuff to get the identifier for the i2c channel pin. That must have changed between the Zephyr usage and the NRFX usage. I'm digging to find out how to use something else in it's place, but it looks like you've got me on the right track.

Children
No Data
Related