Question

In the past few days I've found out that SAM-BA can not only write/read flash/ram, but it can also be used as a bootloader. My question is, how does one know where to put the program so that SAM-BA can run it after initial boot sequence? I couldn't find that information in ANY of pdfs provided as a documentation.

I've found a blog post by Adam Pierce and got a linker script that links the program against RAM. Now the RAM memory is at 0x00200000, but the entry point is linked at 0x00202000 - with an explanation that we need to leave "some" memory for SAM-BA.

Why 0x2000 bytes? How can I be sure if it's the right address, and where can I found some information to confirm this?

Was it helpful?

Solution

It's in section 21 of the datasheet.

21.5 Hardware and Software Constraints

SAM-BA boot copies itself in the SRAM and uses a block of internal SRAM for variables and stacks. The remaining available size for the user code is 122880 bytes for SAM7x512, 57344 bytes for SAM7X256 and 24576 bytes for SAM7X128.

Table 21-4 in that document shows that the user-area start address for all three devices is 0x202000.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top