Skip to content

mcp23017: failed test_app, I2C software timeout (AEGHB-1197) #568

@stkw0

Description

@stkw0

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

IDF version.

v5.5.0

Espressif SoC revision.

ESP32-P4

Operating System used.

Linux

How did you build your project?

Command line with idf.py

If you are using Windows, please specify command line type.

None

Development Kit.

Olimex esp32-p4-devkit

Power Supply used.

USB

What is the expected behavior?

Test program pass without errors

What is the actual behavior?

MCP23017 TEST
Running Device mcp23017 test, connect A-B port together...
I (88) i2c_bus: i2c0 bus inited
I (88) i2c_bus: I2C Bus V2 Config Succeed, Version: 1.1.0
E (289) i2c.master: I2C software timeout
E (289) i2c.master: s_i2c_synchronous_transaction(980): I2C transaction failed
E (289) i2c.master: i2c_master_transmit_receive(1283): I2C transaction failed
E (489) i2c.master: s_i2c_synchronous_transaction(980): I2C transaction failed
E (489) i2c.master: i2c_master_multi_buffer_transmit(1249): I2C transaction failed
E (689) i2c.master: I2C software timeout
E (689) i2c.master: s_i2c_synchronous_transaction(980): I2C transaction failed
E (689) i2c.master: i2c_master_transmit_receive(1283): I2C transaction failed
E (889) i2c.master: s_i2c_synchronous_transaction(980): I2C transaction failed
E (889) i2c.master: i2c_master_multi_buffer_transmit(1249): I2C transaction failed
./main/mcp23017_test.c:41:Device mcp23017 test, connect A-B port together:FAIL:Function [mcp23017][iot][device].  Expression Evaluated To FALSEMALLOC_CAP_8BIT: Before 602688 bytes free, After 601220 bytes free (delta -1468)

I (890) main_task: Returned from app_main()

