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

Boot ROM Question of NXP LPC17xx

Note: This was originally posted on 9th June 2011 at http://forums.arm.com

Hi,

I am about to use LPC17xx to do some work. But I don't quite understand
it's boot ROM remapping.  According to ARMv7 architecture manual, the
first vector entry (address 0x00 to 0x03) should be value of SP and the
second entry (address 0x04 to 0x07) should be reset entry (the starting
point of the user program). On the other hand, the LPC17xx manual said
that at boot time, a portion of the 8K boot ROM is temporarily remapped
to address 0x00000000.  So I was wondering, what are the values in the
first 16 bytes in boot ROM? And, how a user program is finally get
executed? Where is my stack top?

Thanks in advance if you can give me some clues.

-
narke
Parents
  • Note: This was originally posted on 9th June 2011 at http://forums.arm.com

    Dear Joseph,

    Many thanks for you clear explanation!  I then have two more question raised from your answers.

    1. If so, why we need the boot ROM?  What it did for us?  In the LPC17xx manual, it said, the boot ROM contains flash services. But as I understand, the flash driver is usually implemented as a part of our user firmware.  How to use these service and should we use it?

    2.  You said "... and then execute the program in the flash memory if the flash memory has been programmed (this might also depends on other boot settings)".   What you mean by 'bot settings', I did not see we have any setting to effect boot behavior.  Had I missed something in the manual?


    Thank you again!
    narke

    The first 16 bytes in the boot ROM will contain the vector table for the boot ROM, with the reset vector pointing to the starting address of boot ROM program.  During executing of the boot loader program, it will turn off the remap function at some stage, so that the user program in the flash will appear at the beginning of the memory map, and then execute the program in the flash memory if the flash memory has been programmed (this might also depends on other boot settings).

    Before switching to run the program in flash, the boot loader can read the vector table on the flash memory, and adjust the main stack pointer value accordingly. Then it can read the reset vector in the vector table and branch to this address. In this way, the initial main stack pointer value and starting program address will match the values you placed in the starting of the flash memory.

    This memory remap function is implemented in the bus system of the NXP LPC17xx. It is not inside the processor core, so you cannot find this information from ARM documentation.

    regards,
    Joseph
Reply
  • Note: This was originally posted on 9th June 2011 at http://forums.arm.com

    Dear Joseph,

    Many thanks for you clear explanation!  I then have two more question raised from your answers.

    1. If so, why we need the boot ROM?  What it did for us?  In the LPC17xx manual, it said, the boot ROM contains flash services. But as I understand, the flash driver is usually implemented as a part of our user firmware.  How to use these service and should we use it?

    2.  You said "... and then execute the program in the flash memory if the flash memory has been programmed (this might also depends on other boot settings)".   What you mean by 'bot settings', I did not see we have any setting to effect boot behavior.  Had I missed something in the manual?


    Thank you again!
    narke

    The first 16 bytes in the boot ROM will contain the vector table for the boot ROM, with the reset vector pointing to the starting address of boot ROM program.  During executing of the boot loader program, it will turn off the remap function at some stage, so that the user program in the flash will appear at the beginning of the memory map, and then execute the program in the flash memory if the flash memory has been programmed (this might also depends on other boot settings).

    Before switching to run the program in flash, the boot loader can read the vector table on the flash memory, and adjust the main stack pointer value accordingly. Then it can read the reset vector in the vector table and branch to this address. In this way, the initial main stack pointer value and starting program address will match the values you placed in the starting of the flash memory.

    This memory remap function is implemented in the bus system of the NXP LPC17xx. It is not inside the processor core, so you cannot find this information from ARM documentation.

    regards,
    Joseph
Children
No data