6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun Nov 24, 2024 8:02 am

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Sat Mar 25, 2017 4:46 am 
Offline

Joined: Sat Dec 13, 2003 3:37 pm
Posts: 1004
So, all the talk on the new board, and it's in built limits, made my eye wander over to the W65C265SXB.

This is essentially the same thing, with a better header, 32K of RAM and a 128K Flash PLCC socket. It's also distinct in that I guess you can plug in a raw USB cable and talk to it serially, whereas with the smaller board, it just exposes the raw serial signals, and you'd need an FTDI empowered cable to talk to it.

Looking around a bit, and I found this family of flash chips:

http://ww1.microchip.com/downloads/en/D ... 05022C.pdf

Do you think it would be possible to program that on the board? That is, plug in the chip, load some code from the monitor, and be able to program it in place?

I ask because I saw some other chips, and they seemed to require 12v to program, but it doesn't look like that's the case with this one. But I'm not sure if the CE, OE, and WE signals would be correct, as those are driven by the CPU. The same signals go to the RAM. Is that just a normal write operation, nothing special? To write a byte you write several bytes to the chip, to certain addresses in a certain order, and then the address and byte you want to store, and then wait for it to happen.

Is programming it in place a smart idea? I might be worried about "bricking" it by writing a bad program to the flash -- just enough to convince the CPU that there's something there (in the sense that it sees WDC at $00:8000 and jump to $00:8003), but buggy to the point where I never get control back (without yanking the Flash out). So, as long as it's in the socket, the board can't reprogram it. I don't think there's a away to make the board ignore the ROM if its in place.

In that case, it seems straightforward enough to be able to craft a simple programmer with little more than a socket and a bread board, map it in to another section of the memory space, and use that.

Any of this make sense?


Top
 Profile  
Reply with quote  
PostPosted: Sat Mar 25, 2017 7:48 am 
Offline
User avatar

Joined: Tue Nov 16, 2010 8:00 am
Posts: 2353
Location: Gouda, The Netherlands
Yes, these are a common type of flash devices. I've used them several times. As long as you have all the read/write/select signals attached, it's a matter of writing the appropriate code sequences to write a byte or erase a sector.

The flash is divided into 4kB sectors, so what you could do to minimize the chance of bricking is put a secondary bootloader in the first sector, and never overwrite it. The secondary bootloader would then a) verify that main program in second sector is in good shape, and b) checks I/O line for override signal. If the override signal is set, it would not jump into the main program, but enter a monitor mode where you'll be able to fix the flash.


Top
 Profile  
Reply with quote  
PostPosted: Sat Mar 25, 2017 8:45 am 
Offline
User avatar

Joined: Tue Nov 16, 2010 8:00 am
Posts: 2353
Location: Gouda, The Netherlands
Another trick I've used to unbrick a flash like that is to short circuit a few data pins with a small screwdriver while booting up so that the signature bytes don't match. Most devices can handle a brief short like that.


Top
 Profile  
Reply with quote  
PostPosted: Sat Mar 25, 2017 9:14 am 
Offline
User avatar

Joined: Wed Mar 01, 2017 8:54 pm
Posts: 660
Location: North-Germany
Arlet wrote:
Another trick I've used to unbrick a flash like that is to short circuit a few data pins with a small screwdriver while booting up so that the signature bytes don't match. Most devices can handle a brief short like that.

Hehe - tricky :D

In case of the W65C265SXB there are P43 and P44 attached to A15 and A16 of the Flash. Both select lines have a test pad on board (located between the MCU and U5). Grounding one of them briefly during reset should work as well.

Sadly WDC has made no provisions to access pins 1 and 30 of the Flash. This prevents using F020 or F040 devices :(


Top
 Profile  
Reply with quote  
PostPosted: Sat Mar 25, 2017 9:51 am 
Offline
User avatar

Joined: Tue Mar 02, 2004 8:55 am
Posts: 996
Location: Berkshire, UK
My SXB hacker program allows you to program the flash in place on this board. The source code is on git hub.
https://github.com/andrew-jacobs/w65c265sxb-hacker

_________________
Andrew Jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs


Top
 Profile  
Reply with quote  
PostPosted: Sun Mar 26, 2017 4:29 am 
Offline

Joined: Sat Dec 13, 2003 3:37 pm
Posts: 1004
Arlet wrote:
The flash is divided into 4kB sectors, so what you could do to minimize the chance of bricking is put a secondary bootloader in the first sector, and never overwrite it. The secondary bootloader would then a) verify that main program in second sector is in good shape, and b) checks I/O line for override signal. If the override signal is set, it would not jump into the main program, but enter a monitor mode where you'll be able to fix the flash.


Ok, yea, that makes sense. Maintain a trusted bootloader, stage the boot, and then add a jumper that can be last resort checked to abort the flash startup. That's a good idea.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: viridi and 69 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: