Experience of an amateur and beginner (humoristic)

Are you interested in a novice’s opinion?

3 Likes

English is not my mother tongue, so let me know if there’s a mistranslated phrase.

Since I’m new among you, I’ll give you a little introduction.

Before I bought it, I had read on hackaday.com where he was talking about the pirate bus version 5, he said “but anyone jumping on the bandwagon this early should be prepared for some teething problems”. At first I thought it was very funny, but now I’ve been on it for two months and I’ve lost a few teeth and my smile! :frowning:
Now I’m going to tell you about my first experience as a beginner and amateur.
For me, computer science can be summed up in one sentence: why make things simple when you can make them complicated? I think that with so many years of computer practice, I’ve assimilated this sentence and I do the same :slight_smile: . I had to discover and study: the pirate bus in SPI mode, linux that I didn’t know (with a blank OS), a new emulator (GTKterm) when I was used to “putty”, a new WSON EEPROM (OTP locks, SFDP,…) and flashrom (build,meason…) that I didn’t know. And yes!
I’m glad, though, because ten or fifteen years ago I tried to install flashrom, without success, and I’ve just understood why. I was in 64-bit mode, whereas at the time it only worked in 32-bit mode (a small victory!).

But where I lost the most time was trying to open the serial port, ls , dev, lspci, lshw -short, dmesg, chvt, chmod the udev, open by kernel…help. It was through testing that I understood the difference between tt0 and ACM0.
Then I tackled the vocabulary,CRLF,CDC, UART, duplex/full, microcontroller,Nand, parallel flash, protocols (TCP/IP,FTP,SSH, IC,… ), OSI layers and their protocols, synchronous/asynchronous serial transmission, jitter, cyclic redundancy control, noise floor, checksum, RS-232, nodes, pull-up resistors, impedance, high impedance, floating, hi-Z, tri-strate, jedec, sfdp, otp… I won’t mention it all here, but it’s very consistent for the uninitiated.

Then I did a continuity test on the adaptor to see if the IO matched the socket pins (broken connection, bad soldering, etc.) and compare with my chip (CS, miso, etc.). Well, even if there’s a control point I always check (some bad experiences). Everything was fine.
Then I wanted to check, just by reading, if flashrom was well installed, I recovered a bios I had flashed with another programmer on an old PCT eeprom I had left over from a repair. Flashrom read it without any problem.
I’ve got the 6RP 2350 rev2b pirate bus, and as I couldn’t find a tutorial for version 6, I thought it prudent to start with earlier versions. I started studying the tutorial with version 3, then 4, then 5,5xl…my brain was on fire and as I read the components of version 6, I realized that I could base myself on version 5. After reading thousands of pages, I had the HIZ…Whoua the hardest part began :).
I used the tutorial on the site (read the ID jedec, ID manufacture…) and I couldn’t get RX (0xFF), so it took me a long time to figure it out.

Then I read the manual 1,2,3…15 times, and by reading the temperature tables at the very end of the manual, you know the part you never read, I realized that the EEPROM was in the initial state.
Reading on the forum (spi-flash-goodness/200), I realize that I don’t have all the information on the notice (Signature and Parameter Identification Data Values and Extended Address Register). I contacted the frabiquant, created an account and managed to send two messages (US and EU), since my EEPROM was new. In the meantime, I looked for the information on their site, a few hours later,…, I still hadn’t found anything and I’m still waiting for the manufacturer’s reply (in a few years I’ll have it :).
So I went back to GitHub - armink/SFUD: An using JEDEC's SFDP standard serial (SPI) flash universal driver library | 一款使用 JEDEC SFDP 标准的串行 (SPI) Flash 通用驱动库
It’s the serial flash universal driver and my head imploded, I didn’t understand a thing, is it a driver, a package and above all how to install it.
I don’t even know where to start, I’ve got so many questions to ask you… my current state of mind is a bit like if I’d had 3 or 4 bad flashes and my brain was fried (was bricked). But I think you’re all familiar with that effect.

Perhaps the hardest thing for me at the moment, when I read the EEPROM manual I understand it, but I have trouble matching the right commands to the work I want to do on the chip.
On the other hand, if it helps, I regularly have a bug when I type the wrong commands (regularly), in SPI mode, the Vout,IO1,IO2…IO8 and the lower voltages are scattered all over the terminal and everything is unreadable. I type cls and everything gets back in order, I just lose the history of my commands.
I don’t know if you’ve already thought about it, but what would have really helped me, reassured me at the start and above all saved me time, is some kind of pre-installation software that does tests (a bit like ping) that check if everything’s connected properly, such as the serial port (during opening) or the flashrom program (after construction). Well, I think I’m asking a bit too much.

And finally, what made me decide to write such a long text is that since I’ve been reading the forum, I’ve realized that there aren’t any beginners. And I’d like to thank everyone because you’ve allowed me to rediscover a sense of humility.

7 Likes

Hi, @io7 and welcome. First of all you dont have to install any drivers. Because BP have everything to “talk” to your EEEPROM chip. You may use BP console to issue command manually but yes its a bit complicated at first but there is legacy binmode to use flashrom on your computer so you dont have to issue command on BP itself.

The documentation is in transition mode to new framework:
So Legacy Raw SPI (Flashrom and AVRdude) | Bus Pirate Docs it not accurate. But you may look here:
Add legacy mode for third parties flashrom avrdude by therealdreg · Pull Request #85 · DangerousPrototypes/BusPirate5-firmware · GitHub

When it was just merged I’ve tested it and it works.

So basically you connect stuff correctly to BP you enter BP console, switch to legacy binmode. And then you simply use flashrom to dump/write the chip. Hope it helps

3 Likes

Welcome to the forum, thank you for sharing your experience!

It sounds like a pretty typical learning curve most of us have gone through. There are so many facets to electronics. It is both fascinating, and incredible frustrating at times.

The Bus Pirate is supposed to make that easier though :slight_smile: I built it while I learned how all the protocols and chips work. I was a total newbie when I started the project. I also experienced the same frustrating learning curve - it took me a long time to learn how to read datasheets and how all the bits are supposed to fit together.

It sounds like you had a lot of difficulties getting started with Linux. I can’t help you there. Even though I designed the hardware and wrote a lot of the firmware, it would take me a day or two to get it up and running on Linux. Windows and Teraterm are a super fast way to get started.

What chip are you tying to work with? If you are trying to dump/program a flash chip, have you checked the SPI flash tutorial? It covers manually interacting with the flash, as well as using the Serial Flash Universal Driver that is already implemented in the Bus Pirate. Flashrom is great, but a lot of what flashrom does is now implemented directly in the Bus Pirate so you don’t have to mess with external software to get started. I call this software “crapware” because it doesn’t get updated over time and it leads to the exact experience you had.

Any suggestions you have that could make this experience easier for other beginners is greatly appreciated.

2 Likes

Yes, I had understood that on linux (with time) you didn’t need a driver for the BP. But I wonder if I can use:
SFUD is an open source serial SPI Flash universal driver library.

What is it exactly? Software? I can’t figure out what it is and where to put it, I’ll analyze it later.
I tried binmode, but it didn’t work. Is Avrdude an app? I’ll have a look at the link you gave me, the one that works. Thanks for the information…

2 Likes

SFUD is already in the Bus Pirate, you don’t need to do anything more with it.

Here is a step by step walk through of the flash command in SPI mode.

2 Likes

Hi yan
First of all I’d like to say, you’re doing a great job on the pirate bus, thank you for making our lives easier and if you could also thank your team.
Yes for linux, I have some little problems, I crashed my windows (so with it too:) with unix files and since I have a virtual machine on it (kali), the OS didn’t like it, I’ll take care of that later.
To tell the truth, at the moment I’m testing the pirate bus with several EEPROMs.
PCT25VF032B (I had a BIOS on it), Winbond 25Q32JV (I use it as a test with the tutorials) but right now I’m only working on the GD25B256E which is new and which I need to set all my bits to 1 and my status register is 00H, only my DRV0 bit (Output Driver Strength Bit-Non-volatile writable) is set to 1.

