nopnop2002 / esp-idf-ssd1306

SSD1306/SH1106 Driver for esp-idf
MIT License
264 stars 74 forks source link

Build and Flash are fine, getting 'i2c driver not installed' #13

Closed ShanmugaCA closed 2 years ago

ShanmugaCA commented 2 years ago

Hi, Thanks for your work! I could add the files, successfully build and flash into ESP32. The issue is while running, getting this error:

'/components/driver/i2c.c:1111 (i2c_master_cmd_begin):i2c driver not installed'

Any clue, where I am missing?

thanks!

Best regards Shanmuganathan

nopnop2002 commented 2 years ago

I changed the code a little.

Try latest.

ShanmugaCA commented 2 years ago

Hi! Thanks for your immediate attention and reply!

Updated the ssd1306_i2c.c file and no use, the error repeats.

The error says 'i2c driver not installed', the build and flash are fine. My understanding is that the code is flashing and that means there is no error in the build.

Please help,,,

Error message: :/esp-idf/components/driver/i2c.c:1111 (i2c_master_cmd_begin):i2c driver not installed

Best regards Shanmuganathan

nopnop2002 commented 2 years ago

Can you show me your screen copy? This is mine.

I (26) boot: ESP-IDF v4.4-dev-3573-gfb24a2941c 2nd stage bootloader
I (27) boot: compile time 13:31:30
I (27) boot: chip revision: 1
I (31) boot_comm: chip revision: 1, min. bootloader chip revision: 0
I (38) boot.esp32: SPI Speed      : 40MHz
I (43) boot.esp32: SPI Mode       : DIO
I (47) boot.esp32: SPI Flash Size : 2MB
I (52) boot: Enabling RNG early entropy source...
I (57) boot: Partition Table:
I (61) boot: ## Label            Usage          Type ST Offset   Length
I (68) boot:  0 nvs              WiFi data        01 02 00009000 00006000
I (76) boot:  1 phy_init         RF data          01 01 0000f000 00001000
I (83) boot:  2 factory          factory app      00 00 00010000 00100000
I (91) boot: End of partition table
I (95) boot_comm: chip revision: 1, min. application chip revision: 0
I (102) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=0a1ach ( 41388) map
I (125) esp_image: segment 1: paddr=0001a1d4 vaddr=3ffb0000 size=0280ch ( 10252) load
I (130) esp_image: segment 2: paddr=0001c9e8 vaddr=40080000 size=03630h ( 13872) load
I (137) esp_image: segment 3: paddr=00020020 vaddr=400d0020 size=18854h (100436) map
I (176) esp_image: segment 4: paddr=0003887c vaddr=40083630 size=094e8h ( 38120) load
I (192) esp_image: segment 5: paddr=00041d6c vaddr=50000000 size=00010h (    16) load
I (199) boot: Loaded app from partition at offset 0x10000
I (199) boot: Disabling RNG early entropy source...
I (212) cpu_start: Pro cpu up.
I (212) cpu_start: Starting app cpu, entry point is 0x40081128
0x40081128: call_start_cpu1 at /home/nop/esp-idf/components/esp_system/port/cpu_start.c:156

I (0) cpu_start: App cpu up.
I (226) cpu_start: Pro cpu start user code
I (226) cpu_start: cpu freq: 160000000
I (226) cpu_start: Application information:
I (231) cpu_start: Project name:     ssd1306
I (236) cpu_start: App version:      4178de7-dirty
I (241) cpu_start: Compile time:     Oct 24 2021 13:31:52
I (247) cpu_start: ELF file SHA256:  9fc9f51e07247c98...
I (253) cpu_start: ESP-IDF:          v4.4-dev-3573-gfb24a2941c
I (260) heap_init: Initializing. RAM available for dynamic allocation:
I (267) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (273) heap_init: At 3FFB30F8 len 0002CF08 (179 KiB): DRAM
I (279) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (286) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (292) heap_init: At 4008CB18 len 000134E8 (77 KiB): IRAM
I (299) spi_flash: detected chip: generic
I (303) spi_flash: flash io: dio
W (307) spi_flash: Detected size(4096k) larger than the size in the binary image header(2048k). Using the size in the binary image header.
I (321) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (331) SSD1306: INTERFACE is i2c
I (331) SSD1306: CONFIG_SDA_GPIO=21
I (341) SSD1306: CONFIG_SCL_GPIO=22
I (341) SSD1306: CONFIG_RESET_GPIO=-1
I (351) SSD1306: Panel is 128x64
I (351) SSD1306: OLED configured successfully
ShanmugaCA commented 2 years ago

Hi!

Please find the screen copy below, thanks!

Best regards Shanmuganathan

