打印
[STM8]

编程空间到底怎么看?

[复制链接]
3282|10
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
shuishuo615|  楼主 | 2012-8-1 17:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
在选型的时候,有一个编程空间,应该就是指Flash吧?比如stm8S103P2的编程空间是4K

这个4k对应 哪个文件?我怎么确保我的程序没有超过4K?在哪里可以看到用了多少?

上网搜了下没找到看的很明白的答案。。。。特来求助
沙发
qiujiahongde| | 2012-8-1 21:10 | 只看该作者
程序编译的时候都能看到你的FLASH占用大小!!

使用特权

评论回复
板凳
shuishuo615|  楼主 | 2012-8-2 13:11 | 只看该作者
2# qiujiahongde


不知道在那里看!!
望告知

使用特权

评论回复
地板
IJK| | 2012-8-2 14:14 | 只看该作者
看编译后生成的.map文件

使用特权

评论回复
5
shuishuo615|  楼主 | 2012-8-3 11:20 | 只看该作者
4# IJK
好吧,是要打开看的是么。。。
麻烦帮忙看看,是哪个数据? stvd_project.zip (1.76 KB)

使用特权

评论回复
6
IJK| | 2012-8-3 11:31 | 只看该作者
可以把 .map文件 相关部分(文件很大,不要全部贴出来)贴出来看看。
另外,不同的C编译器,生成的 .map文件 格式不一样。

使用特权

评论回复
7
shuishuo615|  楼主 | 2012-8-3 12:58 | 只看该作者
6# IJK

Map of Debug\stvd_project.sm8 from link file Debug\stvd_project.lkf - Wed Aug 01 13:56:42 2012


                               --------
                               Segments
                               --------

start 00008080 end 00008080 length     0 segment .const
start 00008083 end 000081ad length   298 segment .text
start 00004000 end 00004000 length     0 segment .eeprom
start 00000000 end 00000000 length     0 segment .bsct
start 00000000 end 00000006 length     6 segment .ubsct
start 00000006 end 00000006 length     0 segment .bit
start 00000006 end 00000006 length     0 segment .share
start 00000100 end 00000100 length     0 segment .data
start 00000100 end 00000100 length     0 segment .bss
start 00000000 end 000012f6 length  4854 segment .debug
start 00008000 end 00008080 length   128 segment .const
start 00008080 end 00008083 length     3 segment .init


                               -------
                               Modules
                               -------

D:\Program Files\CXSTM8\Lib\crtsi0.sm8:
start 00008083 end 000080ce length    75 section .text
start 00000100 end 00000100 length     0 section .bss
start 00000000 end 00000000 length     0 section .ubsct

Debug\main.o:
start 000080ce end 000080f9 length    43 section .text
start 00000000 end 00000100 length   256 section .debug

Debug\stm8s_it.o:
start 000080f9 end 00008110 length    23 section .text
start 00000100 end 000007c6 length  1734 section .debug

Debug\stm8s_gpio.o:
start 00008110 end 000081ad length   157 section .text
start 000007c6 end 000011d0 length  2570 section .debug

(D:\Program Files\CXSTM8\Lib\libm0.sm8)xreg.o:
start 00000000 end 00000003 length     3 section .ubsct

(D:\Program Files\CXSTM8\Lib\libm0.sm8)yreg.o:
start 00000003 end 00000006 length     3 section .ubsct

Debug\stm8_interrupt_vector.o:
start 000011d0 end 000012f6 length   294 section .debug
start 00008000 end 00008080 length   128 section .const


                             -----------
                             Stack usage
                             -----------

Debug\main.o:
_Delay                                  4   (4)
_main                              >    8   (2)

