Skip to content

Commit

Permalink
lab004/firmware: fix firmware build
Browse files Browse the repository at this point in the history
Fixes two separate issues that were keeping lab004 from working.

The first is a minor but important oversight from litex-hub/fpga_101@b36c77a:
It added a definition for crt0.o but then didn't refer to it anywhere,
effectively removing crt0.o from the build.

That was likely the cause of litex-hub/fpga_101#12.

The second issue I don't understand as well, but seems to be exactly the
same as enjoy-digital/litex#1007, from which I
copied the fix.
  • Loading branch information
jeremyschlatter committed Jul 14, 2024
1 parent 1e9c8d2 commit ee1169d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lab004/firmware/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ BUILD_DIR=../build/
include $(BUILD_DIR)/software/include/generated/variables.mak
include $(SOC_DIRECTORY)/software/common.mak

OBJECTS=isr.o main.o
OBJECTS=isr.o main.o crt0.o

all: firmware.bin

Expand Down
6 changes: 6 additions & 0 deletions lab004/firmware/linker.ld
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ SECTIONS
.text :
{
_ftext = .;
/* Make sure crt0 files come first, and they, and the isr */
/* don't get disposed of by greedy optimisation */
*crt0*(.text)
KEEP(*crt0*(.text))
KEEP(*(.text.isr))

*(.text .stub .text.* .gnu.linkonce.t.*)
_etext = .;
} > main_ram
Expand Down

0 comments on commit ee1169d

Please sign in to comment.