I haven’t managed to change the extended address register A24 bit in address mode and volatile 3 bytes address = 0000 0000h00FF FFFFh
and I’d like to switch to 4 bytes with address 0100 0000h01FF FFFFh do you have a tutorial to activate this [code]?
So far I haven’t managed to read or write to the eeprom.
The SPI flash tutorial has helped me, but I’m stuck: my RX= 0XFF 0XFF with the commands: [0x9F] D:10 [0xab 0x00:3 r]/[0x90 0x00:3 r:3] doesn’t give me the device ID or the manufacturer ID.
With the JEDEC ID and SFDP tables my RX= 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF.
I think that the fact that my chip is in its initial state may be blocking me.

So to get ahead, I continued with your tutorial : https://forum.buspirate.com/t/spi-flash-goodness/200
But I don’t have the information on my manual (table ID definitions), I have to contact the manufacturer to get it (which I did).
That’s why I was talking about the Serial Flash Universal Driver, to be able to have the IDs I’m missing as well as the data (sfdp signature) (in serial flash discoverable parameter SFDP). I’ve just read “Serial flash universal driver is implemented”, okay I’ve just understood everything, so I can have all this information via the pirate bus.
I thought (wrongly) that there were 3 ways to control flashrom, binmode, via BP terminal or linux terminal. It’s because of tutorials 3,4, it worked under flashrom.
I’m going to go as simple as possible and use the pirate bus via the implementation, but if I have to force a new chip that’s not in the library (not supported), do I have to go back to flashrom?
You’ve just taught me the word “crapware”, so it’s actually one of the only programs on Windows where I really couldn’t install it successfully.

Thanks for all the information, it’ll help me move forward.

2 Likes

The GD chips seems to support all the different ID methods. If the SFUD can read SFDP parameter tables it should be able to adjust automatically, no need to have the chip in a database. The database of chips is most useful for old or odd chips that can’t be discovered by SFDP.

2 Likes

This chip is a bit odd. It does not have a HOLD or WP pin. What package are you using? The SOP version has a RESET# pin that I guess needs to be held high for normal operation.

Before you can write to status register you need to send the write enable command. I think that may be a hint as well.

2 Likes

Wait, the world has turned, I wake up (jet lag), have a coffee and analyze all this. I didn’t think I’d get a reply. It’s like you bought me a lamborghini!

2 Likes

Hi yan
I’m with the WSON8 56/68 SPI flash adapter
I’m doing the test ~ = everything is ok / the switch on the adapter I put it to the right/ SPI >W the light comes on. 3.30V and max 40mA (maybe a bit too low) and I’m at 100Hz because my cable is a bit long.
My eeprom is an 8-pin WSON, yes there’s hold and WP when I execute the command A 2; A 3 on the bus screen I see them in AUXH so the pull-up resistors are in High.
On the EEPROM I’m in normal SPI (not dual, nor quad).


I had made a compressed table. I’d like to ask you a question, when they say (cont.) in the table ex: at 90h, should I go back to the 5 byte (MID7-MIDO), or continue on the 6 bytes in (ID7-ID0)?

I had read that I was in 3 bytes addr.mode see table below :

If I want to switch to 4-byte (1), long after I’ve found my IDs, what commands should I execute on the pirate bus?

After running the “SPI flash chips” tutorial, I still had no ID and made a lot of erroneous commands.
At first, I tried to unblock the ID with commands like: [0x9F 0xc8 0x40 0x19]
I was basing myself on the table:


I still don’t get it: MID7-MID0 / ID15-ID8 / ID7-ID0
What’s this? Mosi and Miso connection? And is D7 D0 D8 like the table below, the data?

It was my first read, so I probably got the wrong orders:

Before my first post on the forum, I was stuck on the (5AH) and the JEDEC 216 b standard (p41 notice, at the end of the page). On the web in (date November 1, 2018), I only found the JEDEC JESD 216 standard.

Definition of the standard: “The SFDP standard defines the structure of the SFDP database within the memory device and the methods used to read its data.
The JEDEC-defined header with Parameter ID FF00h and the associated Basic Parameter table are mandatory. This header and table provide basic information for a Serial Peripheral Interface (SPI) protocol memory. Additional headers and tables are optional.
The read control protocol using various I/O modes and the standard clock frequency are specified. Device electrical parameters are not specified.”

So I had concluded that I could have the IDs, you tell me if I’m wrong.

But when I read the instructions on p.43, I realized that my EEPROM was in state :
8.2 Initial Delivery State
The device is delivered with the memory array erased: all bits are set to 1 (each Byte contains FFH). The Status Register contains 00H, except that DRV0 bit (S21) is set to 1.


