kekiefer / tinyfpga-litex

A minimal LiteX SoC definition for the TinyFPGA BX
14 stars 1 forks source link

How was the firmware created? #5

Open DurandA opened 4 years ago

DurandA commented 4 years ago

Hi @kekiefer!

I wonder how did you proceed to create a bare-metal firmware for LiteX (the documentation is not yet ready) as I was not able to find many examples for other platforms (e.g. fomu-workshop/riscv-blink, OrangeCrab/gateware/litex_ddr3_test/firmware and litex-baremetal-test).

It seems that isr.c and linkerxip.ld are taken from litex-buildenv/firmware. Did you simply start from litex-buildenv/firmware and reduce the Makefile to a minimal one?

Thanks!

kekiefer commented 4 years ago

It's been a while since I did this, but that sounds about right. This was the minimum I needed to boot the processor and access the UART, which was what I wanted as a starting point for from-scratch bare-metal firmware. I think I didn't have a convenient way to incorporate the linker file from litex, which is why it is copied here. This pattern isn't so weird, I've got boilerplate linker files in most of my STM32 projects as well. But isr.c and main.c are really meant to be modified, which is why they have copies here. Does this help?