Programming Serial Flash

Go To Last Post
8 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hey folks,

 

So I've talked a little previously about needing Serial Flash for a project to store audio/video data.

 

I am wondering on how folks typically go about programming a Serial Flash device. What I am used to with microcontrollers, specifically in the case with Atmel devices, I use the Atmel ICE which handles the ISP commands.

However, specific to the device I have selected (S25FL132K), Cypress does not appear to have a specific tool for programming the devices.

 

I see a lot of Serial Flash Programmers on eBay and the like, but how am supposed to know if any of these tools work with a specific device?

 

My thoughts here were to just create my own tool, which seems to be a recommended solution in this topic over at StackExchange (ugh!): http://electronics.stackexchange.com/questions/51229/how-do-i-write-to-spi-flash-memory

I don't think this would be such a bad idea, as it gives me yet another project to work on, hence expanding my hardware building experience and knowledge. I'm confident I could do it with probably a Mega AVR and UART to communicate with a C# application on PC, and then an SPI interface to feed the commands to the Flash for reading/writing.

 

But my real question for you folks, what do you experts do? Do you or did you create your own tool? I would like to build my own interface for the learning experience but I'm curious what your opinions on all of this is.

 

Thanks.

My digital portfolio: www.jamisonjerving.com

My game company: www.polygonbyte.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well you can use the AVR in the circuit as a "gateway". So you put some factory test/load firmware into the AVR - it listens on a comms interface and programs what it receives into the Serial flash. When done you erase that firmware and replace it with the real application firmware that will operate the product.

 

(there's a strong chance you may be pre-loading some test software anyway - to make sure the device has been constructed correctly - so you might as well add the external flash loader to that).

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for the input, Cliff. I was kind of thinking I would create a secondary device that would work kind of like the Atmel ICE. It could hold the AVR on the target board in reset (to prevent it from trying to read from the serial Flash) while pushing commands to the Flash via a dedicated SPI interface (the PC would communicate with the tool via serial comms). This way the target device would only need an additional 6 or 10 pin SPI header to program the Flash. This way the target board's AVR does not need a comms connection to the PC (whether that's USB or Serial).

 

My thinking here is that makes this a more universal tool that I could use for multiple projects and the target boards wouldn't need dedicated hardware or comms, just an additional header.

 

What do you think?

My digital portfolio: www.jamisonjerving.com

My game company: www.polygonbyte.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What does that actually gain you? The memory chip is connected to the AVR anyway - so why not use that as the "programmer" ?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yeah that is true but as I said, my thinking was just so that the target device would not need the serials comms interface.

 

But I do see your point. Why complicate things with an additional device? I will do it directly with the AVR on the target board, no sense in going crazy for a first draft anyway.

My digital portfolio: www.jamisonjerving.com

My game company: www.polygonbyte.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Jamison wrote:
was just so that the target device would not need the serials comms interface.

But if you have it wired to the AVR surely the application code of the AVR has some code to access/drive it in some way already? True it may just do read access while writing is something additional. But once you can "talk" it's surely fairly easy to add the code to do writes as well?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
surely the application code of the AVR has some code to access/drive it in some way already

Yes, but ultimately the target device won't actually have/need an interface to a PC. It's a game cartridge. Hence my reason for needing a UART interface to the PC so I can create a C# application to write the audio/video data to the Flash. I am only using this data as storage, once it is written to the Serial Flash, the game cartridge will only read from the device.

My digital portfolio: www.jamisonjerving.com

My game company: www.polygonbyte.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

there are tools for Linux that write to these devices via the parallel port (if you have one!). The actual name escapes me at the moment. I've need to use it when I've accidentally zapped the boot loader on a wireless router.