cancel
Showing results for 
Search instead for 
Did you mean: 

STM3240G-EVAL .hex and .map output discrepancy

hermanv
Associate II
Posted on April 09, 2013 at 12:23

Hi all,

When I build my application, the output .hex file indicates that the FLASH data footprint (.text) is 0xBB04, but according to the .map file it should only be 0xB How is this possible? I am using the YAGARTO toolchain on a STM3240G-EVAL. As seen here below, the map file indicates .text to be 0xB220

.text 0x08000000 0xb220
*(.isr_vector)
.isr_vector 0x08000000 0x188 startup_stm32f4xx.o
0x08000000 __isr_vector

Here are the compiler and linker options I am using:

MCFLAGS = -mthumb -mcpu=$(MCU)
ASFLAGS = $(MCFLAGS) -g -Wa,-amhls=$(<:.s=.lst) $(ADEFS)
CPFLAGS = $(MCFLAGS) $(OPT) -g -Wall -ffunction-sections -Wa,-ahlms=$(<:.c=.lst) $(DEFS)
LDFLAGS = $(MCFLAGS) -pedantic -nostartfiles -T$(LDSCRIPT) -Wl,-Map=$(FULL_PRJ).map,--cref,--gc-sections,--no-warn-mismatch $(LIBDIR)
LDFLAGS += -Wl,--start-group $(ULIBS) -Wl,--end-group
# Generate dependency information
CPFLAGS += -MD -MP -MF .dep/$(@F).d

I also attached the output .hex file, .map file and makefile. Any suggestions as to what might be wrong? Thanks, H #stm32f4 #linker #map-file
6 REPLIES 6
Posted on April 09, 2013 at 12:36

Add 0x8e4 of .data initializer.

This has nothing to do with STM32 as such, btw., although I admit I know of no good GNU-tools-user forum.

JW
hermanv
Associate II
Posted on April 09, 2013 at 12:55

This has nothing to do with STM32 as such, btw., although I admit I know of no good GNU-tools-user forum.

Yes I know, but most of the time I don't even get responses from GNU forums. Won't post such questions under STM32 again. Sorry

Add 0x8e4 of .data initializer.

Can you please explain a bit more what you mean by this?

Thanks,

H

frankmeyer9
Associate II
Posted on April 09, 2013 at 13:19

''.data'' initializer are constants stored in Flash, and are used to initialize RAM variables which do not remain constant during runtime.

Posted on April 09, 2013 at 13:22

The values which go to the initialized global and static variables (which are stored in the .data segment in RAM) have to be in FLASH somewhere, and they are just above .text. The startup code then copies this into RAM after reset.

[politically incorrect personal view] Belittling of the mere user is a general plague of much of the GNU developer community.[/politically incorrect personal view] The avr-gcc subforum of avrfreaks.net forum is the only forum I know of which is very responsive and friendly to user-grade questions like this; however, its' AVR-specific and non-AVR (and non-Atmel-related) questions would be frowned upon there, too.

JW

frankmeyer9
Associate II
Posted on April 09, 2013 at 13:36

[politically incorrect personal view] Belittling of the mere user is a general plague of much of the GNU developer community.[/politically incorrect personal view]

 

I would extend this to some other communities in the Unix/Linux world (but not to all).

hermanv
Associate II
Posted on April 09, 2013 at 14:41

Thanks, now I understand