NishanthMenon changed the topic of #openocd to: this is the place to discuss all things OpenOCD | Logs: https://libera.irclog.whitequark.org/openocd/
Deneb has quit [Remote host closed the connection]
Hammdist_ has joined #openocd
sugarbee1 has joined #openocd
karlp has quit [Remote host closed the connection]
Hammdist has quit [Remote host closed the connection]
bacam has quit [Remote host closed the connection]
sugarbeet has quit [Remote host closed the connection]
bacam has joined #openocd
karlp has joined #openocd
karlp has quit [Ping timeout: 252 seconds]
karlp has joined #openocd
nerozero has joined #openocd
Hammdist_ has quit [Quit: leaving]
Hawk777 has quit [Quit: Leaving.]
Haohmaru has joined #openocd
JoseT has joined #openocd
JoseT has quit [Quit: Client closed]
<mrec> I wonder did openocd develop backward during the last years?
<mrec> openocd -f ftdi_channel1.cfg -c "flash init; init;" so far so good.
<mrec> penocd -f ftdi_channel1.cfg -c "flash init; init; flash erase_sector 0 0 11"
<mrec> so that spits errors
<mrec> flash erase_sector 0 0 11, flash erase_sector 0 0 last, etc all results with the same
<mrec> now when looking at the documentation about that it absolutely doesn't shed any light on what's wrong
<Haohmaru> surely openocd has been changing... maybe the command syntax and/or behavior changed and your old script needs to be remixed ;P~
<mrec> so I wonder if I have issues with this 99% will definitely also have issues with this
<mrec> flash
<mrec> flash bank bank_id driver_name base_address size_bytes chip_width_bytes
<mrec> bus_width_bytes target [driver_options ...]
<mrec> flash init
<mrec> flash banks
<mrec> flash list
<mrec> gdb_flash_program ('enable'|'disable')
<mrec> nand
<mrec> program <filename> [address] [pre-verify] [verify] [reset] [exit]
<mrec> this is the openocd output I get ... sorry but that's nonsense no one would know what to do with it
<Haohmaru> but i can't say, i neither use an ftdi with openocd, nor such flash commands, not even sure what that's supposed to do
<mrec> openocd -f ftdi_channel1.cfg -c "flash init; init; flash list"
<Haohmaru> the "program" command is used after you've attached with a debugger to a target, to program an .elf (typically) to the target
<mrec> this just hangs there
<Haohmaru> what exactly are you flashing?
<mrec> a winbond flash
<Haohmaru> oh, it's not an MCU at all?
<mrec> I'm absolutely lost with openocd 0.12.0
<mrec> no
<Haohmaru> no idea about that then
* Haohmaru uses openocd to program/debug MCUs
<mrec> me too actually that's okay
<mrec> flashrom does not work
<mrec> hmm maybe it even breaks the ICs
<mrec> well I resign and write my own FW tool
<mrec> I had it implemented in an STM32F0 before but I want something more generic
<mrec> (so I was able to flash it via USB)
<PaulFertser> mrec: openocd isn't meant to be used with flash alone, no, that was never supported.
<PaulFertser> mrec: you can not define any flash without having a target, and in your invocation command line there's no target.
<PaulFertser> mrec: if you're using ftdi to talk SPI to NOR flash then flashrom is for you. If you want to talk to NAND, hm, not sure what to suggest.
<PaulFertser> But certainly not OpenOCD, it never supported that.
<PaulFertser> Probably https://github.com/Droid-MAX/SNANDer ?
olerem has quit [Quit: WeeChat 3.8]
olerem has joined #openocd
jeeebz has quit [Excess Flood]
jybz has joined #openocd
<mrec> I'm just certain that I have flashed those ICs before with Linux. Unfortunately I don't remember how :-)
<mrec> for sure it was not flashrom
<mrec> when I flashed it with something existing back then I was able to break some of those ICs completely; I just don't know if it was the flash tool or the ICs were really dead (they were on a shelf for 7 years). And new ICs don't work reliable either
<mrec> not reliable / not at all.
<olerem> mrec: with linux i would take some SBC (RPi?) attach GPIOs or real controller to the ICs
<olerem> or investigate why flashrom fails to do things. Whak kind of ICs do you use?
<mrec> it's some Winbond IC. I have written some USB to SPI firmware for the stm32f0 many years ago and wrote my own flash tool which worked reliably; I will just reuse that one.
<olerem> ok
<mrec> back then I remember flashrom did not work properly either.
<mrec> flashrom just states that the support is experimental (still it seems)
<mrec> I think it's w25q64FV
<olerem> seems to be supported by linux drivers/mtd/spi-nor/winbond.c driver
<mrec> I am getting a different output everytime I start it
<mrec> it was like that when I did my own FW tool
<mrec> there is a command to erase the entire flash at once it is not implemented
<mrec> it's doing block based erasing.
Deneb has joined #openocd
<mrec> this flashrom compile script is terrible
<mrec> not even sure if it is just looping
<mrec> ah ... I used the wrong buildscript it indeed was looping
Deneb has quit [Quit: Leaving]
Deneb has joined #openocd
Ha0hmaru has joined #openocd
Haohmaru has quit [Ping timeout: 264 seconds]
Ha0hmaru is now known as Haohmaru
<PaulFertser> And w25q64FV isn't NAND, it's NOR and it's supported by flashrom no prblem.
<mrec> I have w25q32FV, did you test it?
<mrec> my guess is just that the configured spi speed might be too high
<PaulFertser> I do not need to test it to read datasheet and see it's NOR and not NAND.
<mrec> sometimes it gets the correct chip ID but most of the time it doesn't
<PaulFertser> Yes, default speed can be too high, depends on wiring etc. I usually slow it down using sme flashrom option.
<PaulFertser> And do reading 5 times and compare hashes.
<mrec> also the full chip erase function is nonsense, it does it blockwise
<mrec> the chip has a single function for that
<PaulFertser> You do not need to care much, flashrom erases and verifies whatever is needed to get the right contents in the end.
<mrec> if it works yes, but it doesn't here.
<mrec> I'm just doing it aside but I think I will be fine with it
<mrec> first I'll slow down the spi speed, second I'll fix the erasing function
<mrec> I'll just take my stm32f0 code which worked fine before
<mrec> after all it's just a few commands anyway
<PaulFertser> Can you show full flashrom debug code with slow speed that shows how it doesn't work properly with that part please?
<mrec> it says spi clock 30mhz the cables are short
<mrec> C:\Users\markus\Documents\Visual Studio 2013\Projects\fx2driver\fx2driver\Debug\
<mrec> ups
<mrec> MPSSE clock: 60.000000 MHz, divisor: 2, SPI clock: 30.000000 MHz
<PaulFertser> 30 MHz is way too high for jumper wires etc.
<mrec> Added layout entry 00000000 - 003fffff named complete flash
<mrec> The following protocols are supported: SPI.
<mrec> Probing for Winbond W25Q32.V, 4096 kB: compare_id: id1 0xef, id2 0x4016
<mrec> Found Winbond flash chip "W25Q32.V" (4096 kB, SPI) on ft2232_spi.
<PaulFertser> Use 10 MHz or lower.
<mrec> ya could easily be that's why I'm setting it slower I just didn't start my tests yet
<mrec> 0xef is correct
<PaulFertser> I think I was using divisor=10 to get fully reliable operation.
<mrec> Reading old flash chip contents... done.
<mrec> Erasing and writing flash chip... Trying erase function 0... 0x000000-0x000fff:W, 0x001000-0x001fff:W, 0x002000-0x002fff:W, 0x003000-0x003fff:W, 0x004000-0x004fff:W, 0x005000-0x005fff:W, 0x006000-0x006fff:W, 0x007000-0x007fff:W, 0x008000-0x008fff:W, 0x009000-0x009fff:W, 0x00a000-0x00afff:W, 0x00b000-0x00bfff:W, 0x00c000-0x00cfff:W, 0x00d000-0x00dfff:W, 0x00e000-0x00efff:W, 0x00f000-0x00ffff:W,
<mrec> 0x010000-0x010fff:W, 0x011000-0x011fff:W, 0x012000-0x012fff:W, 0x013000-0x013fff:W, 0x014000-0x014fff:W,
<mrec> still need to check that part... I want the single erase function.
<mrec> Verifying flash... FAILED at 0x00000000! Expected=0x00, Found=0xff, failed byte count from 0x00000000-0x003fffff: 0x3fe817
<mrec> Your flash chip is in an unknown state.
<mrec> Please report this to the mailing list at flashrom@flashrom.org or
<PaulFertser> Why do you want the single erase function?..
<mrec> I used another tool for flashing in the past which worked properly, I thought it was openocd
<PaulFertser> No, flashrom is the tool that works properly. OpenOCD never supported bare flash without a target.
<mrec> to initially clear the entire flash, I think it's required but not sure (last time I used that was years ago)
<mrec> I always had issues with flashrom
<mrec> that's what I know for sure
<mrec> well I'll report back tomorrow when I'll continue with it.
<mrec> I should be able to get it work since the correct ID was reported the rest I can check with the oscilloscope in the worst case
<PaulFertser> It's not required.
<PaulFertser> Yeah, I never had issues with flashrom...
<mrec> it can easily be the ftdi combo
<mrec> 30mhz hmm...
<Haohmaru> 30MHz is quite fast, how big is that harddisk ;P~
<mrec> flash 4mb/32mbit
<Haohmaru> slow your horses then, drink a coffee ;P~
<mrec> 30mhz is not much even for short wires, I used short wires up to 90mhz already
<Haohmaru> the poor little electrons :~(
<PaulFertser> 30 MHz is too damn fast
<mrec> but ya depends on the ftdi how he's driving it I don't know this chinese board and just use the pinouts.
<mrec> nah 30mhz isn't fast.
<Haohmaru> it's faster than a pic12f
<mrec> that's a baby IC
<PaulFertser> It's not fast if you use proper cable where every second line is connected to ground and where you have at least series termination on each signal line etc.
<PaulFertser> If you just connected a bunch of jumper wires then it's too fast certainly. Especially without termination.
<Haohmaru> coat-hanger-grade connection
<PaulFertser> If you say 30 MHz is fine show oscilloscope captures mrec .
zjason has joined #openocd
<Haohmaru> <noisy_sine_waves.jpg>
Haohmaru has quit [Quit: saionara]
<mrec> well I tested it at 7mhz no go either same unreliable as with 30mhz I think my stm32 solution was at around that speed too
<mrec> ok I give up on that and go back to my stm32f0 flashrom is dangerous and completely breaks the winbond parts
Hawk777 has joined #openocd
<PaulFertser> I disagree, flashrom never breaks winbond parts.
<mrec> oh it did got a couple of dead chips here
<mrec> well with the ftdi it certainly doesn't work ...
nerozero has quit [Ping timeout: 265 seconds]
Foxyloxy has quit [Read error: Connection reset by peer]
Deneb has quit [Quit: Leaving]
Foxyloxy has joined #openocd