Debug\stm8s_gpio.o:
_GPIO_DeInit                       >    2   (2)
_GPIO_ExternalPullUpConfig         >    6   (6)
_GPIO_Init                              6   (6)
_GPIO_ReadInputData                >    2   (2)
_GPIO_ReadInputPin                 >    5   (5)
_GPIO_ReadOutputData               >    2   (2)
_GPIO_Write                        >    5   (5)
_GPIO_WriteHigh                    >    5   (5)
_GPIO_WriteLow                     >    5   (5)
_GPIO_WriteReverse                 >    5   (5)

Debug\stm8s_it.o:
f_ADC1_IRQHandler                  >    5   (5)
f_AWU_IRQHandler                   >    5   (5)
f_CLK_IRQHandler                   >    5   (5)
f_EEPROM_EEC_IRQHandler            >    5   (5)
f_EXTI_PORTA_IRQHandler            >    5   (5)
f_EXTI_PORTB_IRQHandler            >    5   (5)
f_EXTI_PORTC_IRQHandler            >    5   (5)
f_EXTI_PORTD_IRQHandler            >    5   (5)
f_EXTI_PORTE_IRQHandler            >    5   (5)
f_I2C_IRQHandler                   >    5   (5)
f_NonHandledInterrupt              >    5   (5)
f_SPI_IRQHandler                   >    5   (5)
f_TIM1_CAP_COM_IRQHandler          >    5   (5)
f_TIM1_UPD_OVF_TRG_BRK_IRQHandler  >    5   (5)
f_TIM2_CAP_COM_IRQHandler          >    5   (5)
f_TIM2_UPD_OVF_BRK_IRQHandler      >    5   (5)
f_TIM3_CAP_COM_IRQHandler          >    5   (5)
f_TIM3_UPD_OVF_BRK_IRQHandler      >    5   (5)
f_TIM4_UPD_OVF_IRQHandler          >    5   (5)
f_TLI_IRQHandler                   >    5   (5)
f_TRAP_IRQHandler                  >    5   (5)
f_UART2_RX_IRQHandler              >    5   (5)
f_UART2_TX_IRQHandler              >    5   (5)

Stack size: 13


                              ---------
                              Call tree
                              ---------
   1 > _GPIO_DeInit: (2)

   2 > _GPIO_ExternalPullUpConfig: (6)

   3 > _GPIO_ReadInputData: (2)

   4 > _GPIO_ReadInputPin: (5)

   5 > _GPIO_ReadOutputData: (2)

   6 > _GPIO_Write: (5)

   7 > _GPIO_WriteHigh: (5)

   8 > _GPIO_WriteLow: (5)

   9 > _GPIO_WriteReverse: (5)

  10 > __stext: (0)

  11 > _main: (2)
  12      + _Delay: (4)
  13      + _GPIO_Init: (6)

  14 > f_ADC1_IRQHandler: (5)

  15 > f_AWU_IRQHandler: (5)

  16 > f_CLK_IRQHandler: (5)

  17 > f_EEPROM_EEC_IRQHandler: (5)

  18 > f_EXTI_PORTA_IRQHandler: (5)

  19 > f_EXTI_PORTB_IRQHandler: (5)

  20 > f_EXTI_PORTC_IRQHandler: (5)

  21 > f_EXTI_PORTD_IRQHandler: (5)

  22 > f_EXTI_PORTE_IRQHandler: (5)

  23 > f_I2C_IRQHandler: (5)

  24 > f_NonHandledInterrupt: (5)

  25 > f_SPI_IRQHandler: (5)

  26 > f_TIM1_CAP_COM_IRQHandler: (5)

  27 > f_TIM1_UPD_OVF_TRG_BRK_IRQHandler: (5)

  28 > f_TIM2_CAP_COM_IRQHandler: (5)

  29 > f_TIM2_UPD_OVF_BRK_IRQHandler: (5)

  30 > f_TIM3_CAP_COM_IRQHandler: (5)

  31 > f_TIM3_UPD_OVF_BRK_IRQHandler: (5)

  32 > f_TIM4_UPD_OVF_IRQHandler: (5)

  33 > f_TLI_IRQHandler: (5)

  34 > f_TRAP_IRQHandler: (5)

  35 > f_UART2_RX_IRQHandler: (5)

  36 > f_UART2_TX_IRQHandler: (5)

  37   _Delay --> 12

  38   _GPIO_Init --> 13



                               -------
                               Symbols
                               -------

_Delay                              000080ce   defined in Debug\main.o section .text
_GPIO_DeInit                        00008110   defined in Debug\stm8s_gpio.o section .text
_GPIO_ExternalPullUpConfig          00008197   defined in Debug\stm8s_gpio.o section .text
_GPIO_Init                          00008118   defined in Debug\stm8s_gpio.o section .text
                                               used in Debug\main.o
_GPIO_ReadInputData                 0000818d   defined in Debug\stm8s_gpio.o section .text
_GPIO_ReadInputPin                  00008190   defined in Debug\stm8s_gpio.o section .text
_GPIO_ReadOutputData                0000818b   defined in Debug\stm8s_gpio.o section .text
_GPIO_Write                         0000816d   defined in Debug\stm8s_gpio.o section .text
_GPIO_WriteHigh                     00008175   defined in Debug\stm8s_gpio.o section .text
_GPIO_WriteLow                      0000817c   defined in Debug\stm8s_gpio.o section .text
_GPIO_WriteReverse                  00008184   defined in Debug\stm8s_gpio.o section .text
__endmem                            000005ff   defined in command file
                                               *** not used ***
__endzp                             00000006   defined in command file section .ubsct
                                               used in D:\Program Files\CXSTM8\Lib\crtsi0.sm8
__idesc__                           00008080   defined in linker section .init
                                               used in D:\Program Files\CXSTM8\Lib\crtsi0.sm8
__memory                            00000100   defined in command file section .bss
                                               used in D:\Program Files\CXSTM8\Lib\crtsi0.sm8
__stack                             000007ff   defined in command file
                                               used in D:\Program Files\CXSTM8\Lib\crtsi0.sm8
__startmem                          00000100   defined in command file section .bss
                                               *** not used ***
__stext                             00008083   defined in D:\Program Files\CXSTM8\Lib\crtsi0.sm8 section .text
                                               used in Debug\stm8_interrupt_vector.o
__vectab                            00008000   defined in Debug\stm8_interrupt_vector.o section .const
_exit                               000080cc   defined in D:\Program Files\CXSTM8\Lib\crtsi0.sm8 section .text
_main                               000080da   defined in Debug\main.o section .text
                                               used in D:\Program Files\CXSTM8\Lib\crtsi0.sm8
c_x                                 00000000   defined in (D:\Program Files\CXSTM8\Lib\libm0.sm8)xreg.o section .ubsct
                                               used in D:\Program Files\CXSTM8\Lib\crtsi0.sm8
c_y                                 00000003   defined in (D:\Program Files\CXSTM8\Lib\libm0.sm8)yreg.o section .ubsct
                                               used in D:\Program Files\CXSTM8\Lib\crtsi0.sm8
f_ADC1_IRQHandler                   0000810d   defined in Debug\stm8s_it.o section .text
                                               used in Debug\stm8_interrupt_vector.o
f_AWU_IRQHandler                    000080fc   defined in Debug\stm8s_it.o section .text
                                               used in Debug\stm8_interrupt_vector.o
f_CLK_IRQHandler                    000080fd   defined in Debug\stm8s_it.o section .text
                                               used in Debug\stm8_interrupt_vector.o
f_EEPROM_EEC_IRQHandler             0000810f   defined in Debug\stm8s_it.o section .text
                                               used in Debug\stm8_interrupt_vector.o
f_EXTI_PORTA_IRQHandler             000080fe   defined in Debug\stm8s_it.o section .text
                                               used in Debug\stm8_interrupt_vector.o
