Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firmware does not find BQ27546? #3

Open
ConiKost opened this issue Jan 14, 2025 · 2 comments
Open

Firmware does not find BQ27546? #3

ConiKost opened this issue Jan 14, 2025 · 2 comments

Comments

@ConiKost
Copy link

ConiKost commented Jan 14, 2025

Since I placed an order on JLCPCB for something else, I also did order two assembled Blinkekatze PCBs (with BOM as intended) for some fun.

Can I run a test without connected switch board? My switchboard seems to have only five wires, not six.

It looks like, that flashing the firmware, it does not find the BQ27546? Could be those PCBs or parts faulty? I have not enabled flashing ti battery gauge. Or could be no firmware flashed at all on the BQ27546, so it's not detected? Is there any cheaper alternative to EV2400, if this could be the case?

Monitor indicates some crashing:

Executing action: monitor
Running idf_monitor in directory /home/xxx/Downloads/blinkekatze-firmware
Executing "/root/.espressif/python_env/idf5.1_py3.10_env/bin/python /home/xxx/Downloads/blinkekatze-firmware/esp-idf/tools/idf_monitor.py -p /dev/ttyACM0 -b 115200 --toolchain-prefix riscv32-esp-elf- --target esp32c3 --revision 4 --decode-panic backtrace /home/xxx/Downloads/blinkekatze-firmware/build/blinkekatze.elf -m '/root/.espressif/python_env/idf5.1_py3.10_env/bin/python' '/home/xxx/Downloads/blinkekatze-firmware/esp-idf/tools/idf.py' '-p' '/dev/ttyACM0'"...
--- esp-idf-monitor 1.5.0 on /dev/ttyACM0 115200
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H
 (31ESP-ROM:esp32c3-api1-20210207
Build:Feb  7 2021
rst:0x15 (USB_UART_CHIP_RESET),boot:0x9 (SPI_FAST_FLASH_BOOT)
Saved PC:0x4004c0d4
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd5820,len:0x1704
load:0x403cc710,len:0x938
load:0x403ce710,len:0x2ef4
entry 0x403cc710
I (24) boot: ESP-IDF v5.1.5 2nd stage bootloader
I (24) boot: compile time Jan 14 2025 13:31:15
I (25) boot: chip revision: v0.4
I (27) boot.esp32c3: SPI Speed      : 80MHz
I (32) boot.esp32c3: SPI Mode       : DIO
I (37) boot.esp32c3: SPI Flash Size : 4MB
I (42) boot: Enabling RNG early entropy source...
I (47) boot: Partition Table:
I (51) boot: ## Label            Usage          Type ST Offset   Length
I (58) boot:  0 phy_init         RF data          01 01 00009000 00001000
I (65) boot:  1 otadata          OTA data         01 00 0000a000 00002000
I (73) boot:  2 nvs              WiFi data        01 02 0000c000 00004000
I (80) boot:  3 factory          factory app      00 00 00010000 00150000
I (88) boot:  4 ota_0            OTA app          00 10 00160000 00150000
I (95) boot:  5 ota_1            OTA app          00 11 002b0000 00150000
I (103) boot: End of partition table
I (107) boot: Defaulting to factory image
I (112) esp_image: segment 0: paddr=00010020 vaddr=3c090020 size=2a528h (173352) map
I (148) esp_image: segment 1: paddr=0003a550 vaddr=3fc92e00 size=02b04h ( 11012) load
I (150) esp_image: segment 2: paddr=0003d05c vaddr=40380000 size=02fbch ( 12220) load
I (156) esp_image: segment 3: paddr=00040020 vaddr=42000020 size=8a970h (567664) map
I (252) esp_image: segment 4: paddr=000ca998 vaddr=40382fbc size=0fc98h ( 64664) load
I (271) boot: Loaded app from partition at offset 0x10000
I (271) boot: Disabling RNG early entropy source...
I (271) cpu_start: Unicore app
I (275) cpu_start: Pro cpu up.
I (290) cpu_start: Pro cpu start user code
I (290) cpu_start: cpu freq: 160000000 Hz
I (290) cpu_start: Application information:
I (293) cpu_start: Project name:     blinkekatze
I (299) cpu_start: App version:      fcac468-dirty
I (304) cpu_start: Compile time:     Jan 14 2025 13:31:08
I (310) cpu_start: ELF file SHA256:  40c822aebe1f46a8...
I (316) cpu_start: ESP-IDF:          v5.1.5
I (321) cpu_start: Min chip rev:     v0.4
I (326) cpu_start: Max chip rev:     v1.99 
I (331) cpu_start: Chip rev:         v0.4
I (335) heap_init: Initializing. RAM available for dynamic allocation:
I (343) heap_init: At 3FC9BAE0 len 00024520 (145 KiB): DRAM
I (349) heap_init: At 3FCC0000 len 0001C710 (113 KiB): DRAM/RETENTION
I (356) heap_init: At 3FCDC710 len 00002950 (10 KiB): DRAM/RETENTION/STACK
I (363) heap_init: At 50000010 len 00001FD8 (7 KiB): RTCRAM
I (370) spi_flash: detected chip: generic
I  (374) spi_flash: flash io: dio
I (379) sleep: Configure to isolate all GPIO pins in sleep state
I (385) sleep: Enable automatic switching of GPIO sleep configuration
I (392) app_start: Starting scheduler on CPU0
I (397) main_task: Started on CPU0
I (397) main_task: Calling app_main()
I (397) gpio: GPIO[0]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (397) gpio: GPIO[2]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
E (497) I2C_BUS: I2C bus timeout, trying to unstick bus
I (497) gpio: GPIO[0]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (497) gpio: GPIO[2]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
E (497) BQ27546: Failed to read gauge id: 263
E (597) I2C_BUS: I2C bus timeout, trying to unstick bus
I (597) gpio: GPIO[8]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (597) gpio: GPIO[2]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
E (597) BQ27546: Failed to read gauge id: 263
ESP_ERROR_CHECK failed: esp_err_t 0x107 (ESP_ERR_TIMEOUT) at 0x420062a2
--- 0x420062a2: app_main at /home/xxx/Downloads/blinkekatze-firmware/main/src/main.c:267 (discriminator 1)

file: "./main/src/main.c" line 233
func: app_main
expression: bq27546_init(&gauge, &i2c_bus)

abort() was called at PC 0x403871dd on core 0
--- 0x403871dd: _esp_error_check_failed at /home/xxx/Downloads/blinkekatze-firmware/esp-idf/components/esp_system/esp_err.c:50

--- Stack dump detected
Core  0 register dump:
MEPC    : 0x40380694  RA      : 0x403871e8  SP      : 0x3fc9df20  GP      : 0x3fc93600  
--- 0x40380694: panic_abort at /home/xxx/Downloads/blinkekatze-firmware/esp-idf/components/esp_system/panic.c:466
0x403871e8: __ubsan_include at /home/xxx/Downloads/blinkekatze-firmware/esp-idf/components/esp_system/ubsan.c:313

TP      : 0x3fc747c8  T0      : 0x37363534  T1      : 0x7271706f  T2      : 0x33323130  
S0/FP   : 0x3fc9df5c  S1      : 0x3fc9df40  A0      : 0x3fc9df5c  A1      : 0x3fc9df3e  
A2      : 0x00000000  A3      : 0x3fc9df89  A4      : 0x00000001  A5      : 0x3fc9b000  
A6      : 0x7a797877  A7      : 0x76757473  S2      : 0x00000000  S3      : 0x3fc9b000  
S4      : 0x00000000  S5      : 0x00000000  S6      : 0x00000000  S7      : 0x00000000  
S8      : 0x00000000  S9      : 0x00000000  S10     : 0x3fc9b000  S11     : 0x00000000  
T3      : 0x6e6d6c6b  T4      : 0x6a696867  T5      : 0x66656463  T6      : 0x62613938  
MSTATUS : 0x00001801  MTVEC   : 0x40380001  MCAUSE  : 0x00000007  MTVAL   : 0x00000000  
--- 0x40380001: _vector_table at ??:?

MHARTID : 0x00000000  


--- Backtrace:


panic_abort (details=details@entry=0x3fc9df5c "abort() was called at PC 0x403871dd on core 0") at /home/xxx/Downloads/blinkekatze-firmware/esp-idf/components/esp_system/panic.c:466
466	    *((volatile int *) 0) = 0; // NOLINT(clang-analyzer-core.NullDereference) should be an invalid operation on targets
#0  panic_abort (details=details@entry=0x3fc9df5c "abort() was called at PC 0x403871dd on core 0") at /home/xxx/Downloads/blinkekatze-firmware/esp-idf/components/esp_system/panic.c:466
#1  0x403871e8 in esp_system_abort (details=details@entry=0x3fc9df5c "abort() was called at PC 0x403871dd on core 0") at /home/xxx/Downloads/blinkekatze-firmware/esp-idf/components/esp_system/port/esp_system_chip.c:84
#2  0x4038df64 in abort () at /home/xxx/Downloads/blinkekatze-firmware/esp-idf/components/newlib/abort.c:38
#3  0x403871e0 in _esp_error_check_failed (rc=<optimized out>, file=<optimized out>, line=<optimized out>, function=<optimized out>, expression=<optimized out>) at /home/xxx/Downloads/blinkekatze-firmware/esp-idf/components/esp_system/esp_err.c:50
#4  0x420062a6 in app_main () at /home/xxx/Downloads/blinkekatze-firmware/main/src/main.c:267
#5  0x00000000 in ?? ()
Backtrace stopped: frame did not save the PC
@ConiKost
Copy link
Author

ConiKost commented Jan 14, 2025

I did a small test and disabled step by step ESP_ERROR_CHECK. After everything disable, the ESP-C3 boots to shell. But it looks like, that nothing is on the i2c bus? So both faulty produced and assembled PCB by JLCPCB?

@ConiKost
Copy link
Author

ConiKost commented Feb 6, 2025

@TobleMiner any idea on that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant