Questions tagged [linker]

In computing a linker is a program that takes object files generated by a compiler and performs relocation and other operations to form a final executable. Questions here should only relate to embedded platforms and not general PC programming.

Filter by
Sorted by
Tagged with
1 vote
4 answers
301 views

How to get some advantages of dynamic loading on embedded systems?

Some experiential context: The majority of my professional coding is on either baremetal or RTOS embedded systems, while most of my teaching has to do with Linux hosted code. One thing I deeply miss ...
Aaron Linnell's user avatar
0 votes
1 answer
1k views

How to write the scatter file for Keil uVision to force linker to allocate variables in SRAM?

Development environment I'm working with STM32F427 and I use Keil uVision V5.29 to develop my application. The version of the ArmCLang Compiler, of the Assembler and the linker is 6.131.1. Scatter ...
User051209's user avatar
0 votes
1 answer
139 views

Why does Ethernet stop working if the value of Ethernet DMA control registers refers to CCM memory?

Development environment and application details I'm working with STM32F427 and I use Keil uVision V5.29 to develop my application. The version of the ArmCLang Compiler, of the Assembler and the linker ...
User051209's user avatar
1 vote
0 answers
762 views

How to solve the linker 'Error: L6218E Undefined symbol' when I compile a project with RTOS ThreadX?

I'm trying to compile a project where I have add the Software Pack RTOS ThreadX on a STM32F4 and I'm using uVision Keil 5.29. I have included ThreadX in the project ...
User051209's user avatar
0 votes
1 answer
49 views

How to interpret internal_ram data section in NXP

In .lcf (linker configuration file) in my project, in SRAM memory there is an internal_ram section: And in my case this ...
yeuop's user avatar
  • 455
-1 votes
1 answer
2k views

STM32 How can I run code from ram?

I have this really simple "Hello world" piece of software (project attached), running on a STM32WB55 Nucleo board (basically, it sends "HELLO WORLD\n" via USART1, every 1000 ms). I ...
Paul Jon's user avatar
1 vote
3 answers
792 views

Why are data records in intel hex files often limited to 16 bytes, even for long contiguous blocks?

I'm not sure if this is true in general, but all intel hex files I have seen (from Atmel Studio, STM32CubeIDE and MPLAB) use data records with a length of 16 bytes. Even when the addresses written to ...
jusaca's user avatar
  • 9,394
1 vote
1 answer
304 views

C++ AVR big code size & excess unused symbols in build file

I'm developing the program for the AVR microcontroller in C++. I have created a class that contains 8 methods(with constructors) but used only 3. Class code: ...
manueld4722623's user avatar
0 votes
1 answer
232 views

Where do I place linker sections in my FLASH memory?

I'm trying to write my own bootloader and an entire program to be flashed to my microcontroller from scratch (STM32F303RE based on the ARM Cortex-m4 architecture) I've been watching a tutorial series ...
MBJ's user avatar
  • 1
1 vote
1 answer
258 views

Why does the AVR Assembler linker think my data table is at the wrong address?

MCU: ATmega1284 Programmer: JTAGICE3 IDE: Atmel Studio 7.0.2397 Language: AVR Assembler I have a constant data table in flash memory. The linker thinks it is located at address 0x0090, so when I ...
user4574's user avatar
  • 11.9k
1 vote
0 answers
472 views

Linking and the ELF - use of PC-relative addressing, GOT and PLT

So that we're on the same page, I'll try to explain what I think I know about Symbol Relocation and ask questions as they come up. Symbol Relocation: Absolute addresses – replace the reference for ...
thegoodhunter-9115's user avatar
1 vote
0 answers
147 views

Relocation in MPLAB IDE X

I'm writing a bootloader for ATXMEGA256A3U. At page 14, Table 7.1 of the datasheet I know the bootloader address start at 0x20000. Using AtmelStudio I set in the linker option the following ...
Mark's user avatar
  • 1,159
3 votes
0 answers
304 views

How can I setup a shared library between a bootloader and an application?

I am in the process of implementing over-the-air updates on a CC2652 microcontroller using the OpenThread stack. As far as I know a bootloader has to be able to operate independently from the ...
Vincent Kenbeek's user avatar
10 votes
4 answers
2k views

Bare-metal start-up code for Cortex M3 .bss region initialization

I have developed inspired from here a bare metal start-up code for arm cortex M3. However, I encounter the following problem: suppose I declare an uninitialized global variable, say of type unsigned ...
C Marius's user avatar
  • 229
0 votes
1 answer
350 views

Application and bootloader written in different tools can not be compatible?

I have a bootloader to PIC18F4550 that was written using Mikro C for PIC and I have two firmware applications, one was written using Mikro C for PIC and the other using MPLAB X with XC8 compiler. ...
Daniel's user avatar
  • 907
3 votes
1 answer
4k views

gcc __attribute__ section not working?

I'm working on a Zynq Ultrascale+ MPSoC and trying to play around with the on and off chip memories. In the following program, I'm trying to place only variable 'x' into OCM (on-chip-memory) where ...
pr871's user avatar
  • 1,167
3 votes
2 answers
1k views

How does avr-gcc linker know to put the `.data`section at `0x800100` rather than `0x800060`?

Looking at the linker script for my part (ATMEGA168PD), the data region has an origin defined as starting at 0x800060... ...
bigjosh's user avatar
  • 9,938
1 vote
1 answer
360 views

bootloaders "reset memory mapping"

im looking into bootloaders and how they work this picture from application note by atmel for their SAM series bootloader "AP-Note_AT04189" so Stack pointer and reset? Stack pointer is an address of ...
Hasan alattar's user avatar
1 vote
1 answer
241 views

STM32F407 Flash sector auto cleared after programming

I've tried to do flash logger function for my device based on STM32f407 and found some problem with flash: If I uncomment function for clear sector, after load program my dummy data on first page is ...
Alex KIselev's user avatar
7 votes
4 answers
3k views

Creating programmable look up table on STM32

I am trying to define a look up table that is not a constant on an STM32F103. Basically I want to have a page of flash that acts like a constant lookup table in normal operation, but every once in a ...
Brett K Smith's user avatar
4 votes
3 answers
344 views

What are the details about link files and startup code one needs to know to write an Operating System for a uC? [closed]

I know some people will say I don't need to write an OS because there are lots of options out there. But I'm not interested in using an OS to solve an specific problem. I want to write one by myself ...
user avatar
6 votes
2 answers
13k views

STM32F103 flash memory start address

I'm trying to write a linker script for my first firmware for STM32F103C8T6 microcontroller. I have an example script that works. What I'm trying to understand is why it works. The linker script I ...
Andrey Lebedev's user avatar
1 vote
2 answers
5k views

How to use a Linker File with Keil uVision5 ARM?

I am trying to follow a tutorial implementing a custom bootloader on a STM32F072 (ARM M0 Core), which requires remapping memory areas when compiling for both the 'bootload' application and the 'main-...
AJBotha's user avatar
  • 416
4 votes
1 answer
1k views

How does gnu linker obtain Cortex-M stack pointer value?

GNU's linker obtains the ARM Cortex's stack pointer value from the linker script, and places that value in the first location of the interrupt vector table. I note that most of my scripts use the ...
CMiller's user avatar
  • 51
1 vote
1 answer
236 views

ESP8266 and GCC

I think this is more related to GCC rather than ESP8266. I have been trying to put in a constant variable in read only memory section of ESP. The idea is to change the value directly in the binary ...
agnishant's user avatar
3 votes
2 answers
4k views

IAR ARM Place const symbols in flash

I have the following flash section defined in my linker file: keep { section .SomeConst }; place at address mem: 0x0003F800 { readonly section .SomeConst }; In ...
BAO's user avatar
  • 78
0 votes
3 answers
1k views

Linker error using Atmel Studio with C++ project

