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

Booting firmware image through bootloader

Hi!

I am working on lpc1837 based project, in which I have a bootloader that should load a firmware image.

The firmware works with RTX kernel and bootloader doesn't. I had compiled firmware with base address as 0x1a020020 (0x20 bytes from 0x1a020000 used by firmware header info). And I had given the same for bootloader to branch and execute firmware. But this requires that I should handle stack and heap sizes in startup files which I couldn't understand well.

Can anyone help me how to get this?

Thanks in advance.
ChetaN

Parents
  • Hi,

    afaik there is no "magic weappon" finding the proper stack size as investigating your code.
    Our RTX does a stack check, it looks if the magic word it writes to the stack ends has been overwritten.

    You know, that in RTX you can set the generic stack size, but you can also create tasks with a user defined RAM area as stack?

    A good method would be that you manually fill your RAM with a pattern you can identify, and let your program run for a while. Then stop and read all the memory (you must find the task stacks, that can be a bit more tricky ...).
    After that you can see how much stack each task needs...

    If you have no recursive function calls, it should be possible that you calculate the worst case stack through your function calls.

Reply
  • Hi,

    afaik there is no "magic weappon" finding the proper stack size as investigating your code.
    Our RTX does a stack check, it looks if the magic word it writes to the stack ends has been overwritten.

    You know, that in RTX you can set the generic stack size, but you can also create tasks with a user defined RAM area as stack?

    A good method would be that you manually fill your RAM with a pattern you can identify, and let your program run for a while. Then stop and read all the memory (you must find the task stacks, that can be a bit more tricky ...).
    After that you can see how much stack each task needs...

    If you have no recursive function calls, it should be possible that you calculate the worst case stack through your function calls.

Children