LoFive toolchain / support

In order to support the LoFive, there was a fork created that includes the changes needed to get started with the board.

https://github.com/mwelling/freedom-e-sdk

While updating the repository today, the thought of “mainlining” the support came to mind. This would mean contributing back to the original repository with the configurations and source updates required for the LoFive.

Is SiFive willing to host these changes?

Also can this forum be used for support questions or would it be better setup an external support structure for the LoFive?

2 Likes

I think since the LoFive is based on FE310-G000 peripheral, this is a good place to come with questions. We should probably create a “3rd Party Boards” category.

I took a quick look at your branch of freedom-e-sdk, it looks like a lot of files could just be simlinked/shared with the HiFive1 version. What are the actual differences?

— freedom-e300-hifive1/openocd.cfg 2017-09-10 19:54:06.726816094 -0500
+++ freedom-e300-lofive/openocd.cfg 2017-11-26 12:28:59.571154677 -0600
@@ -1,7 +1,8 @@
adapter_khz 10000

interface ftdi
-ftdi_device_desc “Dual RS232-HS”
+#ftdi_device_desc “Dual RS232-HS”
+ftdi_device_desc "FT2232H-56Q MiniModule"
ftdi_vid_pid 0x0403 0x6010

ftdi_layout_init 0x0008 0x001b

— freedom-e300-hifive1/init.c 2017-09-10 19:53:47.990816003 -0500
+++ freedom-e300-lofive/init.c 2017-11-26 12:28:59.571154677 -0600
@@ -131,9 +131,6 @@

static void use_default_clocks()
{

  • // Turn off the LFROSC
  • AON_REG(AON_LFROSC) &= ~ROSC_EN(1);
  • // Use HFROSC
    use_hfrosc(4, 16);
    }

I would like to also update the GPIO bindings perhaps to make more sense eventually.

Otherwise it is pretty much the same.

I think the “use default clocks” could be adjusted such that something in a header file can control whether LFROSC is enabled or not. Then as you say it would just be the header file and the opencod.cfg file. Having less additional code to maintain would make it more appealing to upstream.

Yes, I understand. Duplicated code is always a pain.

Something like this maybe:

In the header:
``#define DISABLE_LFROSC

In the init.c:
#ifdef DISABLE_LFROSC // Turn off the LFROSC AON_REG(AON_LFROSC) &= ~ROSC_EN(1);#endif