f_EXTI_PORTB_IRQHandler             000080ff   defined in Debug\stm8s_it.o section .text
                                               used in Debug\stm8_interrupt_vector.o
f_EXTI_PORTC_IRQHandler             00008100   defined in Debug\stm8s_it.o section .text
                                               used in Debug\stm8_interrupt_vector.o
f_EXTI_PORTD_IRQHandler             00008101   defined in Debug\stm8s_it.o section .text
                                               used in Debug\stm8_interrupt_vector.o
f_EXTI_PORTE_IRQHandler             00008102   defined in Debug\stm8s_it.o section .text
                                               used in Debug\stm8_interrupt_vector.o
f_I2C_IRQHandler                    0000810a   defined in Debug\stm8s_it.o section .text
                                               used in Debug\stm8_interrupt_vector.o
f_NonHandledInterrupt               000080f9   defined in Debug\stm8s_it.o section .text
                                               used in Debug\stm8_interrupt_vector.o
f_SPI_IRQHandler                    00008103   defined in Debug\stm8s_it.o section .text
                                               used in Debug\stm8_interrupt_vector.o
f_TIM1_CAP_COM_IRQHandler           00008105   defined in Debug\stm8s_it.o section .text
                                               used in Debug\stm8_interrupt_vector.o
f_TIM1_UPD_OVF_TRG_BRK_IRQHandler   00008104   defined in Debug\stm8s_it.o section .text
                                               used in Debug\stm8_interrupt_vector.o
f_TIM2_CAP_COM_IRQHandler           00008107   defined in Debug\stm8s_it.o section .text
                                               used in Debug\stm8_interrupt_vector.o
f_TIM2_UPD_OVF_BRK_IRQHandler       00008106   defined in Debug\stm8s_it.o section .text
                                               used in Debug\stm8_interrupt_vector.o
f_TIM3_CAP_COM_IRQHandler           00008109   defined in Debug\stm8s_it.o section .text
                                               used in Debug\stm8_interrupt_vector.o
f_TIM3_UPD_OVF_BRK_IRQHandler       00008108   defined in Debug\stm8s_it.o section .text
                                               used in Debug\stm8_interrupt_vector.o
f_TIM4_UPD_OVF_IRQHandler           0000810e   defined in Debug\stm8s_it.o section .text
                                               used in Debug\stm8_interrupt_vector.o
f_TLI_IRQHandler                    000080fb   defined in Debug\stm8s_it.o section .text
                                               used in Debug\stm8_interrupt_vector.o
f_TRAP_IRQHandler                   000080fa   defined in Debug\stm8s_it.o section .text
                                               used in Debug\stm8_interrupt_vector.o
f_UART2_RX_IRQHandler               0000810c   defined in Debug\stm8s_it.o section .text
                                               used in Debug\stm8_interrupt_vector.o
f_UART2_TX_IRQHandler               0000810b   defined in Debug\stm8s_it.o section .text
                                               used in Debug\stm8_interrupt_vector.o

使用特权

评论回复
8
IJK| | 2012-8-3 14:11 | 只看该作者
这是COSMIC C编译器生成的map文件,看这些就够了:
start 00008080 end 00008080 length     0 segment .const
start 00008083 end 000081ad length   298 segment .text

使用特权

评论回复
9
shuishuo615|  楼主 | 2012-8-5 16:34 | 只看该作者
8# IJK
哦,谢谢,298的单位是byte吗?

使用特权

评论回复
10
figo20042005| | 2012-8-5 21:03 | 只看该作者
感觉编译软件给统计下最后,像MPLAB那样最好

使用特权

评论回复
11
IJK| | 2012-8-6 09:45 | 只看该作者
8# IJK
哦,谢谢,298的单位是byte吗?
shuishuo615 发表于 2012-8-5 16:34


对的。

298 = 0x81ad - 0x8083

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

8

主题

66

帖子

0

粉丝