gtxaspec / wz_flash-helper

Firmware flash tool for Wyze cameras
9 stars 1 forks source link

no sdcard reader and no wifi after flashing OpenIPC / thingino #15

Closed mega3st closed 3 months ago

mega3st commented 6 months ago

I flashed my Wyze v3 (T31x) via wz_flash-helper with:

The camera was booting but the sdcard reader and the wifi wasn’t working.

I thought setting the wlanssid wlanpass via setenv and saveenv would fix the wifi issue but unfortunately didn’t.

So I decided to flash a thingino firmware build from @themactep repo.

As both the sdcard reader and the wifi both weren’t working I actually did this by quickly desoldering the GD25B128C chip and flashing the file directly via CH341A. This worked perfectly fine but the sdcard reader and wifi still weren’t working. I assumed the problems exist due to missing or wrong configured GPIO settings and since @archandanime wrote here that the "SD card detect pin" should be set to 62 the first thing I tried was:

setenv gpio_mmc_cd 62 saveenv

This didn’t fix the sdcard reader problem so I took a closer look at the serial output and saw:

GPIO: gpio_mmc_power: No GPIO env settings provided

Unfortunatly I couldn’t find any information regarding the correct setting for this or even better for all GPIOs on wyze v3. Can anyone give me some information on this?

Here is also the full boot output:

Ingenic U-Boot 2013.07-gd350136 (Feb 22 2024 - 08:08:52)

Platform: ISVP (Ingenic XBurst1)
Built profile: T31X
SOC Name: T31ZX
DRAM:  128 MiB

Top of RAM usable for U-Boot at: 84000000
Reserving 689k for U-Boot at: 83f50000
Reserving 32832k for malloc() at: 81f40000
Reserving 32 Bytes for Board Info at: 81f3ffe0
Reserving 124 Bytes for Global Data at: 81f3ff64
Reserving 256k for boot params() at: 81efff64
Stack Pointer at: 81efff48
Now running in RAM - U-Boot at: 83f50000

MMC:   msc: 0
SF:    Vendor: c8
SF:    Detected GD25Q128
Net:   HW Ethernet address: A6:C5:FA:E3:1B:83
In:    serial
Out:   serial
Err:   serial
KEY:   Reset button undefined
GPIO:  Loading gpio_default
GPIO:  25 set to input
GPIO:  25 input pull-down disabled
GPIO:  26 set to input
GPIO:  26 input pull-up disabled
GPIO:  26 input pull-down disabled
ETH:   Searching for valid PHY
ETH:   Error: Invalid PHY configuration.
ETH:   PHY not found!
GPIO:  gpio_default_net: No GPIO env settings provided
GPIO:  gpio_mmc_power: No GPIO env settings provided
GPIO:  Loading gpio_ircut
GPIO:  52 set to input
GPIO:  53 set to input
GPIO:  49 set to input
GPIO:  50 set to input
GPIO:  57 set to input
GPIO:  58 set to input
GPIO:  gpio_user: No GPIO env settings provided
GPIO:  gpio_motor_v: No GPIO env settings provided
GPIO:  gpio_motor_h: No GPIO env settings provided
MMC:   Checking for autoupdate files...
MMC:   Checking for kernel image from MMC...
reading factory_t31_kernel
reading factory_t31_ZMC6tiIDQN
reading factory_ZMC6tiIDQN
MMC:   Kernel file not found.
MMC:   Checking for for boot / env files...
** Bad device mmc 0 **
** Bad device mmc 0 **
KEY:   ###### Press Ctrl-C now to interrupt boot... loading in 3s ######
SF:    Vendor: c8
SF:    Detected GD25Q128
SF:    probe command completed in 4ms
SQ:    SquashFS found at 0x1E0000
SF:    1638400 bytes @ 0x50000 Read: OK
SF:    read command completed in 528ms
###### Booting kernel from Legacy Image at 0x80600000 ######
   Image Name:   Linux-3.10.14__isvp_swan_1.0__-t
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    1631650 Bytes = 1.6 MiB
   Load Address: 80010000
   Entry Point:  803821a0
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK

Starting kernel ...
gtxaspec commented 6 months ago

gpio_mmc_power should be set to 48o

We will update the thingino wiki in a bit with some gpio settings.

mega3st commented 6 months ago

@gtxaspec thanks a lot!

setenv gpio_mmc_power 48o
saveenv

Did the trick with the sdcard reader.

But I still struggle with the wifi, any ideas?

Due to this line from the kernel

Starting wireless: No endpoint /sys/devices/platform/jzmmc_v1.2.1/present

I guess there should be some content in jzmmc_v1.2.1 but the folder is completely empty.

Here is also the full kernel output:

[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Initializing cgroup subsys cpuacct
[    0.000000] Linux version 3.10.14__isvp_swan_1.0__ (buildroot@buildroot) (buildroot-gcc-13.2.0) #1 PREEMPT Sun Feb 18 19:49:57 UTC 2024
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 RESET ERROR PC:83F50648
[    0.000000] CPU0 revision is: 00d00100 (Ingenic Xburst)
[    0.000000] FPU revision is: 00b70000
[    0.000000] CCLK:1392MHz L2CLK:696Mhz H0CLK:200MHz H2CLK:200Mhz PCLK:100Mhz
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 004a9000 @ 00010000 (usable)
[    0.000000]  memory: 00037000 @ 004b9000 (usable after init)
[    0.000000] User-defined physical RAM map:
[    0.000000]  memory: 06300000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x00000000-0x062fffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x00000000-0x062fffff]
[    0.000000] Primary instruction cache 32kB, 8-way, VIPT, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 8-way, VIPT, no aliases, linesize 32 bytes
[    0.000000] pls check processor_id[0x00d00100],sc_jz not support!
[    0.000000] MIPS secondary cache 128kB, 8-way, linesize 32 bytes.
[    0.000000] Built 1 zonelists in Zone order, mobility grouping off.  Total pages: 25146
[    0.000000] Kernel command line: mem=99M@0x0 rmem=29M@0x6300000 console=ttyS1,115200n8 panic=10 root=/dev/mtdblock3 rootfstype=squashfs init=/init mtdparts=jz_sfc:256k(boot),64k(env),1600k(kernel),5472k(rootfs),-(rootfs_data)
[    0.000000] PID hash table entries: 512 (order: -1, 2048 bytes)
[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Memory: 94752k/101376k available (3571k kernel code, 6624k reserved, 1197k data, 220k init, 0k highmem)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] Preemptible hierarchical RCU implementation.
[    0.000000] NR_IRQS:358
[    0.000000] clockevents_config_and_register success.
[    0.000014] Calibrating delay loop... 1391.00 BogoMIPS (lpj=6955008)
[    0.087832] pid_max: default: 32768 minimum: 301
[    0.092689] Mount-cache hash table entries: 512
[    0.097596] Initializing cgroup subsys debug
[    0.101852] Initializing cgroup subsys freezer
[    0.107854] devtmpfs: initialized
[    0.112604] regulator-dummy: no parameters
[    0.116975] NET: Registered protocol family 16
[    0.143109] bio: create slab <bio-0> at 0
[    0.153048] jz-dma jz-dma: JZ SoC DMA initialized
[    0.159334] usbcore: registered new interface driver usbfs
[    0.164990] usbcore: registered new interface driver hub
[    0.170816] usbcore: registered new device driver usb
[    0.176368]  (null): set:249  hold:250 dev=100000000 h=500 l=500
[    0.184596] cfg80211: Calling CRDA to update world regulatory domain
[    0.191110] Switching to clocksource jz_clocksource
[    0.198506] jz-dwc2 jz-dwc2: cgu clk gate get error
[    0.203386] DWC IN OTG MODE
[    0.207150] dwc2 dwc2: Keep PHY ON
[    0.210518] dwc2 dwc2: Using Buffer DMA mode
[    0.214846] dwc2 dwc2: Core Release: 3.00a
[    0.219112] dwc2 dwc2: DesignWare USB2.0 High-Speed Host Controller
[    0.225403] dwc2 dwc2: new USB bus registered, assigned bus number 1
[    0.232825] hub 1-0:1.0: USB hub found
[    0.236778] hub 1-0:1.0: 1 port detected
[    0.240782] dwc2 dwc2: DWC2 Host Initialized
[    0.245316] NET: Registered protocol family 2
[    0.250176] TCP established hash table entries: 1024 (order: 1, 8192 bytes)
[    0.257236] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.263621] TCP: Hash tables configured (established 1024 bind 1024)
[    0.270130] TCP: reno registered
[    0.273324] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.279288] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.285779] NET: Registered protocol family 1
[    0.290384] RPC: Registered named UNIX socket transport module.
[    0.296364] RPC: Registered udp transport module.
[    0.301080] RPC: Registered tcp transport module.
[    0.305847] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.313012] freq_udelay_jiffys[0].max_num = 10
[    0.317521] cpufreq  udelay  loops_per_jiffy
[    0.321862] dwc2 dwc2: ID PIN CHANGED!
[    0.325688] 12000     59956   59956
[    0.328942] 24000     119913  119913
[    0.332361] 60000     299784  299784
[    0.335804] 120000    599569  599569
[    0.339449] 200000    999282  999282
[    0.342901] 300000    1498924         1498924
[    0.346693] 600000    2997848         2997848
[    0.350321] 792000    3957159         3957159
[    0.354029] 1008000   5036385         5036385
[    0.357846] 1200000   5995696         5995696
[    0.371412] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.378549] jffs2: version 2.2. © 2001-2006 Red Hat, Inc.
[    0.384606] msgmni has been set to 185
[    0.389311] io scheduler noop registered
[    0.393230] io scheduler cfq registered (default)
[    0.405188] jz-uart.1: ttyS1 at MMIO 0x10031000 (irq = 58) is a uart1
[    0.412849] console [ttyS1] enabled, bootconsole disabled
[    0.412849] console [ttyS1] enabled, bootconsole disabled
[    0.432564] brd: module loaded
[    0.440114] loop: module loaded
[    0.443568] logger: created 256K log 'log_main'
[    0.450428] jz TCU driver register completed
[    0.455762] the id code = c84018, the flash name is GD25Q127C
[    0.461923] JZ SFC Controller for SFC channel 0 driver register
[    0.468186] 5 cmdlinepart partitions found on MTD device jz_sfc
[    0.474284] Creating 5 MTD partitions on "jz_sfc":
[    0.479264] 0x000000000000-0x000000040000 : "boot"
[    0.485230] 0x000000040000-0x000000050000 : "env"
[    0.491208] 0x000000050000-0x0000001e0000 : "kernel"
[    0.497489] 0x0000001e0000-0x000000738000 : "rootfs"
[    0.503627] 0x000000738000-0x000001000000 : "rootfs_data"
[    0.510294] SPI NOR MTD LOAD OK
[    0.513746] Bus Mode Reg after reset: 0x00020101, cnt=0
[    0.520210] Bus Mode Reg after reset: 0x00020101, cnt=1
[    0.526741] Bus Mode Reg after reset: 0x00020101, cnt=2
[    0.533112] Bus Mode Reg after reset: 0x00020101, cnt=3
[    0.539518] Bus Mode Reg after reset: 0x00020101, cnt=4
[    0.545892] Bus Mode Reg after reset: 0x00020101, cnt=5
[    0.552297] Bus Mode Reg after reset: 0x00020101, cnt=6
[    0.558676] Bus Mode Reg after reset: 0x00020101, cnt=7
[    0.565044] Bus Mode Reg after reset: 0x00020101, cnt=8
[    0.571420] Bus Mode Reg after reset: 0x00020101, cnt=9
[    0.577796] func:jz_mii_bus_probe, synopGMAC_reset failed
[    0.583359] jz_mii_bus: probe of jz_mii_bus.0 failed with error -1
[    0.589907] =======>gmacdev = 0x8427f880<================
[    0.595462] =========>gmacdev->MacBase = 0xb34b0000 DmaBase = 0xb34b1000
[    0.602425] Bus Mode Reg after reset: 0x00020101, cnt=0
[    0.608824] Bus Mode Reg after reset: 0x00020101, cnt=1
[    0.615198] Bus Mode Reg after reset: 0x00020101, cnt=2
[    0.621593] Bus Mode Reg after reset: 0x00020101, cnt=3
[    0.627992] Bus Mode Reg after reset: 0x00020101, cnt=4
[    0.634362] Bus Mode Reg after reset: 0x00020101, cnt=5
[    0.640741] Bus Mode Reg after reset: 0x00020101, cnt=6
[    0.647128] Bus Mode Reg after reset: 0x00020101, cnt=7
[    0.653505] Bus Mode Reg after reset: 0x00020101, cnt=8
[    0.659900] Bus Mode Reg after reset: 0x00020101, cnt=9
[    0.666284] func:jz_mac_probe, synopGMAC_reset failed
[    0.671483] jz_mac: probe of jz_mac.0 failed with error -1
[    0.677428] usbcore: registered new interface driver asix
[    0.683007] i2c /dev entries driver
[    0.687507] jz-wdt: watchdog initialized
[    0.692135] ipip: IPv4 over IPv4 tunneling driver
[    0.697639] TCP: cubic registered
[    0.702093] NET: Registered protocol family 10
[    0.707463] NET: Registered protocol family 17
[    0.713244] input: gpio-keys as /devices/platform/gpio-keys/input/input0
[    0.720771] drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
[    0.730916] VFS: Mounted root (squashfs filesystem) readonly on device 31:3.
[    0.741676] devtmpfs: mounted
[    0.745030] Freeing unused kernel memory: 220K (804b9000 - 804f0000)
[    1.180408] jffs2: notice: (448) jffs2_build_xattr_subsystem: complete building xattr subsystem, 2 of xdatum (0 unchecked, 1 orphan) and 2 of xref (0 dead, 1 orphan) found.
Sun Feb 18 19:49:57 GMT 2024
Seeding 2048 bits and crediting
Saving 2048 bits of creditable seed for next boot
Starting syslogd: OK
Starting Timezone: Using system default
Running sysctl: OK
Starting GPIO: GPIO configuration file not found!
Starting ircut: OK
Starting MMC: modprobe: can't load module jzmmc_v12 (kernel/drivers/mmc/host/jzmmc_v12.ko): Invalid argument
FAIL
Starting motor: DISABLED
Loading modules: OK
Starting rngd: OK
Starting mdev: OK
Starting wireless: No endpoint /sys/devices/platform/jzmmc_v1.2.1/present
Failed to initialize SDIO device
Starting wpa_supplicant: OK
Starting network...
ip: SIOCGIFINDEX: No such device
ip: SIOCGIFFLAGS: No such device
ip: SIOCGIFFLAGS: No such device
Starting ntpd: OK
Starting dropbear sshd: OK
Starting httpd: OK
Starting crond: OK
Starting vendor...
--------------------
AVPU_PARAM: clk_name=vpll avpu_clk=400000000
ISP_PARAM: isp_clk=125000000
SENSOR: gc2053
SENSOR_PARAM: data_interface=1
--------------------
Starting telegram-bot: OK
Starting rc.local: OK
Starting majestic: OK
Starting watchdog: OK

Welcome to Thingino
thingino login:
archandanime commented 3 months ago

Closing as thingino now sets devices-specific env variables automatically with S03environment script.