And I was at that stage when I wrote my first message on the forum.

And now I’m going to try the “write enable 06H” command, as you advised, but as my status register is in S21, I feel I have to set my status first and this is the first time I’ve touched the status register, I’ll see …

1 Like

You should get 2 bytes. According the table 0xc8 and 0x18. I believe ‘cont’ means is that the manufacturer ID and device ID will repeat.

[ 0x90 0:3 r:2]

This should get the ID. 0x90, followed by 3 0x00, then read two bytes. MID7-MID0 refers to the 8 bits in the manufacturer ID byte, ID7:ID0 refer to the 8 bits of the device ID byte.

Have you successfully read the device ID? That is where I’d start.

The same as any SPI command. It’s not that the Bus Pirate knows how to change the chip, it’s just the command listed in the datasheet.

The command is 0xb7.

[ 0xb7 ]

  • [ - CS goes low
  • 0xb7 - send command
  • ] - CS return high

MOSI - Master Out Subdevice In - connect this wire to chip SI
MISO - Master In Subdevice Out - connect this wire to chip SO

The SFDP tables are not blank, and the chip should not block you from reading them.

Some datasheets have a good description of their SPDF, some rely on oyu knowing the standard. Page 81 of this datasheet breaks them down. First there is a standard header table, this table tells you where the other tables are located. You don’t actually need to do that manually, unless you want to, because the flash command parses them out. You can see that code here.

[ 0x90 0:3 r:2]

Before you do anything else, we need to make sure the chip ID is detected with 0x90. If that doesn’t work, there is a fundamental problem in the setup.

Are the two switches on the adapter pushed towards the 10P connector? Did you enable power with the W command? Please copy and paste the full output of your session and I’ll try to see what is going wring.

2 Likes

Really, really a huge thank you, I’m going to work all this out, on my own,… you saved my life :slight_smile:

3 Likes

@io7 you’ve been a long way already, seems like to had to learn almost everything at once without any structure other that a succession of barriers and I know how this feels.

After 30+ years of computing, ~25 years of Linux, I still stumble on problems with “things that I have done 100 times before, that should take me 5 minutes and end up taking two weeks”. I’m working on that XD, be patient :wink: and let the force be with you

2 Likes

I’ve been seriously injured, I’m bedridden and I’ve had to stop learning the pirate bus, momentarily because it’s a passion, or I’m having more fun than I’m working:), that’s the reason for the last very short sentence, that I replied to ian (I’ll come back:(,sorry :), with a lot of extrapolation, I confess (XD), but I haven’t given up, I’ll pick it up again when it gets better.

@petaflot, the long way I’ve come, was a bit identical to yours, for me it was like climbing each step of a staircase as an ant, whereas when I was climbing a floor, I was super proud of myself at each landing, whereas building was of infinite height:).

I’m not personally computer-savvy, but over the years I’ve accumulated a bit of basic knowledge.

Where I remain extremely humble is that I have 40 years of computing behind me, and as a non-professional, I still come up against a multitude of problems, often of extreme simplicity. I started with UNIX, BSD, then ten years later there was microsoft where I stayed for many years (cocoonig). Some things stood out more than others, like the first time I installed a driver without plug and play, I felt like I’d climbed Evreste (yes, I’m not a genius:).

But I wish you’d been there when I started on linux, I admit it would have helped me a lot :). On Microsoft, I open a port for you without even thinking, then I say to myself “when you want to learn something, you have to confront it”, but on reflection, I shouldn’t have done both at the same time, I was too ambitious.

The irony is that I’ve stayed with Linux (thank you Linus for your kernel), and in passing I can also thank Tim Berners-Lee and Robert Cailliau for having bequeathed us the world-wide-web, without whom I might not be able to talk to you, as we sometimes tend to forget them. You’ve encouraged me so well that I think I’ll soon be installing debian or arch, or both at the same time (XD).

@petaflot I wanted, in my current condition, to thank you warmly.

Post-scriptum: On my profile, wall-E looking at the rubik’cube is an allegory of me looking at the pirate bus and wondering, what is this device, what’s it for and how do I use it?

1 Like