umanovskis / baremetal-arm

An ebook about bare-metal programming for ARM
Other
656 stars 131 forks source link

Chapter 4: arm-none-eabi-ld -T linkscript.ld -o cenv.elf startup.o cstart.o #24

Open Jayzown opened 1 year ago

Jayzown commented 1 year ago

I have tried running this line of code and keep getting the error: arm-none-eabi-ld:linkscript.ld:0: syntax error

I have this for my linkscript.ld file ENTRY(_Reset) MEMORY { ROM (rx) : ORIGIN = 0X60000000, LENGTH 1M RAM (rwx): ORIGIN = 0X70000000, LENGTH 32M } SECTIONS 1 .text : { 2 startup.o (.vector_table) 3 (.text) 4 (.rodata) 5 } > ROM 6 _text_end = .; 7 .data : AT(ADDR(.text) + SIZEOF(.text)) 8 { 9 _data_start = .; 10 (.data) 11 . = ALIGN(8); 12 _data_end = .; 13 } > RAM 14 .bss : { 15 _bss_start = .; 16 (.bss) 17 . = ALIGN(8); 18 _bss_end = .; 19 } > RAM

Please what could be the problem? I have searched online and can't find the issue

Jayzown commented 1 year ago

Hey @umanovskis , I am sorry. I copied that from my page and didn't take the numbers out. I didn't include the numbers in the code, the numbers to the lines just come with it when you copy

uc-mani commented 1 month ago

You MEMORY region is missing "=" sign for LENGTH correct code snippet is

MEMORY
{
    ROM (rx) : ORIGIN = 0x60000000, LENGTH = 1M
    RAM (rwx): ORIGIN = 0x70000000, LENGTH = 32M
}