What is the right I2C driver for serial flash on P2?
Hi folks. I'm trying to do a similar thing to JonnyMac's thread on firmware update from SD to Flash:
https://forums.parallax.com/discussion/175979/update-flash-from-sd
I'm working through the examples in that thread and trying to see how everything fits together. But I'm stuck at the lowest level. What is the correct I2c driver for Flash access on P2? I just spent a couple of hours with jm_i2c, trying to dump sector 0 of my Flash chip. I think it may not be right since the code has just SCL and SDA for clock and data. My board has chip select on PIO61, SCL on PIO60, SDO (SDI pin of the Flash) on PIO59 and SDI (SDO pin of the Flash) on PIO58. I may have copied the arrangement from the blue P2 demo board. So I think I need a 3 wire I2C driver with chip select. Does one exist?
My boards currently update fine from PropPlug, but the users hate doing it. With this project, I want to load a massaged BIN file from PC to P2 RAM via the normal serial console, check it, write it to serial Flash, and reboot. No more dongles unless something goes wrong.
Comments
It's not I2C, it's SPI. I've attached a little P2 flash reader program that I wrote for myself as I'm working on a P2-based product that needs to store values and I don't need a full-blown flash file system -- though I can use it with this. In my app, the second 512K in flash is concerted Data memory for the app.
A not about flash. You can't write an arbitrary value to the flash unless it's erased ($FF). The smallest chuck of flash that can be erased is 4K.
Thank you sir. It works for me.