This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

P89LV51RD2 IAP Bootloader

Hi, I would like to use the IAP feature for firmware upgrade in future for bug fixs. But how do I organise my code such that I have a portion "bootloader" that is fixed, and the rest of the code are upgradeable ??

I have tried using the linker option to set my bootloader function at address 0x1000, and the rest of my functions at 0x2000 onwards. But I check the .hex file, what happen is when I changed something in the main body function, the 0x1000 address code also changed.

How should I go about it in implementing a "bootloader" section and upgradeable portion of code???

Thank You !!


Jerry Yeo

Parents
  • "I deliver FlashMagic "packed" into a .bat file with the needed parametres for upgrades, they require NO technical skills."

    I know what feedback I'd get if I did that:
    'What's a batch file?'

    In any case, we have to provide equipment that insulates the user from this sort of nitty gritty. Also, a lot of our stuff connects to the PC via one or more proprietry interfaces or perhaps via a network. There is no possibility whatsoever that someone can just go and hook the thing up to a laptop serial port.

Reply
  • "I deliver FlashMagic "packed" into a .bat file with the needed parametres for upgrades, they require NO technical skills."

    I know what feedback I'd get if I did that:
    'What's a batch file?'

    In any case, we have to provide equipment that insulates the user from this sort of nitty gritty. Also, a lot of our stuff connects to the PC via one or more proprietry interfaces or perhaps via a network. There is no possibility whatsoever that someone can just go and hook the thing up to a laptop serial port.

Children
  • 'What's a batch file?'

    aka a .bat file

    Of course, you make a nice interface to run it so the windiots do not have a problem.

    Erik

    windiot: someone that can not imagine anything that does not have a windows icon, clicking 'start' will not do.

  • "'What's a batch file?'

    aka a .bat file"

    Yes, I do know what a batch file is. My point is that 9 out of 10 customers don't.

  • Yes, I do know what a batch file is. My point is that 9 out of 10 customers don't.
    Which is why I "pack" it nicely for the windiots.

    So, The point is that a "nicely packed" .bat file using FlashMagic requires nothing beyond ordinary windiot operations, so, thus it is proven that there is absolutotally no reason to reinvent the wheel as I stated in an earlier post.

    It is so darn easy to start reinventing the wheel instead of spending a bit of time to find a way to use the wheel you have.

    Erik

  • "So, The point is that a "nicely packed" .bat file using FlashMagic requires nothing beyond ordinary windiot operations, so, thus it is proven that there is absolutotally no reason to reinvent the wheel as I stated in an earlier post."

    So you still can't see that there are situations where FlashMagic is not a suitable solution?

  • So you still can't see that there are situations where FlashMagic is not a suitable solution?
    No, I can't, you show me

    Erik

  • I don't know what Stefan does. Personally, I'd be inclined to try your method, but here's an example:

    My company produces controls that can all be networked together using a "FieldBus" and connected to a central visualization system / PLC, etc. It might be nice if one could simply load a new application for the controls to the visualization system and then have that device "push" the update out to the controllers. Assuming the visualization system isn't based on an x86, FlashMagic will be of little use.

    Using the bootloader in the chip is still a good idea, but having a custom frontend isn't necessarily a bad idea.

  • Using the bootloader in the chip is still a good idea, but having a custom frontend isn't necessarily a bad idea.
    No "bad idea" suggested, just so many reinvent the wheel when they do not immediately see the possibility of using the existing.

    I think Stefan and the undersigned are in the usual "discussion": should you question the motives of the OP or not.

    Erik

  • "No, I can't, you show me"

    I already have. Re-read my third post in this thread.

  • "I think Stefan and the undersigned are in the usual "discussion": should you question the motives of the OP or not."

    Not at all, feel free to question. I was merely pointing out that there are occasions when FlashMagic is not the solution.

    It might be a little nicer if you asked something like:

    "Please explain why you want to write your own bootloader rather than use the existing bootloader with FlashMagic"

    rather than:

    "WHY, oh why do you muck with this."

  • It might be a little nicer if you asked something like:

    "Please explain why you want to write your own bootloader rather than use the existing bootloader with FlashMagic"

    rather than:

    "WHY, oh why do you muck with this."


    Sure, but that would not be honest. I really want to know "why the OP muck with this" because I consider reinventing wheels "mucking with stuff"

    Erik

  • hello every body in this thread,
    I have gone through the whole thread and am once again forwarding a related query

    I have sucessfully tried to activate the iap facility and have created a pc side application and a bootloader located at f7fdh
    in the IC now this bootloader in synchronism with pc side application and downloads a file (its an application program compiled in kiel)in the flash at 50h location as specified by me
    I am givinging a call to the startup location+50 of the app prog(checked in .m51)
    from my bootloader
    Now if the app prog loaded is a simple prog like send some charc to serial by polling
    it is working
    however when i include a timer interrupt
    it creates a different situation n does not execute, though i have tried to compile the prog with interrupt vector at 00 and code at 5000 loction and i am writing the desired jumps (02004d) at the 0b location using the iap routine (its timer0 interrupt) the code does not execute.
    could anyone guide with the same.

  • does the program work if you load ir with FlashMagic ?
    that would be the first question

    Erik

  • yes the prog works if loaded through flash magic
    Ansh

  • n yes also as i m locating the prog at 50
    i m writing the jump adress at the vector table locations

  • hey everybody,
    I have done it?
    its working
    Ansh ambedkar