一.在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

 

posted on 2025-12-11 09:12  WCH蓝牙应用分享  阅读(5)  评论(0)    收藏  举报