设置界面如下:
一下是运行的Log:
target remote localhost:3333
0x0800210c in TIM_SelectMasterSlaveMode (TIMx=0xa5a5a5a5, TIM_MasterSlaveMode=42405) at STM32F10xFWLib/src/stm32f10x_tim.c:1627
1627 tmpsmcr &= SMCR_MSM_Mask;
monitor flash write_image C:\Projects\FreeRTOS\Demo\CORTEX_STM32Fxxx_Eclipse\RTOSDemo\RTOSDemo.bin 0x08000000 bin
Sending packet: $qRcmd,666c6173682077726974655f696d61676520433a5c5c50726f6a656374735c5c4672656552544f535c5c44656d6f5c5c434f525445585f53544d3332467878785f45636c697073655c5c52544f5344656d6f5c5c52544f5344656d6f2e62696e20307830383030303030302062696e#38...Packet received: O
Packet received: O6e6f7420656e6f75676820776f726b696e67206172656120617661696c61626c65287265717565737465642031363338342c2066726565203136333336290a
Timed out.
Packet received: O77726f746520323734363420627974652066726f6d2066696c6520433a5c50726f6a656374735c4672656552544f535c44656d6f5c434f525445585f53544d3332467878785f45636c697073655c52544f5344656d6f5c52544f5344656d6f2e62696e20696e20322e32303331323573202831322e313733373539206b622f73290a
Packet received: O0a
Packet received: OK
Sending packet: $m2000040c,4#86...Packet received: 4ff00003
Sending packet: $m300f04e,4#8f...Packet received: 00000000
Sending packet: $m2000040c,4#86...Packet received: 4ff00003
Sending packet: $m2000040c,4#86...Packet received: 4ff00003
Sending packet: $m2000040c,4#86...Packet received: 4ff00003
Sending packet: $m2000040c,4#86...Packet received: 4ff00003
Sending packet: $m300f04e,4#8f...Packet received: 00000000
Sending packet: $m2000040c,4#86...Packet received: 4ff00003
Sending packet: $m2000040c,4#86...Packet received: 4ff00003
Sending packet: $m80020dc,2#8c...Packet received: 70b5
Sending packet: $m80020de,2#8e...Packet received: 0546
Sending packet: $m80020e0,2#5a...Packet received: 0c46
Sending packet: $m80020e2,2#5c...Packet received: 0b1e
Sending packet: $m80020e4,2#5e...Packet received: 18bf
Sending packet: $m80020e6,2#60...Packet received: 0123
Sending packet: $m80020e8,2#62...Packet received: 8029
Sending packet: $m80020ea,2#8b...Packet received: 0cbf
Sending packet: $m80020ec,2#8d...Packet received: 0023
Sending packet: $m80020ee,2#8f...Packet received: 03f0
Sending packet: $m80020f0,2#5b...Packet received: 0103
Sending packet: $m80020f2,2#5d...Packet received: 3bb1
Sending packet: $m80020f4,2#5f...Packet received: 46f6
Sending packet: $m80020f6,2#61...Packet received: 4820
Sending packet: $m80020f8,2#63...Packet received: c0f6
Sending packet: $m80020fa,2#8c...Packet received: 0000
Sending packet: $m80020fc,2#8e...Packet received: 40f2
Sending packet: $m80020fe,2#90...Packet received: 5661
Sending packet: $m8002100,2#26...Packet received: fef7
Sending packet: $m8002102,2#28...Packet received: 06f8
Sending packet: $m8002104,2#2a...Packet received: 2b89
Sending packet: $m8002106,2#2c...Packet received: 23f0
Sending packet: $m8002108,2#2e...Packet received: 8803
Sending packet: $m800210a,2#57...Packet received: 4fea
Sending packet: $m800210c,2#59...Packet received: 0343
Sending packet: $m800210e,2#5b...Packet received: 4fea
Sending packet: $m8002110,2#27...Packet received: 1343
Sending packet: $m8002112,2#29...Packet received: 44ea
Sending packet: $m8002114,2#2b...Packet received: 0303
Sending packet: $m8002116,2#2d...Packet received: 2b81
Sending packet: $m8002118,2#2f...Packet received: 70bd
Sending packet: $m800210c,2#59...Packet received: 0343
Sending packet: $m800210e,2#5b...Packet received: 4fea
Sending packet: $m8002110,2#27...Packet received: 1343
Sending packet: $m8002112,2#29...Packet received: 44ea
Sending packet: $m8002114,2#2b...Packet received: 0303
Sending packet: $m8002116,2#2d...Packet received: 2b81
Sending packet: $m8002118,2#2f...Packet received: 70bd
Sending packet: $m800211a,2#58...Packet received: c046
Sending packet: $m800211c,2#5a...Packet received: 70b5
Sending packet: $m800211e,2#5c...Packet received: 0546
Sending packet: $m8002120,2#28...Packet received: 0c46
Sending packet: $m8002122,2#2a...Packet received: a1f1
Sending packet: $m8002124,2#2c...Packet received: 0403
Sending packet: $m8002126,2#2e...Packet received: 9bb2
Sending packet: $m8002128,2#30...Packet received: 032b
Sending packet: $m800212a,2#59...Packet received: 07d9
Sending packet: $m800212c,2#5b...Packet received: 46f6
Sending packet: $m800212e,2#5d...Packet received: 4820
Sending packet: $m8002130,2#29...Packet received: c0f6
Sending packet: $m8002132,2#2b...Packet received: 0000
Sending packet: $m8002134,2#2d...Packet received: 4ff4
Sending packet: $m8002136,2#2f...Packet received: c761
Sending packet: $m8002138,2#31...Packet received: fdf7
Sending packet: $m800213a,2#5a...Packet received: eaff
Sending packet: $m800213c,2#5c...Packet received: 2b89
Sending packet: $m800213e,2#5e...Packet received: 23f0
Sending packet: $m8002140,2#2a...Packet received: 0f03
Sending packet: $m8002142,2#2c...Packet received: 4fea
Sending packet: $m8002144,2#2e...Packet received: 0343
Sending packet: $m8002146,2#30...Packet received: 4fea
Sending packet: $m8002148,2#32...Packet received: 1343
Sending packet: $m800214a,2#5b...Packet received: 44ea
Sending packet: $m800214c,2#5d...Packet received: 0303
Sending packet: $m800214e,2#5f...Packet received: 2b81
Sending packet: $m8002150,2#2b...Packet received: 70bd
Sending packet: $m8002152,2#2d...Packet received: c046
Sending packet: $m8002154,2#2f...Packet received: 70b5
Sending packet: $m8002156,2#31...Packet received: 0546
Sending packet: $m8002158,2#33...Packet received: 0c46
Sending packet: $m800215a,2#5c...Packet received: b1f1
Sending packet: $m800215c,2#5e...Packet received: 1003
Sending packet: $m800215e,2#60...Packet received: 18bf
Sending packet: $m8002160,2#2c...Packet received: 0123
Sending packet: $m8002162,2#2e...Packet received: 0029
Sending packet: $m8002164,2#30...Packet received: 0cbf
Sending packet: $m8002166,2#32...Packet received: 0023
Sending packet: $m8002168,2#34...Packet received: 03f0
Sending packet: $m800216a,2#5d...Packet received: 0103
Sending packet: $m800216c,2#5f...Packet received: 2bb3
Sending packet: $m800216e,2#61...Packet received: b1f1
Sending packet: $m8002170,2#2d...Packet received: 3003
Breakpoint 43 at 0x8000114: file main.c, line 143.
b main
monitor reset init
Sending packet: $qRcmd,726573657420696e6974#7d...Packet received: O
Packet received: O
Packet received: O4a544147207461703a2073746d33322e637075207461702f64657669636520666f756e643a203078336261303034373720284d616e7566616374757265723a2030783233622c20506172743a203078626130302c2056657273696f6e3a20307833290a
Packet received: O4a544147205461702f646576696365206d6174636865640a
Packet received: O4a544147207461703a2073746d33322e6273207461702f64657669636520666f756e643a203078313634313030343120284d616e7566616374757265723a2030783032302c20506172743a203078363431302c2056657273696f6e3a20307831290a
Packet received: O4a544147205461702f646576696365206d6174636865640a
Packet received: O
Packet received: O7461726765742073746174653a2068616c7465640a
Packet received: O7461726765742068616c7465642064756520746f2064656275672d726571756573742c2063757272656e74206d6f64653a20546872656164200a785053523a20307830313030303030302070633a20307830383030363638300a
Packet received: O0a
Packet received: OK
确认了一下启动执行的顺序:
1.读取PC值
0x0800210c in TIM_SelectMasterSlaveMode (TIMx=0xa5a5a5a5, TIM_MasterSlaveMode=42405) at STM32F10xFWLib/src/stm32f10x_tim.c:1627
1627 tmpsmcr &= SMCR_MSM_Mask;
这个PC值是芯片当前halt的PC位置。
2.doLoadImage,载入镜像(这里是Flash镜像),也就是下载Flash到芯片中去。
monitor flash write_image C:\Projects\FreeRTOS\Demo\CORTEX_STM32Fxxx_Eclipse\RTOSDemo\RTOSDemo.bin 0x08000000 bin
Sending packet: $qRcmd,666c6173682077726974655f696d61676520433a5c5c50726f6a656374735c5c4672656552544f535c5c44656d6f5c5c434f525445585f53544d3332467878785f45636c697073655c5c52544f5344656d6f5c5c52544f5344656d6f2e62696e20307830383030303030302062696e#38...Packet received: O
Packet received: O6e6f7420656e6f75676820776f726b696e67206172656120617661696c61626c65287265717565737465642031363338342c2066726565203136333336290a
Timed out.
Packet received: O77726f746520323734363420627974652066726f6d2066696c6520433a5c50726f6a656374735c4672656552544f535c44656d6f5c434f525445585f53544d3332467878785f45636c697073655c52544f5344656d6f5c52544f5344656d6f2e62696e20696e20322e32303331323573202831322e313733373539206b622f73290a
Packet received: O0a
Packet received: OK
这里由于Flash下载的使劲比较长,所以产生了一次Timed out。
3.b main,在main函数入口处设置断点
4.monitor reset init,重启STM32,并在停止在第一条指令
5.问题就在这里了,重启后,Eclipse仍旧认为PC值为在第一步中读取到的0x0800210c,调试界面的内容是0x0800210c上的内容。
但这是实际的PC指针应该在新的程序的第一条指令上。这时,按下F8(resume),结果也确定停在了main函数上。
有谁知道怎么解决这个问题。
文章评论(0条评论)
登录后参与讨论