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

AT91SAM7_64 flash problem

I had a look to the Keil\ARM\Flash\AT91SAM7_64 and it looks this code was design to never run.

1. The example finishes with error
2. ProgramPage should be at least in RAM
3. *Flash++ = *((unsigned long *)buf); -> buf should be aligned before get Data abort exception.

Did someone has some working example with Keil AT91SAM7xx and data flash?

Parents
  • As answered: The code you have is expected to be downloaded into RAM through the JTAG interface when you download applications to the unit.

    The code is _not_ intended for inclusion in your own applications.

    So, if you want to copy the code for use in your own application, then you must create a project where the code will be run in an identical way as when downloaded run using the JTAG interface.

    You must make sure that the code runs from RAM - either by manually copying the code, or getting the linker to see it basically as initialized RAM, and decompressing/copying the function to a suitable address in RAM.

    And _you_ have to make sure that the function is supplied with aligned data blocks.

    When you take sample code intended for one problem, and want to use it for a completely different problem, then it is up to you to figure out the needed changes.

    One more: The key flash algorithms are not intended to be run from any main() - but you could possibly modify them for that use.

Reply
  • As answered: The code you have is expected to be downloaded into RAM through the JTAG interface when you download applications to the unit.

    The code is _not_ intended for inclusion in your own applications.

    So, if you want to copy the code for use in your own application, then you must create a project where the code will be run in an identical way as when downloaded run using the JTAG interface.

    You must make sure that the code runs from RAM - either by manually copying the code, or getting the linker to see it basically as initialized RAM, and decompressing/copying the function to a suitable address in RAM.

    And _you_ have to make sure that the function is supplied with aligned data blocks.

    When you take sample code intended for one problem, and want to use it for a completely different problem, then it is up to you to figure out the needed changes.

    One more: The key flash algorithms are not intended to be run from any main() - but you could possibly modify them for that use.

Children