Reply by Rick Collins October 29, 20072007-10-29
--- In A..., "hnwagner66" wrote:
>
> I am using a AT91SAM9261 and external (AT49BV160D 1Mx16 NOR flash) in
> my target. I plan on using the flash as boot & program memory so the
> flash /CE is connected to NCS0. I have not been able to program the
> flash memory. The closest I have gotten is every other word (address
> 0, 4, 8, 12, 16 etc) when programming with Seggers JFlash program
> through the JTAG port. I have been able to connect to the target also
> using the Atmel SAM-BA 2.6 tools but I have not been able to
> successfully configure the SAM-BA tools to erase and write the flash.
> I have been told by Atmel and IAR that this should be possible. Has
> anyone been successful at doing something similar? Any help would be
> appreciated.

Yes, it certainly should be possible. I have built many designs with
external Flash and been able to program them. I didn't look up the
details of your flash chip, but from your description of the problem,
you may have a mismatch on the address lines or the memory interface
might not be initialized correctly. It sounds like the lsb of the
flash is not getting toggled at all. Write a test program that reads
successive addresses in flash and look at the address lines on the
flash chip. It will also help if you use an I/O signal to toggle on
with one access and off with the next. This signal should toggle at
the same rate as the lsb of the flash if everything is correct with
the flash addressing. If you see the lsb not toggling at all or if it
is toggling too slow you have a problem. You might also verify that
your interface is making 16 bit transfers.

Do you have any other external memory like RAM? Does that work
correctly?
Reply by Rick Collins October 29, 20072007-10-29
--- In A..., "hnwagner66" wrote:
>
> Rick, I will try your suggestions and here are the details of how the
> memory is connected to the ARM.
>
> I have the data lines D0-D15 on the flash connected to D0-D15 on the
> ARM. The address lines are A0-A16 on the flash connected to A1-A17
> on the ARM. This is because the flash is only word addressable. /WE
> on the flash goes to NWE on the ARM. /CE on the flash goes to /NCS0
> on the ARM and /OE on the flash goes to NRD on the ARM. I think this
> arrangement follows the static memory interface as outlined in the
> Atmel data sheet for the 9261 (p166, figure 21-4). The only thing
> different is the NBS0 and 1 signals, which I believe are not needed
> because this devices is not byte addressable.

Yes, it sounds as if your memory is connected correctly. But the
interface may be programmed incorrectly. If you are only seeing data
programmed on 32 bit boundaries, then it may not be programmed for 16
bit access. This can be tested using the sequential read code and a
scope or logic analyzer. Also, there may be an issue with how the
code is generated. If you are coding in assembly then you need to
verify your code. If you are coding in C, then you might want to look
at the assembly output to make sure the compiler knows your Flash is
16 bits wide.

In fact, I would bet you a beer that the issue is in the software not
getting translated into the right instructions to access 16 bits at a
time. Again, the sequential read test will be leaving A1 low if this
is the problem.

Let us know what you find.
Reply by hnwagner66 October 29, 20072007-10-29
Rick, I will try your suggestions and here are the details of how the
memory is connected to the ARM.

I have the data lines D0-D15 on the flash connected to D0-D15 on the
ARM. The address lines are A0-A16 on the flash connected to A1-A17
on the ARM. This is because the flash is only word addressable. /WE
on the flash goes to NWE on the ARM. /CE on the flash goes to /NCS0
on the ARM and /OE on the flash goes to NRD on the ARM. I think this
arrangement follows the static memory interface as outlined in the
Atmel data sheet for the 9261 (p166, figure 21-4). The only thing
different is the NBS0 and 1 signals, which I believe are not needed
because this devices is not byte addressable.

--- In A..., "Rick Collins"
wrote:
>
> --- In A..., "hnwagner66" wrote:
> >
> > I am using a AT91SAM9261 and external (AT49BV160D 1Mx16 NOR
flash) in
> > my target. I plan on using the flash as boot & program memory so
the
> > flash /CE is connected to NCS0. I have not been able to program
the
> > flash memory. The closest I have gotten is every other word
(address
> > 0, 4, 8, 12, 16 etc) when programming with Seggers JFlash program
> > through the JTAG port. I have been able to connect to the target
also
> > using the Atmel SAM-BA 2.6 tools but I have not been able to
> > successfully configure the SAM-BA tools to erase and write the
flash.
> > I have been told by Atmel and IAR that this should be possible.
Has
> > anyone been successful at doing something similar? Any help
would be
> > appreciated.
>
> Yes, it certainly should be possible. I have built many designs
with
> external Flash and been able to program them. I didn't look up the
> details of your flash chip, but from your description of the
problem,
> you may have a mismatch on the address lines or the memory interface
> might not be initialized correctly. It sounds like the lsb of the
> flash is not getting toggled at all. Write a test program that
reads
> successive addresses in flash and look at the address lines on the
> flash chip. It will also help if you use an I/O signal to toggle on
> with one access and off with the next. This signal should toggle at
> the same rate as the lsb of the flash if everything is correct with
> the flash addressing. If you see the lsb not toggling at all or if
it
> is toggling too slow you have a problem. You might also verify that
> your interface is making 16 bit transfers.
>
> Do you have any other external memory like RAM? Does that work
> correctly?
>
Reply by hnwagner66 October 29, 20072007-10-29
I am using a AT91SAM9261 and external (AT49BV160D 1Mx16 NOR flash) in
my target. I plan on using the flash as boot & program memory so the
flash /CE is connected to NCS0. I have not been able to program the
flash memory. The closest I have gotten is every other word (address
0, 4, 8, 12, 16 etc) when programming with Seggers JFlash program
through the JTAG port. I have been able to connect to the target also
using the Atmel SAM-BA 2.6 tools but I have not been able to
successfully configure the SAM-BA tools to erase and write the flash.
I have been told by Atmel and IAR that this should be possible. Has
anyone been successful at doing something similar? Any help would be
appreciated.
Thanks in advance.
Henry