[Zephyr-users] Cannot write with i2c NRF52832 (TWI and TWIM)
vikrant8051 <vikrant8051@...>
Hi Rodrigo, Currently trying to build zephyr/samples/drivers/i2c_fujitsu_fram/ demo eg. to test i2c for nRF52840_pca10056. As per your previous email, I added following things in prj.conf CONFIG_I2C=y CONFIG_I2C_NRFX=y CONFIG_I2C_0_NRF_TWI=y CONFIG_I2C_INIT_PRIORITY=60 CONFIG_I2C_0=y But still getting following error, ../src/main.c:16:17: error: ‘CONFIG_I2C_0_NAME’ undeclared (first use in this function) #define I2C_DEV CONFIG_I2C_0_NAME ^ ../src/main.c:84:31: note: in expansion of macro ‘I2C_DEV’ i2c_dev = device_get_binding(I2C_DEV); ^~~~~~~ ../src/main.c:16:17: note: each undeclared identifier is reported only once for each function it appears in #define I2C_DEV CONFIG_I2C_0_NAME ^ ../src/main.c:84:31: note: in expansion of macro ‘I2C_DEV’ i2c_dev = device_get_binding(I2C_DEV); ^~~~~~~ [19/141] Building C object zephyr/CMakeFiles/zephyr.dir/lib/mempool/mempool.c.obj ninja: build stopped: subcommand failed. Please help me to sort out this issue. Thank You !!
On Wed, Oct 24, 2018 at 2:01 AM Rodrigo Peixoto <rodrigopex@...> wrote:
|
|
lairdjm
Run ninja menuconfig, go through the settings and set the various I2C options up then it should build.
|
|
lairdjm
Works fine with those lines added to prj.conf
[0/1] Re-running CMake... CMake Deprecation Warning at C:/test/zephyr/cmake/app/boilerplate.cmake:38 (cmake_policy): The OLD behavior for policy CMP0000 will be removed from a future version of CMake.
The cmake-policies(7) manual explains that the OLD behaviors of all policies are deprecated and that a policy should be set to OLD only under specific short-term circumstances. Projects should be ported to the NEW behavior and not rely on setting a policy to OLD. Call Stack (most recent call first): CMakeLists.txt:1 (include)
-- Selected BOARD nrf52840_pca10056 Zephyr version: 1.12.99 Parsing Kconfig tree in C:/test/zephyr//Kconfig Using C:/test/zephyr/samples/drivers/i2c_fujitsu_fram/build/zephyr/.config as base fatal: No tags can describe '02addfff50f936af41dfc71ab2d6140ace86f455'. Try --always, or create some tags. -- Generating zephyr/include/generated/generated_dts_board.h -- Cache files will be written to: C:\Users\jamie.mccrae\AppData\Local/.cache/zephyr -- Configuring done -- Generating done -- Build files have been written to: C:/test/zephyr/samples/drivers/i2c_fujitsu_fram/build [129/134] Linking C executable zephyr\zephyr_prebuilt.elf Memory region Used Size Region Size %age Used FLASH: 48292 B 1 MB 4.61% SRAM: 11220 B 256 KB 4.28% IDT_LIST: 136 B 2 KB 6.64% [134/134] Linking C executable zephyr\zephyr.elf
|
|
vikrant8051 <vikrant8051@...>
Hi to all, I renamed driver name from CONFIG_I2C_0_NAME to DT_I2C_0_NAME. Plus add following Kconfig things in prj.conf. Now everything is working fine. CONFIG_I2C=y CONFIG_I2C_NRFX=y CONFIG_NRFX_TWI=y CONFIG_I2C_0_NRF_TWI=y CONFIG_HAS_HW_NRF_TWI0=y CONFIG_I2C_INIT_PRIORITY=60 CONFIG_I2C_0=y Thanks & Regards, vikrant
On Wed, Nov 28, 2018 at 3:03 PM Vikrant More <vikrant8051@...> wrote:
|
|