forked from Embedded_Projects/CH32V307_Template
Disabled fast interrupt for open source toolchain.
This commit is contained in:
parent
2afc177bc4
commit
b5badc857a
|
@ -4,8 +4,8 @@
|
|||
* Version : V1.0.0
|
||||
* Date : 2021/06/06
|
||||
* Description : CH32V303 vector table for eclipse toolchain.
|
||||
* Copyright (c) 2021 Nanjing Qinheng Microelectronics Co., Ltd.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
* Copyright (c) 2021 Nanjing Qinheng Microelectronics Co., Ltd.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*******************************************************************************/
|
||||
|
||||
.section .init,"ax",@progbits
|
||||
|
@ -348,7 +348,11 @@ handle_reset:
|
|||
csrw 0xbc0, t0
|
||||
|
||||
/* Enable nested and hardware stack */
|
||||
li t0, 0x1f
|
||||
/* li t0, 0x1f */ /* For MRS proprietary GCC compilers */
|
||||
|
||||
/* Enable nested interrupt, disable hardware stack */
|
||||
li t0, 0x1e /* Refer to RISC-V4 PFIC manual */
|
||||
|
||||
csrw 0x804, t0
|
||||
|
||||
/* Enable floating point and interrupt */
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* Version : V1.0.0
|
||||
* Date : 2021/06/06
|
||||
* Description : CH32V307-CH32V305 vector table for eclipse toolchain.
|
||||
* Copyright (c) 2021 Nanjing Qinheng Microelectronics Co., Ltd.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
* Copyright (c) 2021 Nanjing Qinheng Microelectronics Co., Ltd.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*******************************************************************************/
|
||||
|
||||
.section .init,"ax",@progbits
|
||||
|
@ -368,7 +368,11 @@ handle_reset:
|
|||
csrw 0xbc0, t0
|
||||
|
||||
/* Enable nested and hardware stack */
|
||||
li t0, 0x1f
|
||||
/* li t0, 0x1f */ /* For MRS proprietary GCC compilers */
|
||||
|
||||
/* Enable nested interrupt, disable hardware stack */
|
||||
li t0, 0x1e /* Refer to RISC-V4 PFIC manual */
|
||||
|
||||
csrw 0x804, t0
|
||||
|
||||
/* Enable floating point and interrupt */
|
||||
|
|
|
@ -47,6 +47,7 @@ set(TARGET_C_SOURCES
|
|||
"BSP/Peripheral/src/ch32v30x_wwdg.c"
|
||||
"src/ch32v30x_it.c"
|
||||
"src/main.c"
|
||||
"src/syscalls.c"
|
||||
"src/system_ch32v30x.c"
|
||||
)
|
||||
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
*******************************************************************************/
|
||||
#include "ch32v30x_it.h"
|
||||
|
||||
void NMI_Handler(void) __attribute__((interrupt("WCH-Interrupt-fast")));
|
||||
void HardFault_Handler(void) __attribute__((interrupt("WCH-Interrupt-fast")));
|
||||
void NMI_Handler(void) __attribute__((interrupt()));
|
||||
void HardFault_Handler(void) __attribute__((interrupt()));
|
||||
|
||||
/*********************************************************************
|
||||
* @fn NMI_Handler
|
||||
|
|
11
src/main.c
11
src/main.c
|
@ -1,7 +1,16 @@
|
|||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <debug.h>
|
||||
|
||||
int main(void) {
|
||||
|
||||
USART_Printf_Init(115200);
|
||||
|
||||
printf("Hello world?\r\n");
|
||||
|
||||
for(;;) {
|
||||
//
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
#include <sys/stat.h>
|
||||
|
||||
int _fstat(int file, struct stat *st) {
|
||||
st->st_mode = S_IFCHR;
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue