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

Firmware and application cohabitation on the same device

Hello,

I would like to create a firmware and an application running on the same device.

The application needs to call some functions of the firmware. The application can be updated whereas the firmware is still the same.

Therefore, i want to have 2 projects: one for the firmware (C coded) and one for the application (C coded).

I have seen that it's possible to forbid idata, xdata and code area in order to prevent the application to overwrite the firmware and its variables, but I have no clues on how to give my firmware prototype to my application.
Of course parameters and functions' addresses must map with the firmware mapping.

Does anyone have an idea how I can do this?

Thanks for your help!
Damien.

Parents
  • the simple solution would be to abandon all ideas of a 'homemade' bootloader, just compile and link all of it in one piece.

    Then use a chip (there are sooooooo many) with ISP. You can get funky Atmel ISP, serial port ISP, JTAG ISP, USB ISP and probably some other flavors.

    The impression your posts leave is that you are trying to code the '51 as a PC, GIVE IT UP, many have tried and all have failed.

    The '51 is absolutely wonderful when used as intended and absolutely horrible when not.

    Thus either code the '51 as a '51 or use some other chip.

    Erik

Reply
  • the simple solution would be to abandon all ideas of a 'homemade' bootloader, just compile and link all of it in one piece.

    Then use a chip (there are sooooooo many) with ISP. You can get funky Atmel ISP, serial port ISP, JTAG ISP, USB ISP and probably some other flavors.

    The impression your posts leave is that you are trying to code the '51 as a PC, GIVE IT UP, many have tried and all have failed.

    The '51 is absolutely wonderful when used as intended and absolutely horrible when not.

    Thus either code the '51 as a '51 or use some other chip.

    Erik

Children
  • Well, this thread went a bit out of the topic.

    I have to develop on a 73S1113 chip based on 8052, and I have to develop something that can download an application via USB (ISP is deactivated). This is not optional.

    I wanted to know how to be sure that my firmware and my application can cohabit, knowing that I have "only" 64kb of flash and the application will use most of it.

    I understood that there were different methods in order to do this work. The vector table seems interesting and I think I'll choose this method.

    I understood that registers are automatically selected by the compiler (I don't need to worry about it)
    www.keil.com/.../c51_le_passingparmsinregs.htm

    I just have to find how to tell the linker to not use some part of ibit and idata. So far, my attempts were not successful (using IBIT and IDATA linker directive).

    Damien

  • I just have to find how to tell the linker to not use some part of ibit and idata. So far, my attempts were not successful (using IBIT and IDATA linker directive).

    It should be obvoous that if you change the bootloader/BIOS you need to change the app as well, the below requires that.

    write an assembler module with all global BDATA/DATA/IDATA/PDATA/XDATA that the bootloader/BIOS uses and link it with both bootloader/BIOS and app.
    for the bootloader/BIOS write a .h module that defines all variables in the asm module as extern.

    If you want to, you can even link that with the app.

    There will be a requirement that all functions are declared reentrant to make them not use call tree since one will not be aware of the other. If main() can not be declared reentrant there can be no locval variables in main()

    Erik