Problem with bootloader and IAR

Discussion around product based on ARM Cortex M3 core.

Moderators: nferre, ncollot

Posts: 9
Joined: Tue Apr 03, 2012 3:34 pm

Problem with bootloader and IAR

Tue Apr 17, 2012 5:57 pm


I have setup a workspace with a bootloader and the main app, in IAR for a SAM3S4C.

The bootloader is in 0x00400000 - 0x00400FFF and the main app is located from 0x00401000 to 0x00402080. The remaining flash memory is used to store the new firmware.

When a new firmware was received, the processor is reseted and the bootloader copies the new firmware over the old one.

I am using the IAR binary output to generate the file which is downloaded to the processor.

Everything is working, download firmware and copy, except that the binary file does not seem to be the correct format.

I expect the first 4 bytes to be the initial value of the stack pointer and the next four to be the reset address. But in the binary file, the reset address is pointing to the bootloader region although I modified the linker script to displace the main app upwards in the flash memory.

Does anybody know how to produce in IAR the file format which can be downloaded directly into the flash memory ?

Best regards,

Nelson Gon\c calves
Posts: 9
Joined: Tue Apr 03, 2012 3:34 pm

Re: Problem with bootloader and IAR

Wed Apr 18, 2012 5:03 pm

Solved the problem, which turned out to be IAR's fault. I have a workspace with both the bootloader and the main app, and during the build (for some reason), the linker uses the bootloader definitions and not those of the main app.

The solution is simply to create two separate workspaces, one for each project.

Return to “SAM3 Cortex-M3 MCU”

Who is online

Users browsing this forum: No registered users and 2 guests