From 6d402415e8b288ed62f25316b192cfd07ffb4265 Mon Sep 17 00:00:00 2001 From: "Hsiang-Chia.Huang" Date: Tue, 20 Aug 2019 11:28:40 +0800 Subject: [PATCH] Fixed the cs pin assignment. --- src/drivers/sifive_spi0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/drivers/sifive_spi0.c b/src/drivers/sifive_spi0.c index 3d14076c..4e6578cc 100644 --- a/src/drivers/sifive_spi0.c +++ b/src/drivers/sifive_spi0.c @@ -117,7 +117,7 @@ static int configure_spi(struct __metal_driver_sifive_spi0 *spi, } /* Set CS line */ - METAL_SPI_REGW(METAL_SIFIVE_SPI0_CSID) = config->csid; + METAL_SPI_REGW(METAL_SIFIVE_SPI0_CSID) = 1 << (config->csid); /* Toggle off memory-mapped SPI flash mode, toggle on programmable IO mode * It seems that with this line uncommented, the debugger cannot have access