i2c_burst_read(0x0) failed, ret=-5 on ncs v2.4.2

I use nRF52832 device to test I2C reading/writing registers. But it failed with error code -5. What is meaning of error code -5 and how to fix this issue?

00> *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
00> Starting button Test example
00> device_is_ready() ok
00> nrfx_gpiote_input_configure() okay for button
00> val=1
00> button released
00> start a timer
00> now-1-11-30 0:0:0
00> 0
00> ledDriverInit
00> tca6424aReadReg(regAddr=0x0)
00> LP5861_REG_ADDR_HIGH(regAddr)=0x0, LP5861_REG_ADDR_LOW(regAddr)=0x0
00> devAddr=0x81, startAddr=0x0
00> [00:00:00.501,129] <err> i2c_nrfx_twim: Error on I2C line occurred for message 0
00> i2c_burst_read(0x0) failed, ret=-5
00> _buttonTimerHandler: 3000
00> now-1-11-30 0:0:0
00> button released

Procedures to reproduce this issue are as follows.

1. Unzipping custom_nrf52832.zip to C:\ncs\v2.4.2\nrf\boards folder.

2. Unzipping minimal_log_led.zip to C:\ncs\v2.4.2\nrf\samples folder.

3. cd C:\ncs\v2.4.2\nrf\samples\minimal_log_led

4. west build -b custom_nrf52832

5. west flash

6. Rebooting nRF52832 device and connecting to RTT Viewer.

Parents Reply
  • i2c1_default: i2c1_default {
    		group1 {
    			psels = <NRF_PSEL(TWIM_SDA, 1, 2)>,
    				<NRF_PSEL(TWIM_SCL, 1, 3)>;
    		};
    	};
    
    	i2c1_sleep: i2c1_sleep {
    		group1 {
    			psels = <NRF_PSEL(TWIM_SDA, 1, 2)>,
    				<NRF_PSEL(TWIM_SCL, 1, 3)>;
    			low-power-enable;
    		};
    	};
    	
    	&i2c1 {
    	compatible = "nordic,nrf-twim";
    	status = "okay";
    	clock-frequency = <I2C_BITRATE_STANDARD>;
    	pinctrl-0 = <&i2c1_default>;
    	pinctrl-1 = <&i2c1_sleep>;
    	pinctrl-names = "default", "sleep";
    };

Children
Related