++++++++ entry 0x400806f4 I (27) boot: ESP-IDF v4.2.2-dirty 2nd stage bootloader I (27) boot: compile time 20:29:47 I (27) boot: chip revision: 1 I (30) boot_comm: chip revision: 1, min. bootloader chip revision: 0 I (37) boot.esp32: SPI Speed : 40MHz I (42) boot.esp32: SPI Mode : DIO I (46) boot.esp32: SPI Flash Size : 4MB I (51) boot: Enabling RNG early entropy source... I (56) boot: Partition Table: I (60) boot: ## Label Usage Type ST Offset Length I (67) boot: 0 nvs WiFi data 01 02 00009000 00006000 I (75) boot: 1 phy_init RF data 01 01 0000f000 00001000 I (82) boot: 2 factory factory app 00 00 00010000 00100000 I (90) boot: End of partition table I (94) boot_comm: chip revision: 1, min. application chip revision: 0 I (101) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x1fbfc (130044) map I (159) esp_image: segment 1: paddr=0x0002fc24 vaddr=0x3ffb0000 size=0x003f4 ( 1012) load I (160) esp_image: segment 2: paddr=0x00030020 vaddr=0x400d0020 size=0x91b14 (596756) map 0x400d0020: _stext at ??:?

I (393) esp_image: segment 3: paddr=0x000c1b3c vaddr=0x3ffb03f4 size=0x02eb0 ( 11952) load I (398) esp_image: segment 4: paddr=0x000c49f4 vaddr=0x40080000 size=0x16fc0 ( 94144) load 0x40080000: _WindowOverflow4 at D:/esp-idf/components/freertos/xtensa/xtensa_vectors.S:1730

I (453) boot: Loaded app from partition at offset 0x10000 I (454) boot: Disabling RNG early entropy source... I (454) cpu_start: Pro cpu up. I (458) cpu_start: Application information: I (462) cpu_start: Project name: disp I (468) cpu_start: App version: 1 I (472) cpu_start: Compile time: Oct 25 2021 20:29:38 I (478) cpu_start: ELF file SHA256: db6dcfb3a2ae9e31... I (484) cpu_start: ESP-IDF: v4.2.2-dirty I (489) cpu_start: Starting app cpu, entry point is 0x400819e8 0x400819e8: call_start_cpu1 at D:/esp-idf/components/esp32/cpu_start.c:287

I (0) cpu_start: App cpu up. I (500) heap_init: Initializing. RAM available for dynamic allocation: I (507) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM I (513) heap_init: At 3FFB79C8 len 00028638 (161 KiB): DRAM I (519) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM I (525) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM I (532) heap_init: At 40096FC0 len 00009040 (36 KiB): IRAM I (538) cpu_start: Pro cpu start user code I (556) spi_flash: detected chip: gd I (557) spi_flash: flash io: dio I (557) cpu_start: Starting scheduler on PRO CPU. I (0) cpu_start: Starting scheduler on APP CPU.

I (575) TEST_EXAMPLE: [APP] IDF version: v4.2.2-dirty I (625) wifi:wifi driver task: 3ffbfffc, prio:23, stack:6656, core=0 I (625) system_api: Base MAC address is not set I (625) system_api: read default base MAC address from EFUSE I (645) wifi:wifi firmware version: bb6888c I (645) wifi:wifi certification version: v7.0 I (645) wifi:config NVS flash: enabled I (645) wifi:config nano formating: disabled I (655) wifi:Init data frame dynamic rx buffer num: 32 I (655) wifi:Init management frame dynamic rx buffer num: 32 I (665) wifi:Init management short buffer num: 32 I (665) wifi:Init dynamic tx buffer num: 32 I (675) wifi:Init static rx buffer size: 1600 I (675) wifi:Init static rx buffer num: 10 I (675) wifi:Init dynamic rx buffer num: 32 I (685) wifi_init: rx ba win: 6 I (685) wifi_init: tcpip mbox: 32 I (685) wifi_init: udp mbox: 6 I (695) wifi_init: tcp mbox: 6 I (695) wifi_init: tcp tx win: 5744 I (705) wifi_init: tcp rx win: 5744 I (705) wifi_init: tcp mss: 1440 I (705) wifi_init: WiFi IRAM OP enabled I (715) wifi_init: WiFi RX IRAM OP enabled I (715) example_connect: Connecting to CAS_H... I (725) phy_init: phy_version 4660,0162888,Dec 23 2020 I (825) wifi:mode : sta (30:ae:a4:19:63:58) I (825) example_connect: Waiting for IP(s) I (1805) wifi:new:<8,1>, old:<1,0>, ap:<255,255>, sta:<8,1>, prof:1 I (2575) wifi:state: init -> auth (b0) I (2585) wifi:state: auth -> assoc (0) I (2595) wifi:state: assoc -> run (10)

I (2695) wifi:pm start, type: 1

