跳转至内容
  • 版块
  • 最新
  • 标签
  • 热门
折叠
品牌标识

YunTu Forum

YTMicro.com
  1. 主页
  2. Discussion & Question
  3. YTM32B1M系列
  4. B1MD MCAL DIO例程生成的hex文件为什么有0x1FFF8400地址的信息?

B1MD MCAL DIO例程生成的hex文件为什么有0x1FFF8400地址的信息?

已定时 已固定 已锁定 已移动 YTM32B1M系列
3 帖子 2 发布者 73 浏览
  • 从旧到新
  • 从新到旧
  • 最多赞同
登录后回复
此主题已被删除。只有拥有主题管理权限的用户可以查看。
  • piterP 离线
    piterP 离线
    piter
    写于 最后由 编辑
    #1

    Dio_Demo.hex

    c54c19da-ab65-4d71-803f-d5d44ed82e7c-image.png

    1 条回复 最后回复
    0
    • piterP 离线
      piterP 离线
      piter
      写于 最后由 编辑
      #2

      ram区域的东西怎么跑到rom里去了

      1 条回复 最后回复
      0
      • jiankang_wangJ 离线
        jiankang_wangJ 离线
        jiankang_wang
        写于 最后由 编辑
        #3

        您好,多出来的区域是 .bss 段的内容。多出这部分的原因如下:

        ARM® Compiler armclang Reference Guide

        __attribute__((section("name"))) variable attribute
        The section attribute specifies that a variable must be placed in a particular data section.

        Normally, the ARM compiler places the data it generates in sections like .data and .bss. However, you
        might require additional data sections or you might want a variable to appear in a special section, for
        example, to map to special hardware.

        If you use the section attribute, read-only variables are placed in RO data sections, writable variables
        are placed in RW data sections.

        If the section name starts with .bss., the variable is placed in a ZI section.

        ref:Arm document

        根据 armclang 的要求,自定义的 .bss 段名称需要以 .bss 开头。否则会认为该段是 .data 段,而其他的编译器中没有对应的限制。

        MCAL的代码中,定义的段名称类似于.mcal_data,.mcal_bss,不能满足KEIL中的限制,所以都会识别为 data 段。而在对应的 scf 文件中,是通过类似如下代码固定其位置的:

        LR_RAM_0 0x1fff8400
        {
        ...
                mcal_bss_region_start +0  EMPTY 0
                {
                }
                mcal_bss_region +0 NOCOMPRESS
                {
                        *(.mcal_bss)
                }
                mcal_bss_region_end +0  EMPTY 0
                {
                }
        ...
        }
        ScatterAssert(ImageLength(LR_RAM_0) <= 0xF800)
        

        所以这一段 .bss 会被识别成 .data 段的数据,并存放到 load addr 0x1fff8400。


        实际上这部分区域并不会影响程序的实际运行,因为 .bss 段 symbol 的地址是正确的。如果您不想要这部分代码的区域,您可以这样操作:

        1. 替换工程下的 .bss 段名称:
          • .mcal_bss -> .bss.mcal_bss
          • .mcal_bss_no_cacheable -> .bss.mcal_bss_no_cacheable
        2. 在配置工具中 Lock 住 Platform。

        经过上述操作后,生成的代码段中就没有多余的区域了。

        1 条回复 最后回复
        0

      • 云途论坛规则/Yuntu Forum Rules

        发帖前请查看

      • YCT离线License申请流程

        帮助没办法联网的电脑使用YCT

      • YT CONFIG TOOL调查问卷

        帮助改进和优化YT CONFIG TOOL,有机会抽取YTM32B1ME0 EVB哦...

      • demo
        12
        can
        9
        lin stack
        6
        yt-link
        5
        vscode
        3
        adc模块
        2
        i2c
        2
        uuid
        2
        Online Users
        • 登录

        • 登录或注册以进行搜索。
        • 第一个帖子
          最后一个帖子
        0
        • 版块
        • 最新
        • 标签
        • 热门