Dafang-Hacks / spiflasher

Flasher for GD25Q128C
17 stars 8 forks source link

25VQ128ASIG - can't flash #12

Open arhi opened 7 months ago

arhi commented 7 months ago

I can wyze cam pan (wyzecp1) and I'm trying to flash it ... I removed the SPI flash and it is 25VQ128ASIG When I try to flash using flashrom i get:

Probing for GigaDevice GD25Q127C/GD25Q128C, 16384 kB: compare_id: id1 0x5e, id2 0x4018

of course -L do not show 25VQ128ASIG nor anything similar ..

when I forceread..

arhimed@mbpro-m1 Downloads % sudo flashrom -p ch341a_spi -n -V -c GD25Q127C/GD25Q128C --layout rom.layout --image boot -r xxx -f          
flashrom v1.3.0 on Darwin 23.3.0 (arm64)
flashrom is free software, get the source code at https://flashrom.org

Calibrating delay loop... OK.
flashrom was built with LLVM Clang 15.0.0 (clang-1500.0.40.1), little endian
Command line (13 args): flashrom -p ch341a_spi -n -V -c GD25Q127C/GD25Q128C --layout rom.layout --image boot -r xxx -f
Added layout entry 00000000 - 0003ffff named boot
Added layout entry 00040000 - 0023ffff named kernel
Added layout entry 00240000 - 0058ffff named roofs
Added layout entry 00590000 - 0062ffff named driver
Added layout entry 00630000 - 00acffff named appfs
Added layout entry 00ad0000 - 00ccffff named backupk
Added layout entry 00cd0000 - 00d6ffff named backupd
Added layout entry 00d70000 - 00f6ffff named backupa
Added layout entry 00f70000 - 00faffff named config
Added layout entry 00fb0000 - 00feffff named para
Added layout entry 00ff0000 - 00ffffff named flag
Using region: "boot".
Initializing ch341a_spi programmer
libusb: info [darwin_detach_kernel_driver] no capture entitlements. may not be able to detach the kernel driver for this device
Device revision is 3.0.4
The following protocols are supported: SPI.
Probing for GigaDevice GD25Q127C/GD25Q128C, 16384 kB: compare_id: id1 0x5e, id2 0x4018
No EEPROM/flash device found.
Force read (-f -r -c) requested, pretending the chip is there:
Probing for GigaDevice GD25Q127C/GD25Q128C, 16384 kB: Added layout entry 00000000 - 00ffffff named complete flash
Assuming GigaDevice flash chip "GD25Q127C/GD25Q128C" (16384 kB, SPI) on ch341a_spi.
Please note that forced reads most likely contain garbage.
Reading flash... done.

it reads the file and I can see inside file some "sensible data"

arhimed@mbpro-m1 Downloads % strings xxx
...
'Flush cache all before jump. 
ERROR: uboot pllfreq must greater than 600M
at %s:%d/%s()
pll.c
nf=%d nr = %d od0 = %d od1 = %d
cppcr is %x
CPM_CPAPCR %x
%s:%d
ERROR: cpufreq = %d and ddrfreq = %d can not be zero, check board config
at %s:%d/%s()
ERROR: pll freq is not integer times than cpu freq or/and ddr freq
at %s:%d/%s()
ERROR: Periph pll freq %d is out of range
at %s:%d/%s()
l2cache_clk = %d
pll_cfg.pdiv = %d, pll_cfg.h2div = %d, pll_cfg.h0div = %d, pll_cfg.cdiv = %d, pll_cfg.l2div = %d
CPM_CPMPCR %x
CPM_CPVPCR %x
cppcr 0x%x
apll_freq %d 
mpll_freq %d 
vpll_freq = %d
ddr sel %s, cpu sel %s
mpll
apll
ddrfreq %d
cclk  %d
l2clk %d
h0clk %d
h2clk %d
pclk  %d
set clk id error
clk id %d: get pll error
%s %d
DDR hardware training error result= %x
DDRC_DLP:%x
@pas:DXDQSTR= 0x%x
Rank:%d
No pass at byte:%d
pll_init
freq_correcting
align_pll
final_fill_div
get_pllreg_value
ddr_phy_init
ddr_phy_param_config
ddr_phy_init_dram
wait_ddrp_pgsr
U-Boot
U-Boot SPL 2013.07 (Feb 17 2020 - 15:50:50)
...

so it reads it but...

anyone can help out :D I have ch341a .. but not sure how to get it to write to this flash

arhi commented 7 months ago

without -c I probbly wrote it in ...

Found Unknown flash chip "SFDP-capable chip" (16384 kB, SPI).
===
This flash part has status UNTESTED for operations: WP
The test status of this chip may have been updated in the latest development
version of flashrom. If you are running the latest development version,
please email a report to flashrom@flashrom.org if any of the above operations
work correctly for you with this flash chip. Please include the flashrom log
file for all operations you tested (see the man page for details), and mention
which mainboard or programmer you tested in the subject line.
Thanks for your help!
Reading old flash chip contents... done.
Erasing and writing flash chip... Trying erase function 0... 0x000000-0x000fff:EW, 0x001000-0x001fff:S, 0x002000-0x002fff:EW, 0x003000-0x003fff:S, 0x004000-0x004fff:S, 0x005000-0x005fff:S, 0x006000-0x006fff:EW, 0x007000-0x007fff:EW, 0x008000-0x008fff:EW, 0x009000-0x009fff:EW, 0x00a000-0x00afff:EW, 0x00b000-0x00bfff:EW, 0x00c000-0x00cfff:EW, 0x00d000-0x00dfff:EW, 0x00e000-0x00efff:EW, 0x00f000-0x00ffff:EFAILED at 0x0000fffd! Expected=0xff, Found=0xfe, failed byte count from 0x0000f000-0x0000ffff: 0x3
ERASE FAILED!
Reading current flash chip contents... done. Looking for another erase function.
Trying erase function 1... 0x000000-0x007fff:S, 0x008000-0x00ffff:W, 0x010000-0x017fff:EW, 0x018000-0x01ffff:EW, 0x020000-0x027fff:EW, 0x028000-0x02ffff:EW, 0x030000-0x037fff:EW, 0x038000-0x03ffff:EW
Erase/write done.

I pushed in dafang_128mb_v2.bin (resized) .. but I only see yellow/green led on and nothing happening... maybe I should put some other bin?