Questions tagged [linker-script]
16 questions
14
votes
3 answers
Flash and RAM : Code Execution
I recently started learning assembly and came to know about linker scripts and other low-level details of hardware programming. I am also teaching myself computer architecture and somewhere along the line I came to fear that my picture of the memory…

Shrikant Giridhar
- 523
- 1
- 6
- 14
6
votes
1 answer
why trace_printf("%f",x); triggers a HARD FAULT on a stm32 MCU?
I'm using a stm32 F413ZH microncontroller with HAL libraries (mainly written to be used with c but can also be used with c++) in eclipse, actually I managed to completely configure eclipse including semihosting and debug mode(openOCD), the basic…
5
votes
1 answer
Easiest way to get rid of __clz_tab in winavr compiled code?
I've ported a program from the arduino environment to a makefile build using winavr, which, in turn, is based on avr-gcc (just like arduino).
However, my program started crashing, and after some investigation I found I was running out of data memory…

Adam Davis
- 20,339
- 7
- 59
- 95
5
votes
1 answer
Can't get special PIC32 linker section to show up in output file
I am defining a special section for some data that I want to show up at the beginning of my PIC32 binary image, as follows in the SECTIONS part of my elf32pic32mx.ld file:
.headerdata ORIGIN(kseg0_program_mem) :
{
*(.headerdata)
}…

tcrosley
- 47,708
- 5
- 97
- 161
4
votes
3 answers
Make linker use bank 0 in relocatable mode
I'm tryin to build assembly project with MPASM/MPLINK for PIC16F628A. Microchip advice that it's better to stay on bank 0 and switch whenever you want different bank, and then get back to bank 0 (to minimise bank switching). That's why I want to put…

NickSoft
- 207
- 2
- 8
4
votes
2 answers
Moving the code and interrupt locations in Arduino
I need to be able to choose between two Arduino apps running on an atmega 1280 (megaavr) at boot time. Therefore I need to move one of those apps to a different location in program memory, and I need to move the interrupts to that location as…

Adam Davis
- 20,339
- 7
- 59
- 95
3
votes
2 answers
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...
MEMORY
{
text (rx) : ORIGIN = 0, LENGTH = __TEXT_REGION_LENGTH__
data (rw!x) : ORIGIN = 0x800060, LENGTH =…

bigjosh
- 9,888
- 29
- 48
2
votes
2 answers
Question about linker script for STM32L4R5ZI with 3 RAM partitions
For my application I need 305Kbytes of RAM for the variables.
According to Reference manual for the chip I am using - STM32L4R5ZI:
"The STM32L4Rxxx and STM32L4Sxxx devices feature up to 640 Kbytes SRAM:
• 192 Kbytes SRAM1
• 64 Kbytes SRAM2
• 384…

D. K.
- 111
- 7
2
votes
0 answers
Bus Fault Handler when writing to a memory provided by a linker script
I have to work with code written by someone else for the Cortex M3-based board. I know that this code is supposed to work and it used to pass its integration test: the code is flashed to the board using openocd and then a Python script asserts that…

Stanislav Pankevich
- 121
- 3
2
votes
1 answer
Porting a linker script from STM32F1 to STM32F2
I am trying to port PyMite from STM32F1 to STM32F2. One of the files that I am assuming must be changed is called stm32f10x.ld. I have looked around for an equivalent of this (called stm32f2xx.ld?) but haven't found anything.
I'm now thinking that I…

Randomblue
- 10,953
- 29
- 105
- 178
1
vote
2 answers
Where can I find STM32F030X6 linker script?
I want to build code for my STM32F030F4 using arm-gcc-none-eabi. The STM32CubeF0 is already downloaded, and inside the repository, I found the location of the startup file.
However, I haven't found where the linker script is located. There is some…

andre.hre
- 107
- 7
1
vote
1 answer
stm32f429 flash load address error
I've recently run into this error where openocd wont flash the binary to my discovery board. I'm using the same linker script that i've been using all along.
arm-none-eabi-objdump gives the following output:
src/stm32_uavcan/stm32test: file…

Asusrog
- 85
- 1
- 7
1
vote
1 answer
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 image before flashing it on a new chip. In the code…

agnishant
- 11
- 2
1
vote
1 answer
Is it necessary to write all MSP430 FLASH writing code should be run from RAM?
I am writing some device parameters to non volatile flash memory of msp430f2619 controller.
Sample code shows that function writing to flash should be copied to RAM in initialization section.
But I am using this function to write into dedicated few…

prasad
- 169
- 10
0
votes
2 answers
Questions related to the linker script
Hope all is well.
Lately I've been studying linker scripts and I believe I got a gist of it enough to hold a conversation, however I can't find the answers I am looking for to some of the questions I had and was hoping if someone can educate me on…

Leoc
- 1,393
- 1
- 9
- 21