OLED 1306 on ESP32 with I2C

daemondong
Posts: 11
Joined: Fri Dec 24, 2021 7:20 am

OLED 1306 on ESP32 with I2C

Postby daemondong » Fri Dec 24, 2021 7:32 am

I'm working on the ESP32 with a OLED 1306 module. I built a simple code. When I monitored it I got the information as below. The information was showed again and again. What is wrong about my code?The code is attached.

Could anyone help me to figure it out? Thank you.

ets Jun 8 2016 00:22:57
rst:0xc (SW_CPU_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:6936
load:0x40078000,len:14308
load:0x40080400,len:3716
0x40080400: _init at ??:?

entry 0x40080680
I (27) boot: ESP-IDF v4.3.1 2nd stage bootloader
I (27) boot: compile time 10:46:59
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 : 2MB
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 (74) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (82) boot: 2 factory factory app 00 00 00010000 00100000
I (89) boot: End of partition table
I (94) boot_comm: chip revision: 1, min. application chip revision: 0
I (101) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=083cch ( 33740) map
I (121) esp_image: segment 1: paddr=000183f4 vaddr=3ffb0000 size=02910h ( 10512) load
I (126) esp_image: segment 2: paddr=0001ad0c vaddr=40080000 size=0530ch ( 21260) load
I (137) esp_image: segment 3: paddr=00020020 vaddr=400d0020 size=15718h ( 87832) map
I (169) esp_image: segment 4: paddr=00035740 vaddr=4008530c size=06cfch ( 27900) load
I (181) esp_image: segment 5: paddr=0003c444 vaddr=50000000 size=00010h ( 16) load
I (187) boot: Loaded app from partition at offset 0x10000
I (187) boot: Disabling RNG early entropy source...
I (201) cpu_start: Pro cpu up.
I (201) cpu_start: Starting app cpu, entry point is 0x40081108
0x40081108: call_start_cpu1 at D:/ESP32/esp-idf/components/esp_system/port/cpu_start.c:141

I (188) cpu_start: App cpu up.
I (215) cpu_start: Pro cpu start user code
I (215) cpu_start: cpu freq: 160000000
I (216) cpu_start: Application information:
I (220) cpu_start: Project name: main
I (225) cpu_start: App version: 1
I (229) cpu_start: Compile time: Dec 24 2021 10:46:48
I (235) cpu_start: ELF file SHA256: 549c9c173af2875a...
I (241) cpu_start: ESP-IDF: v4.3.1
I (246) heap_init: Initializing. RAM available for dynamic allocation:
I (253) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (259) heap_init: At 3FFB31E8 len 0002CE18 (179 KiB): DRAM
I (266) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (272) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (278) heap_init: At 4008C008 len 00013FF8 (79 KiB): IRAM
I (286) spi_flash: detected chip: generic
I (289) spi_flash: flash io: dio
W (293) spi_flash: Detected size(4096k) larger than the size in the binary image header(2048k). Using the size in the binary image header.
I (307) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (317) Main->: Initting...

I (317) I2C->: TASK Init.

I (327) Main->: OL�ets Jun 8 2016 00:22:57
Attachments
running_project.zip
(32.99 KiB) Downloaded 588 times

ESP_Sprite
Posts: 9764
Joined: Thu Nov 26, 2015 4:08 am

Re: OLED 1306 on ESP32 with I2C

Postby ESP_Sprite » Fri Dec 24, 2021 10:59 am

If any, GPIO1 is TxD, so after configuring that as your OLED reset, you won't be seeing any of the output that is sent. The actual crash likely is later, but with the log output 'cut off', we can't see what the issue is.

daemondong
Posts: 11
Joined: Fri Dec 24, 2021 7:20 am

Re: OLED 1306 on ESP32 with I2C

Postby daemondong » Fri Dec 24, 2021 11:41 am

Thanks for your reply.

I commented the line 7 in Display.c as below.
//#define RST_GPIO 1 //if need rst ping

I still got the same information the log was cut off at line 12 in Main.c.
"ESP_LOGI("Main->","OLED Initting...\n");".

ESP_Sprite
Posts: 9764
Joined: Thu Nov 26, 2015 4:08 am

Re: OLED 1306 on ESP32 with I2C

Postby ESP_Sprite » Sun Dec 26, 2021 3:13 am

I still think you're likely re-initializing some GPIO that is connected to the flash or your debug serial port, but I can't tell from your code which one (because you e.g. set them using LL_GPIO_SetOutputPin() which I can't seem to find anywhere).

daemondong
Posts: 11
Joined: Fri Dec 24, 2021 7:20 am

Re: OLED 1306 on ESP32 with I2C

Postby daemondong » Mon Dec 27, 2021 1:30 am

Thanks for your help. I cleaned my old code and it works well now.

Who is online

Users browsing this forum: Google [Bot] and 190 guests