SAMS70N19 memory organization

1 post / 0 new
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm coding a bootloader for sams70n19 board and I have memory organization as follows - 

bootloader is at: rom (rx)  : ORIGIN = 0x00400000, LENGTH = 0x00010000

application is at: rom (rx) : ORIGIN = 0x00410000, LENGTH = 0x00040000

1.For my bootloader code -
I have also noticed one thing that even thoughstart address ROM as 0x00400000 in ld file, I can see the whole hex data for firmware is present at location 0x00000000 too. Firmware is present at from address 0x00000000 and 0x00400000. So it copies the whole section again?

It's really confusing. What I'm missing in this case?

2. I'm using flash_write and flash_read functions to write application firmware into the ROM locations (which starts from address 0x00410000). 

In ASF in hal_flash.c, they have one error check -


</* Check if the address is valid */

if ((dst_addr > page_size * total_pages) || (dst_addr + length > page_size * total_pages)) {


So dst_address can be max upto 256kb (0x00000000 to 0x0003ffff). If dst_address is bigger than 0x0003fff (in my case application firmware is starting from 0x00410000), it generates invalid address argument error. So I'm not able to access 0x00410000 location.
How to tackle this issue? Am I missing some setting some initialization steps?

Help in this is really appreciated.