Im currently evaluating Chibios/RT for use on our custom hardware running STM32F756ZGT chip.
I managed to create an IAR project with IAR 7.60.1 by referencing the example project for the STM32F7-DISCO board.
I did get the LwIP and web server running, tried the I2C driver and everything seemed to be fine, however i have discovered that i definitely have a problem with the IAR linker file the way it is setup right now.
I tried to play with SPI driver and this is when the issues started to show up i guess
When i was setting up the project, i was referencing the original gnu ld files and trying to recreate the memory layout in IAR linker file.
however, i can see that the __heap_base__ and __heap_end__ symbols are not being properly exported to the OS.
I also got some ideas from the STM32F303 demo, the only one that has the IAR project but the STM32F7 chip memory layout is way more complicated than the F303.
I attach my IAR linker file here
Code: Select all
/*###ICF### Section handled by ICF editor, don't touch! ****/
/*-Editor annotation file-*/
/* IcfEditorFile="$TOOLKIT_DIR$\config\linker\ST\IcfEditor\stm32f7xx.xml" */
/*
* ST32F746xG Ethernet setup.
*
* RAM1 - Data, Heap.
* RAM2 - ETH.
* RAM3 - Main Stack, Process Stack, BSS, NOCACHE.
*
* Notes:
* BSS is placed in DTCM RAM in order to simplify DMA buffers management.
*/
/*-Specials-*/
define symbol __ICFEDIT_intvec_start__ = 0x00200000;
/*-Memory Regions-*/
define symbol __ICFEDIT_region_ITCMF_start__ = 0x00200000;
define symbol __ICFEDIT_region_ITCMF_end__ = 0x002FFFFF;
define symbol __ICFEDIT_region_AXIF_start__ = 0x08000000;
define symbol __ICFEDIT_region_AXIF_end__ = 0x080FFFFF;
define symbol __ICFEDIT_region_ITCMR_start__ = 0x00000000; /* ITCM-RAM START */
define symbol __ICFEDIT_region_ITCMR_end__ = 0x00003FFF; /* ITCM-RAM END */
define symbol __ICFEDIT_region_DTCMR_start__ = 0x20000000; /* DTCM-RAM START */
define symbol __ICFEDIT_region_DTCMR_end__ = 0x2000FFFF; /* DTCM-RAM END */
define symbol __ICFEDIT_region_SRAM1_start__ = 0x20010000; /* SRAM1 START */
define symbol __ICFEDIT_region_SRAM1_end__ = 0x2004BFFF; /* SRAM1 END */
define symbol __ICFEDIT_region_SRAM2_start__ = 0x2004C000; /* SRAM2 START */
define symbol __ICFEDIT_region_SRAM2_end__ = 0x2004FFFF; /* SRAM2 END */
define symbol __ICFEDIT_region_BKPR_start__ = 0x40024000; /* BCKP SRAM START */
define symbol __ICFEDIT_region_BKPR_end__ = 0x40024FFF; /* BCKP SRAM END */
/*-Sizes-*/
define symbol __ICFEDIT_size_cstack__ = 0x400;
define symbol __ICFEDIT_size_heap__ = 0x400;
/**** End of ICF editor section. ###ICF###*/
/* Size of the IRQ Stack (Main Stack).*/
define symbol __ICFEDIT_size_irqstack__ = 0x400;
define memory mem with size = 4G;
define region ITCMF_region = mem:[from __ICFEDIT_region_ITCMF_start__ to __ICFEDIT_region_ITCMF_end__];
define region AXIF_region = mem:[from __ICFEDIT_region_AXIF_start__ to __ICFEDIT_region_AXIF_end__ ];
define region ITCMR_region = mem:[from __ICFEDIT_region_ITCMR_start__ to __ICFEDIT_region_ITCMR_end__];
define region DTCMR_region = mem:[from __ICFEDIT_region_DTCMR_start__ to __ICFEDIT_region_DTCMR_end__];
define region SRAM_region = mem:[from __ICFEDIT_region_SRAM1_start__ to __ICFEDIT_region_SRAM1_end__]
| mem:[from __ICFEDIT_region_SRAM2_start__ to __ICFEDIT_region_SRAM2_end__];
define region SRAM1_region = mem:[from __ICFEDIT_region_SRAM1_start__ to __ICFEDIT_region_SRAM1_end__];
define region SRAM2_region = mem:[from __ICFEDIT_region_SRAM2_start__ to __ICFEDIT_region_SRAM2_end__];
define region BKPR_region = mem:[from __ICFEDIT_region_BKPR_start__ to __ICFEDIT_region_BKPR_end__ ];
define symbol __heap_base__ = __ICFEDIT_region_SRAM1_start__;
define symbol __heap_end__ = __ICFEDIT_region_SRAM1_end__;
define symbol __ICFEDIT_size_sysheap__ = 0x5000;
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ {section CSTACK};
define block IRQSTACK with alignment = 8, size = __ICFEDIT_size_irqstack__ {};
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ {};
define block SYSHEAP with alignment = 8 {section SYSHEAP};
define block DATABSS with alignment = 8 {section __nocache_base__, zeroinit};
initialize by copy { readwrite };
//initialize by copy with packing = none { section __DLIB_PERTHREAD }; // Required in a multi-threaded application
do not initialize { section .noinit };
place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
place in ITCMF_region { readonly };
place in ITCMR_region { section .textrw };
place in DTCMR_region { first block IRQSTACK, block CSTACK, block DATABSS };
place in SRAM1_region { first section SYSHEAP, block HEAP, readwrite };
place in SRAM2_region { section __eth_base__ };
place in BKPR_region { section .backup_sram };
I would really appreciate any help in getting me going under IAR with proper linker file that would have basically the same settings as the ld gnu linker file in the original F7DISCO demo.
I tried to search this forum and the __heap_base__ symbols problem is explained for KEIL compilers but i couldn't find anything in regards to IAR
Thanks in advance