I have written a bootloader to run in the TMS470M. if the bootloader decides that all is well, and the system should run application code, I would like to branch to the start of the application by loading the stack pointer, then program counter from the first 8 bytes of the application code.... i.e repicate the standard POR behaviour, and simplify the development of applications. my application will simply include standard startup code and vector table, which I can run as if it was a normal POR. The bootloader then loads the value at start of the application vector table and off it goes!
I'm not great at assembler, and I am struggling to find the correct instruction to load the SP and PC. Has anyone any example, or pointers? thanks. Phil
No problem. The PC and SP are registers r15 and r13 respectively and you can use MOV, LDR etc instructions to load them. These instructions are typically in ARM mode.
LDR PC, label
label .word <addr>
You can also say SP in place of PC.
The label should be within -4096 to 4095 bytes of the PC.
You can look in this location for more info:
You can also MOV into PC/SP or do other operations
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.