Passing data from bootloader to main program

Go To Last Post
8 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have a UC3A based system:

Bootloader 0x80000000 - 0x80003FFF
Main program header 0x80004000 - 0x800041FF
Main program 0x80004200 - 0x8000xxxx

The header contains information about the main program including a CRC to verify integrity. Once the bootloader verifies the header it does a procedure call to 0x80004200. This of course starts the normal startup routines and such since the main program is linked to start at 0x80004200.

What I would like to do is pass the 16 bit bootloader version number to the main program. I figure the startup is going to clear out internal RAM so I didn't try that.

What I did try is to store it in the ABDAC data register in the bootloader and then load that in the main program, but it shows up as zero. Not sure what I'm doing wrong there.

What about all those unused system registers? Especially the "Implementation Defined" ones. Do those actually exist and could they be used for this purpose?

Thanks..

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

may be look at PM ?
"13.6.15 General Purpose Low-power register 0/1" for example ?

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

Thanks Maddy, that worked.

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

hai guys , i got a requirement that i need a bootloader that has to copy data from pc to 1st 1/2 (0-5ff) of the flash and when i burn a new program it should write at the next 1/2 (600- bfe)of the flash and startaddress should jump to that location at 600 and again when we write 1st 1/2 should over write and start address jump to 000 it should repeat . so could we write a bootload doing this or not yar. like i am stuck in the middle .
Thanks in advance for the reply in advance.
if any one got an idea or some helpful code please help me guys. :oops:

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

nagella, please don't cross post and please start your own thread when asking questions.

"I may make you feel but I can't make you think" - Jethro Tull - Thick As A Brick

"void transmigratus(void) {transmigratus();} // recursio infinitus" - larryvc

"It's much more practical to rely on the processing powers of the real debugger, i.e. the one between the keyboard and chair." - JW wek3

"When you arise in the morning think of what a privilege it is to be alive: to breathe, to think, to enjoy, to love." -  Marcus Aurelius

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

sorry i am new ok i started in new topic . thanks for rectifying me dude now see whether can you help.na

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

Quote:
i started in new topic
you started another 100 topics!! Please don't do this, I have created a thread for your question. Your posting is almost spam now. :?
https://www.avrfreaks.net/index.p...

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

certsoft can you please send you code to my mail . it may be helpfull for me.