Generating Assembly using risc-v gcc tool chain

Hi,

I am trying to understand some of the underlying instructions and for that I tried to generate the assembly. So I added the -S (capital) flag to the makefile in demo_gpio here how its looks like:

 TARGET = demo_gpio
 C_SRCS += demo_gpio.c
 C_SRCS += plic_driver.c
 CFLAGS += -O2 -fno-builtin-printf -DUSE_PLIC -DUSE_M_TIME -S
 BSP_BASE = ../../bsp
 include $(BSP_BASE)/env/common.mk

but I am getting the following error:

riscv32-unknown-elf-gcc: error: ../../bsp/env/start.o: No such file or directory
riscv32-unknown-elf-gcc: error: ../../bsp/env/entry.o: No such file or directory
make[1]: *** [demo_gpio] Error 1
make: *** [software] Error 2

I am able to run and program the board without using the flag. Can anyone help me on that?

You can run “make dasm PROGRAM=demo_gpio” (or whichever program you’d like) and it will create the disassembly for you.

4 Likes