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

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.


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:
.text :


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
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
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
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
Wed Nov 08, 2017 5:48 pm
But is it in the same file?

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
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
Wed Nov 08, 2017 7:23 pm
Which board you used?
Which sketch?

FRANCISCOGIMENO
Wed Nov 08, 2017 10:02 pm
Well, the board is the stm32f303 and the program compiled in an arduino micro compiles without problems.

fpiSTM
Thu Nov 09, 2017 8:29 am
Ok. This topic has been solved. please mark this one as [SOLVED] New issue here:http://stm32duino.com/viewtopic.php?f=29&t=2819

FRANCISCOGIMENO
Thu Nov 09, 2017 8:40 am
Hello again, after compiling again without changing anything else
it seems that the 4-bit message no longer appears.

What weird things.

:shock: :shock: :shock:

Thank you so much for everything


fpiSTM
Thu Nov 09, 2017 10:15 am
FYI, I’ve made a PR to Fix all the warning:
https://github.com/stm32duino/Arduino_C … 2/pull/149

I will launch a full build this night to see if all are corrected. In my current built, I have no .bss alignment issue.


Leave a Reply

Your email address will not be published. Required fields are marked *