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

Bootloader doubts

Hello,
I am working on a USB based bootloader for a LPC 2468. I want to split on chip flash between the bootloader (flash sectors 0-2), while the remaining available would be application code. My problem is that even though I read some of the documentation (linker...), I am not sure how I should address this issue: Do I make new execution regions in my scatter file? Do I use absolute code placement? If somebody could give me a small put to the right direction, that would be great...

Parents
  • this is an interesting failure. I have tried it myself and found out the following, that might be worth reporting to Keil as a bug in the tool chain (unless I'm missing something which is very possible)

    if you have a variable, absolutely positioned in the code using something like this (RealView syntax):

    const unsigned crp __attribute__((section(".ARM.__at_0x1FC"))) = CRP;
    

    or

    const unsigned crp __attribute__((at(0x1FC))) = CRP;
    

    then, if you enable the external memory controller (EMC) via the startup file - the reset vector is no longer mapped to address 0x0 !
    The solution is no use a memory mapped I/O like pointer:

    unsigned *crp = (unsigned*)0x1FC ;
    

    you can try it yourself using the NXP's AN10764 example.

Reply
  • this is an interesting failure. I have tried it myself and found out the following, that might be worth reporting to Keil as a bug in the tool chain (unless I'm missing something which is very possible)

    if you have a variable, absolutely positioned in the code using something like this (RealView syntax):

    const unsigned crp __attribute__((section(".ARM.__at_0x1FC"))) = CRP;
    

    or

    const unsigned crp __attribute__((at(0x1FC))) = CRP;
    

    then, if you enable the external memory controller (EMC) via the startup file - the reset vector is no longer mapped to address 0x0 !
    The solution is no use a memory mapped I/O like pointer:

    unsigned *crp = (unsigned*)0x1FC ;
    

    you can try it yourself using the NXP's AN10764 example.

Children
No data