ARTICLE DETAIL

资讯详情

深耕网站建设与运营推广的一线实战洞察。

CH5xx 程序中获取代码大小

CH5xx 程序中获取代码大小

一.在link.ld文件中添加此段程序:

     .end_flash :{PROVIDE( _end_flash = .);}>FLASH AT>FLASH

添加位置如下:

7317a0ba-73a8-4c94-9eb3-4bd05d8a5637

 

二.在程序中获取其大小:

    extern const uint32_t _end_flash[];PRINT("flash end address:%d\n",_end_flash);

 

三.编译结果和打印输出结果对比:

ScreenShot_2025-12-11_090911_572                ScreenShot_2025-12-11_090933_730

 

返回列表