Quantcast
Channel: MSP 低功耗微控制器论坛 - 最近的话题
Viewing all articles
Browse latest Browse all 3634

如何实现MSP432的从bootloader到APP的跳转?

$
0
0

如何实现MSP432的从bootloader到APP的跳转?

Boot程序的MAP安排如下:

*******************************************************************************

*** PLACEMENT SUMMARY***

"A1":  place at 0x00000000 { ro section .intvec };

"P1":  place in [from 0x00000000 to 0x00001fff] { ro };

"P2":  place in [from 0x20000000 to 0x2000ffff] { rw, block CSTACK, block HEAP };

 

  Section            Kind        Address    Size  Object

  -------            ----        -------    ----  ------

"A1":                                      0x144

  .intvec            const    0x00000000   0x144  msp432_startup_ewarm.o [1]

                            - 0x00000144   0x144

*******************************************************************************

 

APP程序的MAP安排如下:

*******************************************************************************

*** RUNTIME MODEL ATTRIBUTES***

CppFlavor       = *

__SystemLibrary = DLib

*******************************************************************************

*** PLACEMENT SUMMARY***

"A1":  place at 0x00002000 { ro section .intvec };

"P1":  place in [from 0x00002000 to 0x0003ffff] { ro };

"P2":  place in [from 0x20000000 to 0x2000ffff] { rw, block CSTACK, block HEAP };

 

  Section             Kind        Address    Size  Object

  -------             ----        -------    ----  ------

"A1":                                       0x144

  .intvec             const    0x00002000   0x144  msp432_startup_ewarm.o [1]

                             - 0x00002144   0x144

*******************************************************************************

 

long App_add = 0x00002000 ;    //应用程序

 

Boot中跳转到APP的子程序为:

void set_pc()

  __set_MSP((*(volatile uint32_t*) App_add) );            //设置栈指针  

  (*(void(*)(void))(*(volatile uint32_t*) (App_add + 4)))();    //APP复位中断地址

}

可是当Boot程序运行到set_pc()时,就进入了Boot程序的IntDefaultHandler(void)中断

了。

在set_pc()中我还应该做些什么?


Viewing all articles
Browse latest Browse all 3634

Trending Articles