中文字幕 另类精品,亚洲欧美一区二区蜜桃,日本在线精品视频免费,孩交精品乱子片免费

<sup id="3hn2b"></sup>

    1. <sub id="3hn2b"><ol id="3hn2b"></ol></sub><legend id="3hn2b"></legend>

      1. <xmp id="3hn2b"></xmp>

      2. 新聞中心

        EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計應(yīng)用 > 基于STM32F10x的uC/GUI初始化設(shè)置

        基于STM32F10x的uC/GUI初始化設(shè)置

        作者: 時間:2016-12-02 來源:網(wǎng)絡(luò) 收藏
        STM32F10x Device,ICF使用外部SRAM,Heap放入SRAM中。

        /*-Memory Regions-*/

        本文引用地址:http://www.antipu.com.cn/article/201612/325058.htm

        define symbol __ICFEDIT_region_ROM_start__ = 0x08000200;

        define symbol __ICFEDIT_region_ROM_end__= 0x0807FFFF;

        define symbol __ICFEDIT_region_RAM_start__ = 0x20000000;

        define symbol __ICFEDIT_region_RAM_end__= 0x2000FFFF;

        define symbol __ICFEDIT_region_EXT_SRAM_start__ = 0x64000000;

        define symbol __ICFEDIT_region_EXT_SRAM_end__= 0x6407FFFF;

        /*-Sizes-*/

        define symbol __ICFEDIT_size_cstack__ =0x200;

        define symbol __ICFEDIT_size_heap__= 0x80000;

        /**** End of ICF editor section. ###ICF###*/

        define memory mem with size = 4G;

        define region ROM_region= mem:[from __ICFEDIT_region_ROM_start__to __ICFEDIT_region_ROM_end__];

        define region RAM_region= mem:[from __ICFEDIT_region_RAM_start__to __ICFEDIT_region_RAM_end__];

        define region EXT_SRAM_region= mem:[from __ICFEDIT_region_EXT_SRAM_start__to __ICFEDIT_region_EXT_SRAM_end__];

        define block CSTACKwith alignment = 8, size = __ICFEDIT_size_cstack__{ };

        define block HEAPwith alignment = 8, size = __ICFEDIT_size_heap__{ };

        initialize by copy { readwrite };

        do not initialize{ section .noinit };

        place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };

        place in ROM_region{ readonly };

        place in RAM_region{ readwrite, block CSTACK };

        place in EXT_SRAM_region{ block HEAP };

        編譯 /GUI生產(chǎn)Library,然后在工程中引用。

        在linker中使用自定義icf,以及/GUI的<.a>格式lib。
        IAR->Option->Linker->Library->Additional libraries:$PROJ_DIR$DebugExe GUI_Lib.a

        /GUI編譯生成library。

        基本的設(shè)置就不說了,比方說LCDConf.h,GUITo hConf.h,GUIConf.h。需要注意的是,當(dāng)使用GUI_SUPPORT_MEMDEV時,使用的內(nèi)存量增加,故需要適度的將#define GUI_ALLOC_SIZE 64*1024擴大到夠用為止,以防止stack溢出。

        #define HEAPBASE((unsignedchar*)0x64000000)外部SRAM在FSMC的blankX,量體裁衣。

        由于使用外部SRAM作為heap,GUI_ALLOC的時候,修改

        將原文件中的:

        GUI_MEM_ALLOC GUI_HEAP GUI_Heap;

        GUI_MEM_ALLOC tBlock aBlock[GUI_MAXBLOCKS];

        修改為:

        GUI_MEM_ALLOC GUI_HEAP *GUI_Heap;

        GUI_MEM_ALLOC tBlock *aBlock;

        在函數(shù)初始化時修改如下:

        void GUI_ALLOC_Init(void) {

        GUI_Heap = malloc(GUI_ALLOC_SIZE);

        aBlock = malloc(GUI_MAXBLOCKS * sizeof(tBlock));

        memset(HEAPBASE,0,GUI_ALLOC_SIZE+GUI_MAXBLOCKS * sizeof(tBlock));

        將malloc申請到的內(nèi)存初始化一下,如果工程函數(shù)中沒有初始化外部RAM的數(shù)據(jù),GUI分配不到內(nèi)存,LCD無法顯示。



        評論


        技術(shù)專區(qū)

        關(guān)閉