Hi guys, both you have wrote that you read all zeros, what do you mean? Taking care that all the connections are correctly carried out do you read zeros even by issuing the sequence [0x9f r r r]? Being able to depend on the circuitry it's possible that the problem is due wrong pull-up interface. So in the case you have to try by use the Bus Pirate's pull-up resistors using the command "P" paying attention to don't damage either the Bus Pirate nor the device where the MX25L6406E is.
It's much better expecially for the SPI side. It has been written by Tayken performing a debug on the v6.3 release (thanks a lot Tayken!!!). Actually besides to v6.1 and v6.3 you wrote, there is also v6.2 revision. v6.3, v6.2 or v6.1 aren't the latest and however only that I linked has been bugfixed for problems facing the SPI's management, no others for what I know. I always suggest to all who have a Bus Pirate to install and use the realease bugfixed by Tayken. It's the better, no doubt!
Hi testaccount, ok, your is Bus Pirate revision 3 (3.6a from Sparkfun) then its firmware should be the stock one V5.10 and so for the bootloader. Anyway you haven't written what's the firmware that you are trying to load into your Bus Pirate. Are you sure that you're using a suitable one? The message you wrote seems to be tie with the PIC's flashsize so the firmware you are trying to use doesn't match with the PIC onto which you want to put it.
What's the revision of your Bus Pirate?, revision 4,3 or earlier?
What's the revision of its bootloader?
What's the original firmware installed and what's the one you want use now?
Pirate-loader is quite easy to use. Simply download the firmware you want, edit the batch file and run it. You only need to set properly the COM port. In the case you want to use a firmware release that hasn't its own batch file, simply put the firmware you want in the folder and in the batch file make changes at the name of the exadecimal firmware so it match with what it's need. Good luck!
/HOLD(IO3) = Hold Input (data Input Output 3 for Quad SPI instructions)
Vcc = chip's power supply
In order to operate the component you need to deselect /WP(IO2) pin 3 and /HOLD(IO3) pin 7, which being active in low state have to be forced to the high state by connecting them to the power supply pin 8. Please take a look at this:
Hi surfrock66, you are welcome! Surely the Bus Pirate can do the job without the help of other that it itself (stand-alone). About your last question on how read the chip's content by using command 03h(Read Data) the answer is in the datasheet you just posted, there is all you need in order to reach the goal. Indeed it says that the instruction is initiated by driving the /CS pin low and then shifting the instruction code “03h” followed by a 24-bit address (A23-A0) into the DI pin with the data byte of the addressed memory location shifted out on the DO as most significant bit (MSB) first. The address is automatically incremented to the next higher address after each byte of data is shifted out allowing for a continuous stream of data. This means that the entire memory can be accessed with a single instruction as long as the clock continues. The instruction is completed by driving /CS high. In the Bus Pirate's syntax it is something like to this:
0x00 0x00 0x00 = 24bit start address as 3bytes (1byte=8bit) for the first slice
0x00 0x04 0x00 = 24bit start address as 3bytes (1byte=8bit) for the second slice
0x00 0x08 0x00 = 24bit start address as 3bytes (1byte=8bit) for the third slice
0x00 0x0C 0x00 = 24bit start address as 3bytes (1byte=8bit) for the fourth and last slice
Offset is always 40000h(262144dec) for all four readings so that even in this case their sum is the entire contents of the memory chip (40000h*4=100000h=1048576dec bytes). As you can see there are different ways to achieve the same result.
At SPI speed of 1MHz the reading of each single block of 256kB(256bytes*1024=262144bytes=8192bytes*32) requires less than 2 minutes (1m 56s) to be carried out so the whole thing requires about ~8 minutes (~2minute*4) in order to finish collecting all the 1048576bytes which are the full contents of the memory into the Winbond 25Q80dv chip. Due the Bus Pirate's limitation of only 256 characters for each line of instruction that can be send to it, you can't send all the commands on the same row, so you need to split them. In these examples the reading of the whole contents is split by 4 parts of 256 KB but obviously you can arrange it in any different way taking care not to exceed the Bus Pirate's limit of 256 characters for line. You can't even send easily the read of the whole 262144bytes or more at once due weakness of the USB communication because then many bytes will be lost by buffer's inadequacy. For all those reasons split the command into several parts is highly advisable. Of course by choosing the appropriate address it's even possible to read a well defined slice of memory if it's necessary.
Anyway, before you start reading it would be better perform the command 9Fh(JEDEC ID) in order to be sure that wires are hooked on the right pins and communication between the Bus Pirate hasn't any problem:
[0x9F rrr]
The right answer should be: 0xEF 0x40 0x14.
As anyone can see the Bus Pirate alone really can do the job. It's like a Swiss knife, maybe it hasn't the efficiency of specific tools, even though it surely allows you to do several things also quite complex and difficult. But the Bus Pirate is a powerful device which can even be controlled by external script and software, so there are also other ways to reach what you want. For this kind of thing that you need it's perhaps better to use script or something that does automatically the job as for instance Flashrom. You're asking for help to read the contents of the chip, here I will go before of you by saying that then you will probably need to rewrite it. Surely the Bus Pirate can also write into the chip but as you can see from the datasheet you can't change only what you want, you need to erase all the chip and then rewrite it with the new content you need. It's a quite complex and tedious thing to do. So in the end simply you can use Flashrom in order to automatically manage your Bus Pirate.
Doing so you only need to hook the Bus Pirate to the correct pins and start Flashrom which will take care of everything. Very easy. The syntax for the Windows version of Flashrom is something like this (for different versions refer to Flashrom's manual):
flashrom.exe -p buspirate_spi:dev=COMNnr -r NAME (it reads the whole memory content and saves it in the NAME file)
flashrom.exe -p buspirate_spi:dev=COMnr -w NAME -V (it writes and verifies the whole memory content of the chip with that of the NAME file)
flashrom.exe -h (shows the online help of Flashrom)
Where:
nr = serial port number used by the Bus Pirate, for instance COM1 for the serial port 1
Hi busowner666, you are welcome! Actually the maximum capture size depends on sample rate you are using. OLS has 216K block RAM that can support different memory configurations depending on how many channels are used:
8 channels with 24K sample depth 16 channels with 12K sample depth 32 channels with 6K sample depth
Unless RLE is in use the total acquisition time is the fraction of the available sample depth on sampling rate. So for instance, considering RLE is off, with 8 channels there are 24K sample depth and by sampling at 200MHz it is 24K/200MHz=120us as lasting time for the acquisition. By using RLE compression the lasting time will be increased. In this case, regardless by the real number of channels needed for the acquiring, it's better setting the client for all 32 available because it extends the maximum lasting time for the acquisition. Please take a look at these:
Hi lrotk, I haven't a specific experience about this because I never used my Bus Pirate as logic analyzer, but I think that it can do the job due the fact for SLE4442 cards the max speed for the clock is 50kHz only. As stated by someone somewhere on the net the Bus Pirate is not a proper logic analyzer, but it can capture 4K samples, and is known to work properly with I2C traffic running at 400kHz clock. By sampling at 100kHz, twice of the clock frequeny of the 4442 card (50kHz x 2 = 100kHz) the logic analyzer client can capture up 4096 samples in about ~41ms of time span, actually more long lasting since the RLE compression is active. However, the point is another. Indeed the best thing is that you don't need any 2wire sniffer, the Bus Pirate's SPI sniffer does the job! Simply collect data using SPIsniffer.v0.3, at so low speed it can store a lot of data for long time. You have to set SPIsniffer.v0.3 for SPI mode 0 and define the I/O line as MOSI and the clock as the clock. The traffic you want is only on I/O signal (MOSI), so you have to pay attention at it leaving everything else. Note that the data format is 8bit LSB first (Least Significant Bit First). Instead if you wish to decode the traffic into the logic analyzer client you have to set SPI0 for its decoder and LSB-first for the byte order by defining the I/O line as MOSI and the clock just as the clock. Unluckily though seems that acquisition delayed doesn't work with the Bus Pirate:
Hi Michael , maybe it isn't your case, but it's better perform the firmware upgrade on Windows machines rather than Linux or other, due of some know issue that could emerge using not-Microsoft operative systems. Under Microsoft operating system it's just a matter to modify a bat file in order to match serial COM's setting and run it. Really very easy to do. Good luck!
Hi erikr , you are welcome! From the messages you wrote it's like if the bootloader in your device has been successfully upgraded and now you need to upgrade the firmware. So if you already didn't do so please take a look at this:
It has been written by Tayken starting from the v6.3 release (thanks a lot Tayken!) in order to fix some problems facing the SPI management. In my opinion it's the best choice for everyone who own the Bus Pirate! Good luck!
Ooopps, that's the V4!!! Sorry, my bad. I noticed it only now. So, never mind even of course if somebody else around who can try in that field is wellcome. Please, have your say if you can.
It might be interesting to know if it works just as well for you. If you have time and you feel like could you please try it with yours own configuration and settings just to see if it works or not? Thanks in advance. Course, if the answer is affirmative, I advise you to use it instead of the 6.2 version you're using.
Hi lrotk. Just in the case, are you sure the contacts on which you have hooked the Bus Pirate are the right ones? Based on the version the pinout for the SLE5542 could be different from that used for standard SLE4442. You even have to pay attention to the Bus Pirate's pinout because the Sparkfun version have the its own which is different from that used by Seeed Studio. Then, perhaps something is misconfigured because you should get this:
Bus Pirate v3.5 Firmware v6.3-beta1 r2151 Bootloader v4.4 DEVID:0x0447 REVID:0x3046 (24FJ64GA002 B8) http://dangerousprototypes.com CFG1:0xFFDF CFG2:0xFF7F *----------* Pinstates: 1.(BR) 2.(RD) 3.(OR) 4.(YW) 5.(GN) 6.(BL) 7.(PU) 8.(GR) 9.(WT) 0.(Blk) GND 3.3V 5.0V ADC VPU AUX SCL SDA - - P P P I I I O I I I GND 3.31V 4.94V 0.00V 5.03V L H H H H POWER SUPPLIES ON, Pull-up resistors ON, Open drain outputs (H=Hi-Z, L=GND) LSB set: LEAST sig bit first, Number of bits read/write: 8 a/A/@ controls CS pin R2W (spd hiz)=( 1 1 ) *----------*
Hi gcebiker, you are welcome! There are several of those in internet. Digging a bit I found these.
Python Oscilloscope aka BPscope v 1.2 as its name says it is just a script that implements a simple oscilloscope for the Bus Pirate which graphs voltage over time:
Hi rdiez. I agree with almost all you wrote but also what Ian says isn't wrong and so for the dpropicweb's statements. I think the truth lies somewhere in between.
[quote author="rdiez"] Basic bugs are not fixed. For example, this one I reported, which means you have to manually pull and reconnect the USB cable pretty often:
[quote author="rdiez"] Or the infamous SPI bug, which I encountered years later and made me waste hours, because it was not obvious that this was the reason why
It's much better expecially for the SPI side. It has been written by Tayken starting from the v6.3 release (thanks a lot Tayken!). Only this that Tayken wrote has been bugfixed for problems facing the SPI's management, no others for what it's known. Would be possible to name it like v6.4 release and till now it's the best and stable that people can use with their own Bus Pirate v3. It has all the Bus Pirate's basic features, script engine too!
This too works fine with the Tayken's release. I use it with flashrom without any problem. I also instrumentally (DSO and OBLS) verified the 8MHz clock and it is correct even if actually its duty cycle isn't 50% (the length of time in which the level is high is shorter than that in which it's low). But sadly even it still surely has some other bugs that luckily can be circumvented in some way though.
In my experience the protocols (SPI, 1WIRE, 2WIRE, 3WIRE,I2C, ect, ect...) work fine without any problem. The bugs are on macros and some few little things that anyway is possible to solve in some way. For instance one thing that annoys me a lot is that in 2WIRE MACRO(1) and MACRO(2) don't work.
It doesn't matter, there is the option to shorting PGD and PGC together directly on the board, so never mind. In order to gain "Jump to bootloader" function is enought to simply put a jumper between PGD and PGC instead to start it by command $. Easy again! Which then, anyway, "Jump to bootloader" isn't a function that is used so often.
[quote author="rdiez"] But look, the bug I am talking about is very simple, widely known, was already fixed, and it concerns the stable, very popular SPI
protocol. How about doing the bare minimum of releasing a new "official" version with the alredy-done fixes? Trivial things like updating
the link to the current source-code repository? Listing the known bugs on the project page?[/quote]
I fully agree here, that makes sense and would be usefull. However it isn't Bus Pirate doesn't works fine, it does the job very well already as it's now, it is only a little help more for newbie and new customers. Would be only a matter to retrieve all already given fix, answer and improvements putting all them together in an single known place so that everyone can enjoy.