I (2715) wifi:AP's beacon interval = 102400 us, DTIM period = 1 I (4615) example_connect: Got IPv6 event: Interface "example_connect: sta" address: fe80:0000:0000:0000:32ae:a4ff:fe19:6358, type: ESP_IP6_ADDR_IS_LINK_LOCAL I (5615) esp_netif_handlers: example_connect: sta ip: 192.168.1.6, mask: 255.255.255.0, gw: 192.168.1.1 I (5615) example_connect: Got IPv4 event: Interface "example_connect: sta" address: 192.168.1.6 I (5625) example_connect: Connected to example_connect: sta I (5625) example_connect: - IPv4 address: 192.168.1.x I (5635) example_connect: - IPv6 address: xxxx:0000:0000:0000:1111:2222:fe19:xxxx, type: ESP_IP6_ADDR_IS_LINK_LOCAL I (5645) TEST_EXAMPLE: Other event id:7 I (5645) gpio: GPIO[4]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 0| Pulldown: 1| Intr:5 I (5655) gpio: GPIO[15]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 0| Pulldown: 1| Intr:5 I (5665) SSD1306: Panel is 128x32 E (5675) i2c: D:/esp-idf/components/driver/i2c.c:1111 (i2c_master_cmd_begin):i2c driver not installed E (5685) SSD1306: OLED configuration failed. code: 0x103 E (5685) i2c: D:/esp-idf/components/driver/i2c.c:1111 (i2c_master_cmd_begin):i2c driver not installed E (5695) i2c: D:/esp-idf/components/driver/i2c.c:1111 (i2c_master_cmd_begin):i2c driver not installed E (5705) i2c: D:/esp-idf/components/driver/i2c.c:1111 (i2c_master_cmd_begin):i2c driver not installed E (5715) i2c: D:/esp-idf/components/driver/i2c.c:1111 (i2c_master_cmd_begin):i2c driver not installed E (5725) i2c: D:/esp-idf/components/driver/i2c.c:1111 (i2c_master_cmd_begin):i2c driver not installed E (5735) i2c: D:/esp-idf/components/driver/i2c.c:1111 (i2c_master_cmd_begin):i2c driver not installed E (5745) i2c: D:/esp-idf/components/driver/i2c.c:1111 (i2c_master_cmd_begin):i2c driver not installed E (5755) i2c: D:/esp-idf/components/driver/i2c.c:1111 (i2c_master_cmd_begin):i2c driver not installed E (5765) i2c: D:/esp-idf/components/driver/i2c.c:1111 (i2c_master_cmd_begin):i2c driver not installed E (5775) i2c: D:/esp-idf/components/driver/i2c.c:1111 (i2c_master_cmd_begin):i2c driver not installed E (5785) i2c: D:/esp-idf/components/driver/i2c.c:1111 (i2c_master_cmd_begin):i2c driver not installed E (5795) i2c: D:/esp-idf/components/driver/i2c.c:1111 (i2c_master_cmd_begin):i2c driver not installed E (5805) i2c: D:/esp-idf/components/driver/i2c.c:1111 (i2c_master_cmd_begin):i2c driver not installed E (5815) i2c: D:/esp-idf/components/driver/i2c.c:1111 (i2c_master_cmd_begin):i2c driver not installed ++++++++

nopnop2002 commented 2 years ago

You don't have this output.

I (331) SSD1306: INTERFACE is i2c
I (331) SSD1306: CONFIG_SDA_GPIO=21
I (341) SSD1306: CONFIG_SCL_GPIO=22
I (341) SSD1306: CONFIG_RESET_GPIO=-1
I (351) SSD1306: Panel is 128x64
I (351) SSD1306: OLED configured successfully

Probably this file is missing or wrong. https://github.com/nopnop2002/esp-idf-ssd1306/blob/master/main/Kconfig.projbuild

Copy this file to your project. $rm sdkconfig $make menuconfig

You have to set this config value with menuconfig.

CONFIG_INTERFACE CONFIG_PANEL CONFIG_OFFSETX CONFIG_FLIP CONFIG_SDA_GPIO CONFIG_SCL_GPIO CONFIG_RESET_GPIO CONFIG_MOSI_GPIO CONFIG_SCLK_GPIO CONFIG_CS_GPIO CONFIG_DC_GPIO

101276030-7387f980-37ed-11eb-85af-3babe939f0a1

$idf.py flash monitor

ShanmugaCA commented 2 years ago

Hi! Thanks much! Appreciate your immediate replies and it worked!!!

You did an excellent work! :)

Please close this issue.

Best regards, Shanmuganathan

Leaving debug output below so that I may help some one else later,

++++++++++ I (5147) gpio: GPIO[4]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 0| Pulldown: 1| Intr:5 I (5157) gpio: GPIO[15]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 0| Pulldown: 1| Intr:5 I (5167) SSD1306: INTERFACE is i2c I (5177) SSD1306: CONFIG_SDA_GPIO=33 I (5177) SSD1306: CONFIG_SCL_GPIO=32 I (5177) SSD1306: CONFIG_RESET_GPIO=4 I (5187) gpio: GPIO[4]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 I (5247) SSD1306: Panel is 128x64 I (5247) SSD1306: OLED configured successfully I (5247) SSD1306: Panel is 128x32 I (5247) SSD1306: OLED configured successfully ++++++++++