Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 04, 2016, 07:11:58 07:11


Login with username, password and session length


Pages: [1]
Print
Author Topic: question about IAR AVR(Define the placment of codes)  (Read 1822 times)
0 Members and 1 Guest are viewing this topic.
Mesfet
Newbie
*
Offline Offline

Posts: 17

Thank You
-Given: 40
-Receive: 6


« on: September 14, 2008, 11:59:30 23:59 »

Hello,
I am looking for to find a way to define the placement of codes, for instance , I want to write bootloader program and as you well know , these codes have to be placed in specific address  , Also, I want to know how can call this function which will be placed in specific address , is there any differences between calling the normal functions and this kind of functions?

Thanks in Advance
Logged
MYXATA
Newbie
*
 Muted
Offline Offline

Posts: 30

Thank You
-Given: 10
-Receive: 5


« Reply #1 on: September 15, 2008, 09:48:21 21:48 »

This is my bootloader writen for IAR. There is on way to make bootloader.
Logged
pablo2048
Active Member
***
Offline Offline

Posts: 103

Thank You
-Given: 96
-Receive: 82


« Reply #2 on: September 16, 2008, 08:31:52 08:31 »

Hello,
I am looking for to find a way to define the placement of codes, for instance , I want to write bootloader program and as you well know , these codes have to be placed in specific address  , Also, I want to know how can call this function which will be placed in specific address , is there any differences between calling the normal functions and this kind of functions?

Thanks in Advance

I'm not realy sure, but try to use "#pragma location=" (interrupts are defined by #pragma vector=), maybe this help...
Logged
sam_des
Active Member
***
Offline Offline

Posts: 221

Thank You
-Given: 47
-Receive: 111


« Reply #3 on: September 16, 2008, 08:08:25 20:08 »

Hello,

Quote
I am looking for to find a way to define the placement of codes, for instance , I want to write bootloader program and as you well know , these codes have to be placed in specific address  , Also, I want to know how can call this function which will be placed in specific address , is there any differences between calling the normal functions and this kind of functions?

'#pragma location=foo' or '@' places the functions, whose decleration follows the pragma in segment 'foo'. This way you can set it in a specific segment & you can control segment's address. For this you have to use additional commands to linker in either XCL file or in dialogs of IDE.

It is better for you to read carefully Compiler Ref Manual, specifically topics- 'Controlling Data & Function Placement' and 'User Defined Segments'.

Once done, turn ON all warnings & errors, especially segment overlap warnings and build it. No errors/warnings should be generated. To be sure check the map file & see nothing inCODE overlaps.

regards,
sam_des
Logged

Never be afraid to do something new. Remember Amateurs built the Ark, Professionals built the Titanic !
Mesfet
Newbie
*
Offline Offline

Posts: 17

Thank You
-Given: 40
-Receive: 6


« Reply #4 on: September 18, 2008, 11:05:27 23:05 »

Thanks all,
Dear sam_des , I've red IAR reference , but I think it is sometimes confusing , more than 5 large PDF and another integrated help , and I think I couldn't be success without your help, because you point to exact information that I need, thank you so much.
Besides , I downloaded MYXATA's program , thanks MYXATA so much  , you are really professional program, and thanks for sharing.
Thanks pablo2048 , you are right , but as sam_des describes,  programmers have to edit Xlink configuration file manually to be able define the placement of codes.

regards,
Mesfet
Logged
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC