Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_46254178
rt-thread
提交
b25a2794
R
rt-thread
项目概览
weixin_46254178
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
b25a2794
编写于
3月 20, 2019
作者:
B
Bernard Xiong
提交者:
GitHub
3月 20, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2477 from lymzzyh/interrupt
K210 修改
上级
c9d88a8e
7888c6f6
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
211 addition
and
44 deletion
+211
-44
bsp/k210/.config
bsp/k210/.config
+11
-8
bsp/k210/driver/SConscript
bsp/k210/driver/SConscript
+1
-0
bsp/k210/driver/board.c
bsp/k210/driver/board.c
+2
-0
bsp/k210/driver/drv_gpio.c
bsp/k210/driver/drv_gpio.c
+1
-1
bsp/k210/driver/drv_interrupt.c
bsp/k210/driver/drv_interrupt.c
+27
-0
bsp/k210/driver/drv_io_config.c
bsp/k210/driver/drv_io_config.c
+12
-1
bsp/k210/driver/drv_io_config.h
bsp/k210/driver/drv_io_config.h
+10
-0
bsp/k210/driver/drv_spi.c
bsp/k210/driver/drv_spi.c
+92
-21
bsp/k210/rtconfig.h
bsp/k210/rtconfig.h
+11
-8
libcpu/risc-v/k210/interrupt.c
libcpu/risc-v/k210/interrupt.c
+44
-5
未找到文件。
bsp/k210/.config
浏览文件 @
b25a2794
...
@@ -51,9 +51,8 @@ CONFIG_RT_USING_MESSAGEQUEUE=y
...
@@ -51,9 +51,8 @@ CONFIG_RT_USING_MESSAGEQUEUE=y
CONFIG_RT_USING_MEMPOOL
=
y
CONFIG_RT_USING_MEMPOOL
=
y
# CONFIG_RT_USING_MEMHEAP is not set
# CONFIG_RT_USING_MEMHEAP is not set
# CONFIG_RT_USING_NOHEAP is not set
# CONFIG_RT_USING_NOHEAP is not set
CONFIG_RT_USING_SMALL_MEM
=
y
# CONFIG_RT_USING_SMALL_MEM is not set
# CONFIG_RT_USING_SLAB is not set
CONFIG_RT_USING_SLAB
=
y
# CONFIG_RT_USING_MEMTRACE is not set
CONFIG_RT_USING_HEAP
=
y
CONFIG_RT_USING_HEAP
=
y
#
#
...
@@ -108,9 +107,9 @@ CONFIG_FINSH_ARG_MAX=10
...
@@ -108,9 +107,9 @@ CONFIG_FINSH_ARG_MAX=10
#
#
CONFIG_RT_USING_DFS
=
y
CONFIG_RT_USING_DFS
=
y
CONFIG_DFS_USING_WORKDIR
=
y
CONFIG_DFS_USING_WORKDIR
=
y
CONFIG_DFS_FILESYSTEMS_MAX
=
4
CONFIG_DFS_FILESYSTEMS_MAX
=
16
CONFIG_DFS_FILESYSTEM_TYPES_MAX
=
4
CONFIG_DFS_FILESYSTEM_TYPES_MAX
=
16
CONFIG_DFS_FD_MAX
=
16
CONFIG_DFS_FD_MAX
=
64
# CONFIG_RT_USING_DFS_MNTTABLE is not set
# CONFIG_RT_USING_DFS_MNTTABLE is not set
CONFIG_RT_USING_DFS_ELMFAT
=
y
CONFIG_RT_USING_DFS_ELMFAT
=
y
...
@@ -126,7 +125,7 @@ CONFIG_RT_DFS_ELM_USE_LFN_3=y
...
@@ -126,7 +125,7 @@ CONFIG_RT_DFS_ELM_USE_LFN_3=y
CONFIG_RT_DFS_ELM_USE_LFN
=
3
CONFIG_RT_DFS_ELM_USE_LFN
=
3
CONFIG_RT_DFS_ELM_MAX_LFN
=
255
CONFIG_RT_DFS_ELM_MAX_LFN
=
255
CONFIG_RT_DFS_ELM_DRIVES
=
2
CONFIG_RT_DFS_ELM_DRIVES
=
2
CONFIG_RT_DFS_ELM_MAX_SECTOR_SIZE
=
512
CONFIG_RT_DFS_ELM_MAX_SECTOR_SIZE
=
4096
# CONFIG_RT_DFS_ELM_USE_ERASE is not set
# CONFIG_RT_DFS_ELM_USE_ERASE is not set
CONFIG_RT_DFS_ELM_REENTRANT
=
y
CONFIG_RT_DFS_ELM_REENTRANT
=
y
CONFIG_RT_USING_DFS_DEVFS
=
y
CONFIG_RT_USING_DFS_DEVFS
=
y
...
@@ -159,7 +158,11 @@ CONFIG_RT_USING_PIN=y
...
@@ -159,7 +158,11 @@ CONFIG_RT_USING_PIN=y
CONFIG_RT_USING_SPI
=
y
CONFIG_RT_USING_SPI
=
y
# CONFIG_RT_USING_QSPI is not set
# CONFIG_RT_USING_QSPI is not set
CONFIG_RT_USING_SPI_MSD
=
y
CONFIG_RT_USING_SPI_MSD
=
y
# CONFIG_RT_USING_SFUD is not set
CONFIG_RT_USING_SFUD
=
y
CONFIG_RT_SFUD_USING_SFDP
=
y
CONFIG_RT_SFUD_USING_FLASH_INFO_TABLE
=
y
# CONFIG_RT_SFUD_USING_QSPI is not set
CONFIG_RT_DEBUG_SFUD
=
y
# CONFIG_RT_USING_W25QXX is not set
# CONFIG_RT_USING_W25QXX is not set
# CONFIG_RT_USING_GD is not set
# CONFIG_RT_USING_GD is not set
# CONFIG_RT_USING_ENC28J60 is not set
# CONFIG_RT_USING_ENC28J60 is not set
...
...
bsp/k210/driver/SConscript
浏览文件 @
b25a2794
...
@@ -8,6 +8,7 @@ board.c
...
@@ -8,6 +8,7 @@ board.c
heap.c
heap.c
drv_uart.c
drv_uart.c
drv_io_config.c
drv_io_config.c
drv_interrupt.c
'''
)
'''
)
CPPPATH
=
[
cwd
]
CPPPATH
=
[
cwd
]
...
...
bsp/k210/driver/board.c
浏览文件 @
b25a2794
...
@@ -84,6 +84,8 @@ extern int rt_hw_clint_ipi_enable(void);
...
@@ -84,6 +84,8 @@ extern int rt_hw_clint_ipi_enable(void);
void
rt_hw_board_init
(
void
)
void
rt_hw_board_init
(
void
)
{
{
sysctl_pll_set_freq
(
SYSCTL_PLL0
,
800000000UL
);
sysctl_pll_set_freq
(
SYSCTL_PLL1
,
400000000UL
);
/* Init FPIOA */
/* Init FPIOA */
fpioa_init
();
fpioa_init
();
/* Dmac init */
/* Dmac init */
...
...
bsp/k210/driver/drv_gpio.c
浏览文件 @
b25a2794
...
@@ -139,7 +139,7 @@ static void pin_irq(int vector, void *param)
...
@@ -139,7 +139,7 @@ static void pin_irq(int vector, void *param)
set_gpio_bit
(
gpiohs
->
fall_ie
.
u32
,
pin_channel
,
1
);
set_gpio_bit
(
gpiohs
->
fall_ie
.
u32
,
pin_channel
,
1
);
}
}
if
(
irq_table
[
pin_channel
2019
-
03
-
18
ZYH
first
version
].
edge
&
GPIO_PE_RISING
)
if
(
irq_table
[
pin_channel
].
edge
&
GPIO_PE_RISING
)
{
{
set_gpio_bit
(
gpiohs
->
rise_ie
.
u32
,
pin_channel
,
0
);
set_gpio_bit
(
gpiohs
->
rise_ie
.
u32
,
pin_channel
,
0
);
set_gpio_bit
(
gpiohs
->
rise_ip
.
u32
,
pin_channel
,
1
);
set_gpio_bit
(
gpiohs
->
rise_ip
.
u32
,
pin_channel
,
1
);
...
...
bsp/k210/driver/drv_interrupt.c
0 → 100644
浏览文件 @
b25a2794
/*
* Copyright (c) 2006-2018, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2019-03-19 ZYH first version
*/
#include <plic.h>
void
plic_irq_handle
(
plic_irq_t
irq
)
{
plic_instance_t
(
*
plic_instance
)[
IRQN_MAX
]
=
plic_get_instance
();
if
(
plic_instance
[
0
][
irq
].
callback
)
{
plic_instance
[
0
][
irq
].
callback
(
plic_instance
[
0
][
irq
].
ctx
);
}
else
if
(
plic_instance
[
1
][
irq
].
callback
)
{
plic_instance
[
1
][
irq
].
callback
(
plic_instance
[
1
][
irq
].
ctx
);
}
}
bsp/k210/driver/drv_io_config.c
浏览文件 @
b25a2794
/*
* Copyright (c) 2006-2018, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2019-03-19 ZYH first version
*/
#include <rtthread.h>
#include <rtthread.h>
#include <fpioa.h>
#include <fpioa.h>
#include <drv_io_config.h>
#include <drv_io_config.h>
...
@@ -25,7 +35,7 @@ static struct io_config
...
@@ -25,7 +35,7 @@ static struct io_config
{
BSP_CAMERA_CMOS_PWDN_PIN
,
FUNC_CMOS_PWDN
},
{
BSP_CAMERA_CMOS_PWDN_PIN
,
FUNC_CMOS_PWDN
},
{
BSP_CAMERA_CMOS_XCLK_PIN
,
FUNC_CMOS_XCLK
},
{
BSP_CAMERA_CMOS_XCLK_PIN
,
FUNC_CMOS_XCLK
},
{
BSP_CAMERA_CMOS_PCLK_PIN
,
FUNC_CMOS_PCLK
},
{
BSP_CAMERA_CMOS_PCLK_PIN
,
FUNC_CMOS_PCLK
},
{
BSP_CAMERA_CMOS_
PCLK
_PIN
,
FUNC_CMOS_HREF
},
{
BSP_CAMERA_CMOS_
HREF
_PIN
,
FUNC_CMOS_HREF
},
#endif
#endif
#ifdef BSP_USING_SPI1
#ifdef BSP_USING_SPI1
...
@@ -73,3 +83,4 @@ int io_config_init(void)
...
@@ -73,3 +83,4 @@ int io_config_init(void)
}
}
INIT_BOARD_EXPORT
(
io_config_init
);
INIT_BOARD_EXPORT
(
io_config_init
);
bsp/k210/driver/drv_io_config.h
浏览文件 @
b25a2794
/*
* Copyright (c) 2006-2018, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2019-03-19 ZYH first version
*/
#ifndef __DRV_IO_CONFIG_H__
#ifndef __DRV_IO_CONFIG_H__
#define __DRV_IO_CONFIG_H__
#define __DRV_IO_CONFIG_H__
...
...
bsp/k210/driver/drv_spi.c
浏览文件 @
b25a2794
...
@@ -19,9 +19,12 @@
...
@@ -19,9 +19,12 @@
#include <sysctl.h>
#include <sysctl.h>
#include <gpiohs.h>
#include <gpiohs.h>
#include <string.h>
#include <string.h>
#include "utils.h"
#define DRV_SPI_DEVICE(spi_bus) (struct drv_spi_bus *)(spi_bus)
#define DRV_SPI_DEVICE(spi_bus) (struct drv_spi_bus *)(spi_bus)
#define MAX_CLOCK (40000000UL)
struct
drv_spi_bus
struct
drv_spi_bus
{
{
struct
rt_spi_bus
parent
;
struct
rt_spi_bus
parent
;
...
@@ -48,6 +51,7 @@ static rt_err_t drv_spi_configure(struct rt_spi_device *device,
...
@@ -48,6 +51,7 @@ static rt_err_t drv_spi_configure(struct rt_spi_device *device,
struct
rt_spi_configuration
*
configuration
)
struct
rt_spi_configuration
*
configuration
)
{
{
rt_err_t
ret
=
RT_EOK
;
rt_err_t
ret
=
RT_EOK
;
int
freq
=
0
;
struct
drv_spi_bus
*
bus
=
DRV_SPI_DEVICE
(
device
->
bus
);
struct
drv_spi_bus
*
bus
=
DRV_SPI_DEVICE
(
device
->
bus
);
struct
drv_cs
*
cs
=
(
struct
drv_cs
*
)
device
->
parent
.
user_data
;
struct
drv_cs
*
cs
=
(
struct
drv_cs
*
)
device
->
parent
.
user_data
;
RT_ASSERT
(
bus
!=
RT_NULL
);
RT_ASSERT
(
bus
!=
RT_NULL
);
...
@@ -60,31 +64,43 @@ static rt_err_t drv_spi_configure(struct rt_spi_device *device,
...
@@ -60,31 +64,43 @@ static rt_err_t drv_spi_configure(struct rt_spi_device *device,
#else
#else
spi_init
(
bus
->
spi_instance
,
configuration
->
mode
&
RT_SPI_MODE_3
,
SPI_FF_STANDARD
,
configuration
->
data_width
,
0
);
spi_init
(
bus
->
spi_instance
,
configuration
->
mode
&
RT_SPI_MODE_3
,
SPI_FF_STANDARD
,
configuration
->
data_width
,
0
);
#endif
#endif
spi_set_clk_rate
(
bus
->
spi_instance
,
configuration
->
max_hz
);
freq
=
spi_set_clk_rate
(
bus
->
spi_instance
,
configuration
->
max_hz
>
MAX_CLOCK
?
MAX_CLOCK
:
configuration
->
max_hz
);
rt_kprintf
(
"set spi freq %d
\n
"
,
freq
);
return
ret
;
return
ret
;
}
}
extern
void
spi_receive_data_normal_dma
(
dmac_channel_number_t
dma_send_channel_num
,
dmac_channel_number_t
dma_receive_channel_num
,
spi_device_num_t
spi_num
,
spi_chip_select_t
chip_select
,
const
void
*
cmd_buff
,
size_t
cmd_len
,
void
*
rx_buff
,
size_t
rx_len
);
void
__spi_set_tmod
(
uint8_t
spi_num
,
uint32_t
tmod
)
{
RT_ASSERT
(
spi_num
<
SPI_DEVICE_MAX
);
volatile
spi_t
*
spi_handle
=
spi
[
spi_num
];
uint8_t
tmod_offset
=
0
;
switch
(
spi_num
)
{
case
0
:
case
1
:
case
2
:
tmod_offset
=
8
;
break
;
case
3
:
default:
tmod_offset
=
10
;
break
;
}
set_bit
(
&
spi_handle
->
ctrlr0
,
3
<<
tmod_offset
,
tmod
<<
tmod_offset
);
}
static
rt_uint32_t
drv_spi_xfer
(
struct
rt_spi_device
*
device
,
struct
rt_spi_message
*
message
)
static
rt_uint32_t
drv_spi_xfer
(
struct
rt_spi_device
*
device
,
struct
rt_spi_message
*
message
)
{
{
struct
drv_spi_bus
*
bus
=
DRV_SPI_DEVICE
(
device
->
bus
);
struct
drv_spi_bus
*
bus
=
DRV_SPI_DEVICE
(
device
->
bus
);
struct
drv_cs
*
cs
=
(
struct
drv_cs
*
)
device
->
parent
.
user_data
;
struct
drv_cs
*
cs
=
(
struct
drv_cs
*
)
device
->
parent
.
user_data
;
struct
rt_spi_configuration
*
cfg
=
&
device
->
config
;
struct
rt_spi_configuration
*
cfg
=
&
device
->
config
;
const
uint8_t
*
tx_buff
=
message
->
send_buf
;
uint32_t
*
tx_buff
=
RT_NULL
;
uint
8_t
*
rx_buff
=
message
->
recv_buf
;
uint
32_t
*
rx_buff
=
RT_NULL
;
uint32_t
dummy
[
1024
]
;
int
i
;
size_t
send_size
,
recv_size
;
rt_ubase_t
dummy
=
0xFFFFFFFFU
;
send_size
=
message
->
length
;
__spi_set_tmod
(
bus
->
spi_instance
,
SPI_TMOD_TRANS_RECV
);
recv_size
=
message
->
length
;
RT_ASSERT
(
bus
!=
RT_NULL
);
RT_ASSERT
(
bus
!=
RT_NULL
);
...
@@ -94,18 +110,73 @@ static rt_uint32_t drv_spi_xfer(struct rt_spi_device *device, struct rt_spi_mess
...
@@ -94,18 +110,73 @@ static rt_uint32_t drv_spi_xfer(struct rt_spi_device *device, struct rt_spi_mess
}
}
if
(
message
->
length
)
if
(
message
->
length
)
{
{
if
(
!
tx_buff
)
spi_instance
[
bus
->
spi_instance
]
->
dmacr
=
0x3
;
spi_instance
[
bus
->
spi_instance
]
->
ssienr
=
0x01
;
sysctl_dma_select
(
bus
->
dma_send_channel
,
SYSCTL_DMA_SELECT_SSI0_TX_REQ
+
bus
->
spi_instance
*
2
);
sysctl_dma_select
(
bus
->
dma_recv_channel
,
SYSCTL_DMA_SELECT_SSI0_RX_REQ
+
bus
->
spi_instance
*
2
);
if
(
!
message
->
recv_buf
)
{
{
tx_buff
=
(
uint8_t
*
)
&
dummy
;
dmac_set_single_mode
(
bus
->
dma_recv_channel
,
(
void
*
)(
&
spi_instance
[
bus
->
spi_instance
]
->
dr
[
0
]),
&
dummy
,
DMAC_ADDR_NOCHANGE
,
DMAC_ADDR_NOCHANGE
,
send_size
=
1
;
DMAC_MSIZE_1
,
DMAC_TRANS_WIDTH_32
,
message
->
length
);
}
else
{
rx_buff
=
rt_calloc
(
message
->
length
*
4
,
1
);
if
(
!
rx_buff
)
{
goto
transfer_done
;
}
dmac_set_single_mode
(
bus
->
dma_recv_channel
,
(
void
*
)(
&
spi_instance
[
bus
->
spi_instance
]
->
dr
[
0
]),
rx_buff
,
DMAC_ADDR_NOCHANGE
,
DMAC_ADDR_INCREMENT
,
DMAC_MSIZE_1
,
DMAC_TRANS_WIDTH_32
,
message
->
length
);
}
}
if
(
!
rx_buff
)
if
(
!
message
->
send_buf
)
{
dmac_set_single_mode
(
bus
->
dma_send_channel
,
&
dummy
,
(
void
*
)(
&
spi_instance
[
bus
->
spi_instance
]
->
dr
[
0
]),
DMAC_ADDR_NOCHANGE
,
DMAC_ADDR_NOCHANGE
,
DMAC_MSIZE_4
,
DMAC_TRANS_WIDTH_32
,
message
->
length
);
}
else
{
tx_buff
=
rt_malloc
(
message
->
length
*
4
);
if
(
!
tx_buff
)
{
goto
transfer_done
;
}
for
(
i
=
0
;
i
<
message
->
length
;
i
++
)
{
tx_buff
[
i
]
=
((
uint8_t
*
)
message
->
send_buf
)[
i
];
}
dmac_set_single_mode
(
bus
->
dma_send_channel
,
tx_buff
,
(
void
*
)(
&
spi_instance
[
bus
->
spi_instance
]
->
dr
[
0
]),
DMAC_ADDR_INCREMENT
,
DMAC_ADDR_NOCHANGE
,
DMAC_MSIZE_4
,
DMAC_TRANS_WIDTH_32
,
message
->
length
);
}
spi_instance
[
bus
->
spi_instance
]
->
ser
=
1U
<<
cs
->
cs_index
;
dmac_wait_done
(
bus
->
dma_send_channel
);
dmac_wait_done
(
bus
->
dma_recv_channel
);
spi_instance
[
bus
->
spi_instance
]
->
ser
=
0x00
;
spi_instance
[
bus
->
spi_instance
]
->
ssienr
=
0x00
;
if
(
message
->
recv_buf
)
{
for
(
i
=
0
;
i
<
message
->
length
;
i
++
)
{
((
uint8_t
*
)
message
->
recv_buf
)[
i
]
=
(
uint8_t
)
rx_buff
[
i
];
}
}
transfer_done:
if
(
tx_buff
)
{
rt_free
(
tx_buff
);
}
if
(
rx_buff
)
{
{
rx_buff
=
(
uint8_t
*
)
&
dummy
;
rt_free
(
rx_buff
);
recv_size
=
1
;
}
}
spi_dup_send_receive_data_dma
(
bus
->
dma_send_channel
,
bus
->
dma_recv_channel
,
bus
->
spi_instance
,
cs
->
cs_index
,
tx_buff
,
send_size
,
rx_buff
,
recv_size
);
}
}
if
(
message
->
cs_release
)
if
(
message
->
cs_release
)
...
...
bsp/k210/rtconfig.h
浏览文件 @
b25a2794
...
@@ -49,9 +49,8 @@
...
@@ -49,9 +49,8 @@
#define RT_USING_MEMPOOL
#define RT_USING_MEMPOOL
/* RT_USING_MEMHEAP is not set */
/* RT_USING_MEMHEAP is not set */
/* RT_USING_NOHEAP is not set */
/* RT_USING_NOHEAP is not set */
#define RT_USING_SMALL_MEM
/* RT_USING_SMALL_MEM is not set */
/* RT_USING_SLAB is not set */
#define RT_USING_SLAB
/* RT_USING_MEMTRACE is not set */
#define RT_USING_HEAP
#define RT_USING_HEAP
/* Kernel Device Object */
/* Kernel Device Object */
...
@@ -101,9 +100,9 @@
...
@@ -101,9 +100,9 @@
#define RT_USING_DFS
#define RT_USING_DFS
#define DFS_USING_WORKDIR
#define DFS_USING_WORKDIR
#define DFS_FILESYSTEMS_MAX
4
#define DFS_FILESYSTEMS_MAX
16
#define DFS_FILESYSTEM_TYPES_MAX
4
#define DFS_FILESYSTEM_TYPES_MAX
16
#define DFS_FD_MAX
16
#define DFS_FD_MAX
64
/* RT_USING_DFS_MNTTABLE is not set */
/* RT_USING_DFS_MNTTABLE is not set */
#define RT_USING_DFS_ELMFAT
#define RT_USING_DFS_ELMFAT
...
@@ -118,7 +117,7 @@
...
@@ -118,7 +117,7 @@
#define RT_DFS_ELM_USE_LFN 3
#define RT_DFS_ELM_USE_LFN 3
#define RT_DFS_ELM_MAX_LFN 255
#define RT_DFS_ELM_MAX_LFN 255
#define RT_DFS_ELM_DRIVES 2
#define RT_DFS_ELM_DRIVES 2
#define RT_DFS_ELM_MAX_SECTOR_SIZE
512
#define RT_DFS_ELM_MAX_SECTOR_SIZE
4096
/* RT_DFS_ELM_USE_ERASE is not set */
/* RT_DFS_ELM_USE_ERASE is not set */
#define RT_DFS_ELM_REENTRANT
#define RT_DFS_ELM_REENTRANT
#define RT_USING_DFS_DEVFS
#define RT_USING_DFS_DEVFS
...
@@ -150,7 +149,11 @@
...
@@ -150,7 +149,11 @@
#define RT_USING_SPI
#define RT_USING_SPI
/* RT_USING_QSPI is not set */
/* RT_USING_QSPI is not set */
#define RT_USING_SPI_MSD
#define RT_USING_SPI_MSD
/* RT_USING_SFUD is not set */
#define RT_USING_SFUD
#define RT_SFUD_USING_SFDP
#define RT_SFUD_USING_FLASH_INFO_TABLE
/* RT_SFUD_USING_QSPI is not set */
#define RT_DEBUG_SFUD
/* RT_USING_W25QXX is not set */
/* RT_USING_W25QXX is not set */
/* RT_USING_GD is not set */
/* RT_USING_GD is not set */
/* RT_USING_ENC28J60 is not set */
/* RT_USING_ENC28J60 is not set */
...
...
libcpu/risc-v/k210/interrupt.c
浏览文件 @
b25a2794
...
@@ -230,10 +230,6 @@ uintptr_t handle_irq_m_ext(uintptr_t cause, uintptr_t epc)
...
@@ -230,10 +230,6 @@ uintptr_t handle_irq_m_ext(uintptr_t cause, uintptr_t epc)
/* Restore primitive IRQ threshold */
/* Restore primitive IRQ threshold */
plic
->
targets
.
target
[
core_id
].
priority_threshold
=
int_threshold
;
plic
->
targets
.
target
[
core_id
].
priority_threshold
=
int_threshold
;
}
}
else
{
rt_kprintf
(
"unhandled trap!
\n
"
);
}
return
epc
;
return
epc
;
}
}
...
@@ -270,8 +266,51 @@ uintptr_t handle_trap(uintptr_t mcause, uintptr_t epc)
...
@@ -270,8 +266,51 @@ uintptr_t handle_trap(uintptr_t mcause, uintptr_t epc)
rt_hw_interrupt_disable
();
rt_hw_interrupt_disable
();
tid
=
rt_thread_self
();
tid
=
rt_thread_self
();
rt_kprintf
(
"
\n
Exception:
\n
"
);
switch
(
cause
)
{
case
CAUSE_MISALIGNED_FETCH
:
rt_kprintf
(
"Instruction address misaligned"
);
break
;
case
CAUSE_FAULT_FETCH
:
rt_kprintf
(
"Instruction access fault"
);
break
;
case
CAUSE_ILLEGAL_INSTRUCTION
:
rt_kprintf
(
"Illegal instruction"
);
break
;
case
CAUSE_BREAKPOINT
:
rt_kprintf
(
"Breakpoint"
);
break
;
case
CAUSE_MISALIGNED_LOAD
:
rt_kprintf
(
"Load address misaligned"
);
break
;
case
CAUSE_FAULT_LOAD
:
rt_kprintf
(
"Load access fault"
);
break
;
case
CAUSE_MISALIGNED_STORE
:
rt_kprintf
(
"Store address misaligned"
);
break
;
case
CAUSE_FAULT_STORE
:
rt_kprintf
(
"Store access fault"
);
break
;
case
CAUSE_USER_ECALL
:
rt_kprintf
(
"Environment call from U-mode"
);
break
;
case
CAUSE_SUPERVISOR_ECALL
:
rt_kprintf
(
"Environment call from S-mode"
);
break
;
case
CAUSE_HYPERVISOR_ECALL
:
rt_kprintf
(
"Environment call from H-mode"
);
break
;
case
CAUSE_MACHINE_ECALL
:
rt_kprintf
(
"Environment call from M-mode"
);
break
;
default:
rt_kprintf
(
"Uknown exception : %08lX"
,
cause
);
break
;
}
rt_kprintf
(
"
\n
"
);
rt_kprintf
(
"
\n
"
);
rt_kprintf
(
"
unhandled trap, epc => 0x%08x, INT[%d]
\n
"
,
epc
,
rt_interrupt_get_nest
()
);
rt_kprintf
(
"
exception pc => 0x%08x
\n
"
,
epc
);
rt_kprintf
(
"current thread: %.*s
\n
"
,
RT_NAME_MAX
,
tid
->
name
);
rt_kprintf
(
"current thread: %.*s
\n
"
,
RT_NAME_MAX
,
tid
->
name
);
#ifdef RT_USING_FINSH
#ifdef RT_USING_FINSH
list_thread
();
list_thread
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录