[SOLVED] stm32f303 - warning: changing start of section .text by 8 bytes

STM32F103 Nucleo boards e.g. STM Nucleo F103RB
FRANCISCOGIMENO
Posts: 38
Joined: Wed Nov 08, 2017 12:30 pm

[SOLVED] stm32f303 - warning: changing start of section .text by 8 bytes

Post by FRANCISCOGIMENO » Wed Nov 08, 2017 12:49 pm

Hello after installing everything when I compiled a program
I get this. and when I compiled it using as a destination in arduino nano, nothing came out. Does anyone know what this is?

ld.exe: warning: changing start of section .text by 8 bytes
ld.exe: warning: changing start of section .bss by 4 bytes
ld.exe: warning: changing start of section .text by 8 bytes
ld.exe: warning: changing start of section .bss by 4 bytes
ld.exe: warning: changing start of section .text by 8 bytes
ld.exe: warning: changing start of section .bss by 4 bytes
ld.exe: warning: changing start of section .text by 8 bytes
ld.exe: warning: changing start of section .bss by 4 bytes
ld.exe: warning: changing start of section .text by 8 bytes
ld.exe: warning: changing start of section .bss by 4 bytes



Program size: 34.932 bytes (used 53% of a 65.536 byte maximum) (1,31 secs)
Minimum Memory Usage: 6844 bytes (56% of a 12288 byte maximum)

Uploading 'PROG' to 'Nucleo-32' using 'COM11'
STM32 ST-LINK CLI v3.0.0.0
STM32 ST-LINK Command Line Interface
ST-LINK SN : 0676FF323535474B43033459
The upload process has finished.
ST-LINK Firmware version : V2J29M18
Connected via SWD.
SWD Frequency = 4000K.
Target voltage = 3.3 V.
Connection mode : Normal.
Device ID:0x438
Device flash Size : 64 Kbytes
Device family :STM32F303x4-x6-x8/F328xx/F334xx
Loading file...
Flash Programming:
File : E:\PROG.ino.bin
Address : 0x08000000
Memory programming...
±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± 0%
0%ÛÛÛÛÛÛÛÛÛÛÛÛÛ 27%ÛÛÛÛÛÛÛÛÛÛÛÛÛÛ 54%ÛÛÛÛÛÛÛÛÛÛÛÛÛÛ 82%ÛÛÛÛÛÛÛÛÛ 100%
Memory programmed in 3s and 463ms.
Programming Complete.
MCU Reset.
run application to exit
Application started.


Thanks and best regards.
Last edited by FRANCISCOGIMENO on Thu Nov 09, 2017 9:03 am, edited 1 time in total.

fpiSTM
Posts: 250
Joined: Fri Sep 16, 2016 12:33 pm
Location: Le Mans, France

Re: stm32f303 - warning: changing start of section .text by 8 bytes

Post by fpiSTM » Wed Nov 08, 2017 1:08 pm

Hi,
it's only a warning. I will correct all those one.
it only warn us about a misalignment of a section in the linker script but it is corrected by the linker.

To avoid this warning, correction is to add ALIGN(x) in the impacted section. Ex for the:
ld.exe: warning: changing start of section .text by 8 bytes
Replace:

Code: Select all

  .text :
by

Code: Select all

  .text ALIGN(8):

FRANCISCOGIMENO
Posts: 38
Joined: Wed Nov 08, 2017 12:30 pm

Re: stm32f303 - warning: changing start of section .text by 8 bytes

Post by FRANCISCOGIMENO » Wed Nov 08, 2017 1:34 pm

Thanks for your response, but what is the file that is changed?

Thank you very much.

Fran

fpiSTM
Posts: 250
Joined: Fri Sep 16, 2016 12:33 pm
Location: Le Mans, France

Re: stm32f303 - warning: changing start of section .text by 8 bytes

Post by fpiSTM » Wed Nov 08, 2017 2:04 pm

the file is in the variant: ldscript.ld
https://github.com/stm32duino/Arduino_C ... ipt.ld#L61

FRANCISCOGIMENO
Posts: 38
Joined: Wed Nov 08, 2017 12:30 pm

Re: stm32f303 - warning: changing start of section .text by 8 bytes

Post by FRANCISCOGIMENO » Wed Nov 08, 2017 5:07 pm

Hello, that I have changed it and the message of 8 and it does not appear. But this continues to appear:

ld.exe: warning: changing start of section .bss by 4 bytes
ld.exe: warning: changing start of section .bss by 4 bytes
ld.exe: warning: changing start of section .bss by 4 bytes
ld.exe: warning: changing start of section .bss by 4 bytes
ld.exe: warning: changing start of section .bss by 4 bytes

Program size: 34.940 bytes (used 53% of a 65.536 byte maximum) (73,10 secs)
Minimum Memory Usage: 6844 bytes (56% of a 12288 byte maximum)

:shock:

fpiSTM
Posts: 250
Joined: Fri Sep 16, 2016 12:33 pm
Location: Le Mans, France

Re: stm32f303 - warning: changing start of section .text by 8 bytes

Post by fpiSTM » Wed Nov 08, 2017 5:41 pm

You have corrected only the .text section. But you have to do it also for the .bss. with align(4). ;)

FRANCISCOGIMENO
Posts: 38
Joined: Wed Nov 08, 2017 12:30 pm

Re: stm32f303 - warning: changing start of section .text by 8 bytes

Post by FRANCISCOGIMENO » Wed Nov 08, 2017 5:48 pm

But is it in the same file?

FRANCISCOGIMENO
Posts: 38
Joined: Wed Nov 08, 2017 12:30 pm

Re: stm32f303 - warning: changing start of section .text by 8 bytes

Post by FRANCISCOGIMENO » Wed Nov 08, 2017 6:02 pm

I have already found it and I have changed it but when I compile
It gives me this error:

Compiling 'prog' for 'Nucleo-32'
ld.exe: address 0x100011e4 of ....prog.ino.elf section .bss is not within region RAM
ld.exe: ...prog.ino.elf section ._user_heap_stack will not fit in region RAM

Error linking for board Nucleo-32
ld.exe: address 0x100011e4 of ...prog.ino.elf section .bss is not within region RAM

Build failed for project 'prog'
ld.exe: region RAM overflowed by -268441624 bytes

collect2.exe*: error: ld returned 1 exit status

I left it as it was.

FRANCISCOGIMENO
Posts: 38
Joined: Wed Nov 08, 2017 12:30 pm

Re: stm32f303 - warning: changing start of section .text by 8 bytes

Post by FRANCISCOGIMENO » Wed Nov 08, 2017 6:09 pm

in that section it is different than in the text



/* Uninitialized data section */
. = ALIGN(4);
.bss : <------------------------------------------------------------------------------I have changed this by: .bss ALIGN(4):
{
/* This is used by the startup in order to initialize the .bss secion */
_sbss = .; /* define a global symbol at bss start */
__bss_start__ = _sbss;
*(.bss)
*(.bss*)
*(COMMON)

. = ALIGN(4);
_ebss = .; /* define a global symbol at bss end */
__bss_end__ = _ebss;
} >RAM


/* User_heap_stack section, used to check that there is enough RAM left */
._user_heap_stack :
{
. = ALIGN(8);
PROVIDE ( end = . );
PROVIDE ( _end = . );
. = . + _Min_Heap_Size;
. = . + _Min_Stack_Size;
. = ALIGN(8);
} >RAM



/* Remove information from the standard libraries */
/DISCARD/ :
{
libc.a ( * )
libm.a ( * )
libgcc.a ( * )
}

.ARM.attributes 0 : { *(.ARM.attributes) }
}

fpiSTM
Posts: 250
Joined: Fri Sep 16, 2016 12:33 pm
Location: Le Mans, France

Re: stm32f303 - warning: changing start of section .text by 8 bytes

Post by fpiSTM » Wed Nov 08, 2017 7:23 pm

Which board you used?
Which sketch?

Post Reply