Where is the Default Linker Script

Go To Last Post
113 posts / 0 new

Pages

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

what I am trying to say is, when I call a function the return address is pushed to the stack. 

How can I jump back to the return address with code 

i know I need something like that , but how can i know the adress of tha Stack_ADRESS ?

__asm__ Volatile("jmp Stack_ADRESS");

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

AVATAR_Freaks wrote:
when i jump from the application the SP gets stuck at the bootloader an never come back to the next line

         void do_spm_N (uint16_t page) __attribute__ ((used)) __attribute__ ((naked)) __attribute__((section(".vectors")));
                                                              =======================

 

 

Stefan Ernst

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

sternst wrote:

AVATAR_Freaks wrote:
when i jump from the application the SP gets stuck at the bootloader an never come back to the next line

         void do_spm_N (uint16_t page) __attribute__ ((used)) __attribute__ ((naked)) __attribute__((section(".vectors")));
                                                              =======================

 

 

do you think I should remove __attribute__ ((naked)) ?

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Do you know what it does?? If not (a) why are you using it? and (b) do you think it might be time to consult the user manual?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yea I know, it identifies the function as ASM function. and The reason I included is that I have few lines in my function in __ASM__ 

so I thought i should use it !?!?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

time to read the manual - no point simply guessing

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Okay I was able to fix this problem ! But now I am facing another obstacle !

Is there away to figure out the size of the used Flash Memory by the application code I know when you compile it tells you the size of you app, but I want to be able to save it as a variable and use it to figure out how much free space I have so when I write to flash memory i don't over write my application ?

 

Any suggestions 

 

Last Edited: Wed. Dec 5, 2018 - 01:47 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What I mean is  , How can I calculate the Free Memory space in the Flash memory ? (Using coding language )

the reason is I want to be able to determine how much free space do I have and make sure to not write any more data than this size ?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

One approach is to write a cookie as a marker.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Another approach is to use __data_load_end.

Stefan Ernst

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

yes that works i used the __data_load_end

 

now how can i find the start of my bootloader ?

 

is it possible to pass avariable from the MAKEFILE to the flashmemeory ?

something like __data_load_end but used defined ?

 

 

 

Last Edited: Thu. Dec 6, 2018 - 05:31 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The start of the bootliader is surely at the BOOTSZ address?

Pages