I have created a simple C++ project using Studio 7.0.1006. Then using "Add Class", I added a simple class called CGPIO. To this class I added a public method called Initialize. The code compiles and ...
tomontee's user avatar
0 votes
2 answers
464 views

Fill ROM with jump instructions

As I have heard it is a common practice to fill the unused flash memory of a microcontroller with an jump instruction to the reset function. This aids in resetting the MCU in case of the PC is corrupt,...
Fotis Panagiotopoulos's user avatar
0 votes
1 answer
138 views

Code composer 6 linker file not placing variables

I am developing firmware on MSP430F2619. I need to store configuration information having 5 sections of 200 bytes. In order to read and write them independently I am trying to allocate 5 sections of ...
prasad's user avatar
  • 169
-2 votes
1 answer
565 views

What is a startup code how it is related to bootloader or bootloader code?

I am doing a project on building a bootloader for a kinetis E series controller (MKE02Z64VLD2). My mentor told me to have a thorough knowledge about Startup code and linker files before starting the ...
Ganesh Ramachandran's user avatar
4 votes
2 answers
2k views

Force xc32-ld to place all application code in kseg0_boot_mem

I have written a PIC32MX bootloader application. I would like to tell the linker to put it completely in the boot memory, so that all program space is kept for the final application. Currently, the ...
user avatar
0 votes
1 answer
772 views

Error while running linker am using TIVA C TM4C123G and IAR

I am trying to change and read my TM4C123G launchpad clock frequency to 80 MHZ using TIVAWARE libraries so here is my code: ...
Abdelrahman Elshafiey's user avatar
0 votes
2 answers
2k views

Merging 2 Hex files

My MSP430 program consists of serial bootloader and application hex files. While programming I load bootloader program using JTAG and then load application program using bootloader. I am looking for ...
prasad's user avatar
  • 169
1 vote
2 answers
920 views

Starting application program at fix address in MSP430F2619

I am writing firmware for system with boot loader and application using TI MSP430F2619 micro-controller. I want to know How I can make sure my program restart at predefined address in flash let us ...
prasad's user avatar
  • 169
2 votes
1 answer
2k views

ELF section flags not picking up flags from linker script

In my linker script for binaries on an MSP430, I have a memory section marked "rx": ...
jhnphm's user avatar
  • 31
1 vote
2 answers
2k views

Microchip XC8: How to Overlap Specific Variables without Union?

I have effectively three sets of variables to put in two locations. Sets 1 and 2 are never used together, so they can occupy the same space. Set 3 needs to be unique. I know I can use a union of ...
AaronD's user avatar
  • 5,656
2 votes
2 answers
1k views

Microchip's XC8 Linker doesn't recognize some custom section names

Slightly related to this one: https://softwareengineering.stackexchange.com/questions/254734/microchip-xc8-how-to-pack-code-against-an-upper-limit I can relocate code just fine, but I'm having some ...
AaronD's user avatar
  • 5,656
3 votes
3 answers
4k views

Short String overflows.text area on ATtiny85, Arduino IDE

I'm using the Arduino IDE with arduino-tiny (https://code.google.com/p/arduino-tiny/) on an ATTIny85. My code is maxing out the RAM, or so it seems: Adding a ...
Christian's user avatar
  • 621
2 votes
2 answers
2k views

Arduino linking assembler funtions

I would like to use (link) a function written in assembler in an Arduino project. What I want to do is: write the function in assembler using avr-gcc calling conventions declare the function as ...
Stefan Nilsson's user avatar
4 votes
2 answers
858 views

Automating linker file change

I am working on a firmware project in which i have to do a crc16 check for flash integrity. Controller: MSP430 IDE: IAR EW 5.40 (Linker Xlink) The crc is calculated using IAR Xlink linker and kept ...
OnkarK's user avatar
  • 41
8 votes
1 answer
241 views

Integrating another binary

I am building a binary for ARM using GCC and Crossworks. I have a secondary binary image that needs to be loaded to another IC during start up. I like to integrate this binary to my tool-chain, in ...
Ktc's user avatar
  • 2,226