This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

M29F040B access problem...

i'm using the MCB167 NET Evaluation board which uses M29F040B flash-chip as external memmory.
i've written the following device driver for program a word on the flash chip. the data has been written onto RAM instead of the flash.i feel the problem may be with the device driver.
what i've to do if i want to write the data onto the flash chip. it will be very helpful if you address this problem.

Flash_Write PROC NEAR

EXTS R9, #01H
MOV [R8], R10
RET

Flash_Write ENDP

Note: CS0# is checked. WRL# and WRH# are enabled. SALSEL CSCFG and etc. are configured. but still...

Parents
  • The code fragment you've posted makes little sense to me. Sign extend 1 into R9, then move R10 to whereever R8 points, and that's it?

    This flash device is programmed with what I think of as the "AMD style" of commands. You have to present a particular sequence of inputs to the flash as a program command. You do not simply store data to an address, as you do with RAM. It takes three writes to set up the program command, followed by the actual address and data you want to program.

    Note that you must erase a flash sector before programming a word in that sector. Programming flash can really only set bits to 0. Erasing a sector sets all the bits to 1, so that later programming commands can set some of the bits to 0. You can only program a word once after you erase the sector (unless you're doing something clever and you know you just need to zero some extra bits).

    Make sure that the operations on your processor bus actually match the device bus width. That is, if you have a 16-bit wide device, then you do not want to write a value as two successive 8-bit writes.

    I notice after a quick check of Google that ST gives you an app note with heavily commented source code for driver routines. (What more could you ask for?)

    http://us.st.com/stonline/books/pdf/docs/6887.pdf

Reply
  • The code fragment you've posted makes little sense to me. Sign extend 1 into R9, then move R10 to whereever R8 points, and that's it?

    This flash device is programmed with what I think of as the "AMD style" of commands. You have to present a particular sequence of inputs to the flash as a program command. You do not simply store data to an address, as you do with RAM. It takes three writes to set up the program command, followed by the actual address and data you want to program.

    Note that you must erase a flash sector before programming a word in that sector. Programming flash can really only set bits to 0. Erasing a sector sets all the bits to 1, so that later programming commands can set some of the bits to 0. You can only program a word once after you erase the sector (unless you're doing something clever and you know you just need to zero some extra bits).

    Make sure that the operations on your processor bus actually match the device bus width. That is, if you have a 16-bit wide device, then you do not want to write a value as two successive 8-bit writes.

    I notice after a quick check of Google that ST gives you an app note with heavily commented source code for driver routines. (What more could you ask for?)

    http://us.st.com/stonline/books/pdf/docs/6887.pdf

Children
No data