Page 1 of 1

SAM3U-EK: Writing flash0 AND flash1 with sam-ba?

Posted: Thu Nov 17, 2011 11:40 pm
by MatsSoder
Hi,

I need to write 200KB of code to a SAM3U4E.
I have made an .lds-file that distributes the code over flash0 and flash1. But how do i program both flash?

Is there some good tool for breaking the .elf file into two separate .bin-files?

Regards

Mats

Re: SAM3U-EK: Writing flash0 AND flash1 with sam-ba?

Posted: Fri Nov 18, 2011 10:14 am
by incognito
If the binary was correctly generated, you should be able to use samba to write the whole file to flash 0. Flash0 and flash1 is contiguous. It is possible with SAMBA to write a file larger than 128k to flash0. The section larger than 128k will then be put in flash 1.

If you really want to hard seperate the binaries, it is also possible to compile 2 projects, with the output elf of the first project as an input to the second compilation so that the second binary/program can make use of the first ones functions. The first binary/program will unfortunately then not have access to the functions of the second binary.

Re: SAM3U-EK: Writing flash0 AND flash1 with sam-ba?

Posted: Fri Nov 18, 2011 4:59 pm
by CptTitanic
Presumably you could just use objdump, and have it generate a binary or hex file. Either could then be subdivided into the two regions of interest.

Writing a splitter in C should be a relatively trivial task.