<jybz>
Hello, I bricked my wifi router (aka uboot in the flash is not there anymore). I see that it is a MT7628 and it has openocd scripts there https://github.com/mtk-openwrt/openocd-scripts
<jybz>
Do you think I can repair it with openocd and jtag devices (like jlink or usb-blaster) ?
<marex>
jybz: doesnt the mediatek soc have some recovery mode ?
<marex>
jybz: ask stefanro in #u-boot tomorrow around need (UTC)
<jybz>
Hi marex, you are also here :D World look small. Thank you. When you say "around need UTC", it is like, noon ?
<marex>
jybz: like noon in Europe
<marex>
jybz: but yes, you can I think use openocd to bring the device back to life, or chipclip and program the SPI NOR with disposable board like RPi and flashrom
emeb has joined #openocd
<jybz>
I don't have a rpi, I've to see how quick I can set it on a bananaPro (another SBC I have)
<marex>
jybz: if you have anything which can bitbang 4 GPIOs, you are all set
<jybz>
Sounds good, I've flashrom on my computer, the usbblaster_spi recognized by flashrom, I've a SOP16 clipchip, and I found the flash (on the back of the board).
<jybz>
What remains : finding how to connect (which pin, on both side, as I never used the usbblaster), and finding how to flash which uboot. ^^
ipatch has quit [Quit: WeeChat 3.2]
zjason has quit [Read error: Connection reset by peer]
zjason has joined #openocd
<PaulFertser>
jybz: flashing like this might have another gotcha. Since you need to power the flash you might also be powering the rest of the board that way, and if SoC is powered it might interfere with flash operations. Sometimes it's enough to pull target's RESET pin low.
<jybz>
:(
<jybz>
ok
<jybz>
thank you
<PaulFertser>
jybz: other times limiting power supply current helps (I guess some brown-out detector in SoC just starts keeping reset low internally if the voltage is below the threshold). Same about trying to feed it Vcc lower than nominal.
<PaulFertser>
jybz: sometimes (if you're comfortable with that) lifting Vcc pin of the flash is the easiest way to get "ISP" flashing working.
<PaulFertser>
jybz: and yes, the scripts for Mediatek (contributed by BREED the proprietary bootloader author) should allow you to recover, probably by uploading u-boot directly to SDRAM and running it and flashing from its command line.
<PaulFertser>
jybz: if you have jlink I recommend jlink rather than old usb blaster.
<jybz>
Hum... the jlink would power the chip ?
<PaulFertser>
jybz: no, it's just that jlink is a better device, and it's also supported by flashrom and openocd.
<PaulFertser>
jybz: do not you have a laboratory power supply?
<jybz>
Unfortunately not...
<PaulFertser>
jybz: you can check this forum thread to see how people were programming flash ISP: https://forum.openwrt.org/t/xiaomi-wifi-router-3g-v2/42584 . Basically they all used the current limiting method which I assume just resulted in lower Vcc.
<PaulFertser>
At the moment I needed to access that flash I didn't have a clip so I just lifted the Vcc leg a bit and soldered 8 wires directly to all flash pins.
<PaulFertser>
jybz: have you already found jtag pinout for your board?
<jybz>
the needed power is between 1.65V and 1.95V ? I can't deliver it... Only 1.5, or 3V with batteries, and 3.3 with one regulator
nohit has quit []
nohit has joined #openocd
<jybz>
PaulFertser: no, I didn't find a jtag pinout on the board, I already had to solder the pin for the uart (before erasing uboot :D)
<jybz>
PaulFertser: the jlink have even more pin /o\
<PaulFertser>
jybz: have you measured it? Is that really 1.8 V?
<jybz>
No, I didn't measure it, I looked on a similar datasheet
<jybz>
> * libjaylink (if you want support for SEGGER J-Link and compatible devices)
<jybz>
I think my version of flashrom is without support of jlink
<PaulFertser>
jybz: you should really measure it on a board when you power it normally
<PaulFertser>
jybz: recompiling flashrom is ~trivial.
<jybz>
I can power the board and keep pressing on the reset button.
<jybz>
I don't have good measurement tool... That really something I'm missing.
<PaulFertser>
jybz: the reset button is likely a normal GPIO, nothing to do with SoC reset really.
<PaulFertser>
jybz: not even any voltmeter?
<jybz>
I've one shitty voltmeter, I can try what it gives me.
<jybz>
3V6
<jybz>
Should I belive my bad voldmeter ?
<jybz>
lol when I press the voltmeter between two fingers, it measures 7volts...
<jybz>
BTW, the routeur is a TP-link
<PaulFertser>
jybz: 3.6 is pretty close to 3.3 V which I'd expect.
<jybz>
ok, so, what is the best plan ? (one hour and half ago, I though one hour will be large enough :D )
<jybz>
I can't solder a wire for reseting the controller
<jybz>
because it is GBA
<jybz>
The reset button could be a GPIO
<PaulFertser>
jybz: you can try one of the tricks like powering the flash from a weak 3.3 V supply like in that forum thread.
<jybz>
Would 2x 1.5v batteries be enough ?
<jybz>
Otherwise, I've a 3.3 regulator and a breadboard.
<jybz>
So, unsolder and lift up VCC, solder a wire on it and a second on the board ground, power it at 3,3v, compiling libjaylink, compiling flashrom, finding the pinout between the jlink and the SOIC8 chipclip. Did I miss something ?
<PaulFertser>
jybz: if you lift up Vcc then you just use your clip, no need to solder wires.
<jybz>
ahhh the clip can power the flash, but should not power the board (i.e the controller) ?
<PaulFertser>
jybz: TDI is MOSI, TDO is MISO, TCK is SCK.
<PaulFertser>
jybz: yes, the idea is either to not power the board at all or to power both flash chip and the board with a lower voltage so that the controller wouldn't be able to start trying to boot.
<jybz>
You agree, /CS to GND, /WP to VCC and /RST to VCC ?