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

Discussion around product based on ARM Cortex M3 core.

Moderators: nferre, ncollot

MatsSoder
Posts: 1
Joined: Thu Nov 17, 2011 11:25 pm

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

Thu Nov 17, 2011 11:40 pm

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
incognito
Posts: 32
Joined: Tue Jul 13, 2010 12:54 pm

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

Fri Nov 18, 2011 10:14 am

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.
CptTitanic
Posts: 871
Joined: Sat Oct 30, 2010 6:04 pm

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

Fri Nov 18, 2011 4:59 pm

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.

Return to “SAM3 Cortex-M3 MCU”

Who is online

Users browsing this forum: No registered users and 2 guests