Steps to reproduce.

  1. Create a project using the test_app found in the mcp23017 component
  2. Set I2C_MASTER_SCL_IO and I2C_MASTER_SDA_IO according to the board (in the Olimex devkit board it's GPIO_NUM_8 and GPIO_NUM_7 respectively)=
  3. Change unity_run_menu to unity_run_all_tests
  4. idf -p /dev/ttyACM0 flash monitor

Debug Logs.

Full run output:

--- esp-idf-monitor 1.7.0 on /dev/ttyACM0 115200
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H
ESP-ROM:esp32p4-eco2-20240710
Build:Jul 10 2024
rst:0x17 (CHIP_USB_UART_RESET),boot:0xf (SPI_FAST_FLASH_BOOT)
Core0 Saved PC:0x4ff038fa
--- 0x4ff038fa: esp_cpu_wait_for_intr at /usr/share/esp-idf/components/esp_hw_support/cpu.c:57
Core1 Saved PC:0x4ff038fa
--- 0x4ff038fa: esp_cpu_wait_for_intr at /usr/share/esp-idf/components/esp_hw_support/cpu.c:57
SPI mode:DIO, clock div:1
load:0x4ff33ce0,len:0x164c
load:0x4ff29ed0,len:0xd64
--- 0x4ff29ed0: esp_bootloader_get_description at /usr/share/esp-idf/components/esp_bootloader_format/esp_bootloader_desc.c:39
load:0x4ff2cbd0,len:0x3364
--- 0x4ff2cbd0: esp_flash_encryption_enabled at /usr/share/esp-idf/components/bootloader_support/src/flash_encrypt.c:89
entry 0x4ff29eda
--- 0x4ff29eda: call_start_cpu0 at /usr/share/esp-idf/components/bootloader/subproject/main/bootloader_start.c:25
I (8) boot: ESP-IDF v5.5 2nd stage bootloader
I (8) boot: compile time Aug 26 2025 12:21:17
I (9) boot: Multicore bootloader
I (10) boot: chip revision: v1.0
I (11) boot: efuse block revision: v0.3
I (11) boot.esp32p4: SPI Speed      : 80MHz
I (11) boot.esp32p4: SPI Mode       : DIO
I (12) boot.esp32p4: SPI Flash Size : 2MB
I (12) boot: Enabling RNG early entropy source...
I (13) boot: Partition Table:
I (13) boot: ## Label            Usage          Type ST Offset   Length
I (14) boot:  0 nvs              WiFi data        01 02 00009000 00006000
I (15) boot:  1 phy_init         RF data          01 01 0000f000 00001000
I (16) boot:  2 factory          factory app      00 00 00010000 00100000
I (17) boot: End of partition table
I (18) esp_image: segment 0: paddr=00010020 vaddr=40020020 size=0be98h ( 48792) map
I (27) esp_image: segment 1: paddr=0001bec0 vaddr=30100000 size=00044h (    68) load
I (28) esp_image: segment 2: paddr=0001bf0c vaddr=4ff00000 size=0410ch ( 16652) load
I (33) esp_image: segment 3: paddr=00020020 vaddr=40000020 size=1f134h (127284) map
I (52) esp_image: segment 4: paddr=0003f15c vaddr=4ff0410c size=0aaa8h ( 43688) load
I (61) esp_image: segment 5: paddr=00049c0c vaddr=4ff0ec00 size=01da4h (  7588) load
I (67) boot: Loaded app from partition at offset 0x10000
I (67) boot: Disabling RNG early entropy source...
I (69) cpu_start: Multicore app
I (78) cpu_start: Pro cpu start user code
I (78) cpu_start: cpu freq: 360000000 Hz
I (79) app_init: Application information:
I (79) app_init: Project name:     mcp23017_test
I (79) app_init: App version:      1
I (79) app_init: Compile time:     Aug 26 2025 12:21:12
I (80) app_init: ELF file SHA256:  7a8557ed0...
I (80) app_init: ESP-IDF:          v5.5
I (80) efuse_init: Min chip rev:     v0.1
I (80) efuse_init: Max chip rev:     v1.99
I (81) efuse_init: Chip rev:         v1.0
I (81) heap_init: Initializing. RAM available for dynamic allocation:
I (81) heap_init: At 4FF123E0 len 00028BE0 (162 KiB): RAM
I (82) heap_init: At 4FF3AFC0 len 00004BF0 (18 KiB): RAM
I (82) heap_init: At 4FF40000 len 00060000 (384 KiB): RAM
I (83) heap_init: At 50108080 len 00007F80 (31 KiB): RTCRAM
I (83) heap_init: At 30100044 len 00001FBC (7 KiB): TCM
W (84) spi_flash: winbond detected but related driver is not linked, please check option `SPI_FLASH_SUPPORT_WINBOND_CHIP`
I (85) spi_flash: detected chip: generic
I (85) spi_flash: flash io: dio
W (85) spi_flash: Detected size(16384k) larger than the size in the binary image header(2048k). Using the size in the binary image header.
I (86) main_task: Started on CPU0
I (87) main_task: Calling app_main()
MCP23017 TEST
Running Device mcp23017 test, connect A-B port together...
I (88) i2c_bus: i2c0 bus inited
I (88) i2c_bus: I2C Bus V2 Config Succeed, Version: 1.1.0
E (289) i2c.master: I2C software timeout
E (289) i2c.master: s_i2c_synchronous_transaction(980): I2C transaction failed
E (289) i2c.master: i2c_master_transmit_receive(1283): I2C transaction failed
E (489) i2c.master: s_i2c_synchronous_transaction(980): I2C transaction failed
E (489) i2c.master: i2c_master_multi_buffer_transmit(1249): I2C transaction failed
E (689) i2c.master: I2C software timeout
E (689) i2c.master: s_i2c_synchronous_transaction(980): I2C transaction failed
E (689) i2c.master: i2c_master_transmit_receive(1283): I2C transaction failed
E (889) i2c.master: s_i2c_synchronous_transaction(980): I2C transaction failed
E (889) i2c.master: i2c_master_multi_buffer_transmit(1249): I2C transaction failed
./main/mcp23017_test.c:41:Device mcp23017 test, connect A-B port together:FAIL:Function [mcp23017][iot][device].  Expression Evaluated To FALSEMALLOC_CAP_8BIT: Before 602688 bytes free, After 601220 bytes free (delta -1468)

I (890) main_task: Returned from app_main()

More Information.

Enabling the I2C backward option it doesn't seems to run or at least don't report anything, just:

I (108) i2c_bus: i2c0 bus inited
I (108) i2c_bus: I2C Bus Config Succeed, Version: 1.1.0
./main/mcp23017_test.c:41:Device mcp23017 test, connect A-B port together:FAIL:Function [mcp23017][iot][device].  Expression Evaluated To FALSEMALLOC_CAP_8BIT: Before 598144 bytes free, After 597664 bytes free (delta -480)

I (909) main_task: Returned from app_main()

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions