diff --git a/Ubiquitous/XiUOS/arch/risc-v/rv32m1_vega/interrupt_gcc.S b/Ubiquitous/XiUOS/arch/risc-v/rv32m1_vega/interrupt_gcc.S index 0b47c9e29..6e8d2f081 100644 --- a/Ubiquitous/XiUOS/arch/risc-v/rv32m1_vega/interrupt_gcc.S +++ b/Ubiquitous/XiUOS/arch/risc-v/rv32m1_vega/interrupt_gcc.S @@ -20,7 +20,7 @@ IRQ_Handler: mv fp, sp /* switch to interrupt stack */ - la sp, __stack + # la sp, __stack /* interrupt handle */ diff --git a/Ubiquitous/XiUOS/arch/risc-v/rv32m1_vega/startup_RV32M1_ri5cy.S b/Ubiquitous/XiUOS/arch/risc-v/rv32m1_vega/startup_RV32M1_ri5cy.S index 5f153a569..d1e81e712 100644 --- a/Ubiquitous/XiUOS/arch/risc-v/rv32m1_vega/startup_RV32M1_ri5cy.S +++ b/Ubiquitous/XiUOS/arch/risc-v/rv32m1_vega/startup_RV32M1_ri5cy.S @@ -23,7 +23,7 @@ // this License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR // CONDITIONS OF ANY KIND, either express or implied. See the License for the // specific language governing permissions and limitations under the License. - +.extern Rv32m1VgeaStart #define EXCEPTION_STACK_SIZE 0x58 .text @@ -98,7 +98,7 @@ Reset_Handler: # Enable global interrupt. */ # csrsi mstatus, 8 - jal entry + jal Rv32m1VgeaStart ebreak .size Reset_Handler, . - Reset_Handler diff --git a/Ubiquitous/XiUOS/board/rv32m1_vega/board.c b/Ubiquitous/XiUOS/board/rv32m1_vega/board.c index 6a0c694c1..819e5559e 100644 --- a/Ubiquitous/XiUOS/board/rv32m1_vega/board.c +++ b/Ubiquitous/XiUOS/board/rv32m1_vega/board.c @@ -18,6 +18,12 @@ #include extern int InitHwUart(); +extern void entry(void); + +void Rv32m1VgeaStart(void) +{ + entry(); +} void LPIT0_IRQHandler(void) { @@ -55,21 +61,13 @@ void InitBoardHardware(void) INTMUX_Init(INTMUX0); INTMUX_EnableInterrupt(INTMUX0, 0, PORTC_IRQn); - /* initialize hardware interrupt */ + InitHwUart(); InitHwTick(); + InstallConsole("uart0", "uart0_drv", "uart0_dev0"); + KPrintf("console init completed.\n"); InitBoardMemory(MEMORY_START_ADDRESS, MEMORY_END_ADDRESS); - - InitHwUart(); - InstallConsole("uart0", "uart0_drv", "uart0_dev"); - - KPrintf("console init completed.\n"); - KPrintf("board initialization......\n"); - - // InitHwTick(); KPrintf("memory address range: [0x%08x - 0x%08x], size: %d\n", (x_ubase) MEMORY_START_ADDRESS, (x_ubase) MEMORY_END_ADDRESS, RV32M1VEGA_SRAM_SIZE); - /* initialize memory system */ - KPrintf("board init done.\n"); KPrintf("start kernel...\n"); } diff --git a/Ubiquitous/XiUOS/board/rv32m1_vega/config.mk b/Ubiquitous/XiUOS/board/rv32m1_vega/config.mk index f9fcb6cf3..bc88ca594 100755 --- a/Ubiquitous/XiUOS/board/rv32m1_vega/config.mk +++ b/Ubiquitous/XiUOS/board/rv32m1_vega/config.mk @@ -1,9 +1,9 @@ -export CFLAGS := -march=rv32imac -mabi=ilp32 -fno-builtin -fno-exceptions -ffunction-sections -O2 -Os +export CFLAGS := -march=rv32imac -mabi=ilp32 -fno-builtin -fno-exceptions -ffunction-sections -O0 -ggdb -Werror export AFLAGS := -c -march=rv32imac -mabi=ilp32 -x assembler-with-cpp -ggdb export LFLAGS := -march=rv32imac -mabi=ilp32 -nostartfiles -Wl,--gc-sections,-Map=XiUOS_rv32m1_vega.map,-cref,-u,Reset_Handler -T $(BSP_ROOT)/link.lds -export CXXFLAGS := -march=rv32imac -mabi=ilp32 -fno-builtin -fno-exceptions -ffunction-sections -O2 -Os +export CXXFLAGS := -march=rv32imac -mabi=ilp32 -fno-builtin -fno-exceptions -ffunction-sections -O0 -ggdb -Werror export CROSS_COMPILE ?=/opt/gnu-mcu-eclipse/riscv-none-gcc/8.2.0-2.1-20190425-1021/bin/riscv-none-embed- diff --git a/Ubiquitous/XiUOS/board/rv32m1_vega/third_party_driver/uart/connect_uart.c b/Ubiquitous/XiUOS/board/rv32m1_vega/third_party_driver/uart/connect_uart.c index a2a83852d..e4b47161b 100755 --- a/Ubiquitous/XiUOS/board/rv32m1_vega/third_party_driver/uart/connect_uart.c +++ b/Ubiquitous/XiUOS/board/rv32m1_vega/third_party_driver/uart/connect_uart.c @@ -125,8 +125,8 @@ static uint32 SerialInit(struct SerialDriver *serial_drv, struct BusConfigureInf break; } - config.enableTx = 0; - config.enableRx = 0; + config.enableTx = 1; + config.enableRx = 1; CLOCK_SetIpSrc(kCLOCK_Lpuart0, kCLOCK_IpSrcFircAsync); diff --git a/Ubiquitous/XiUOS/kernel/memory/byte_manage.c b/Ubiquitous/XiUOS/kernel/memory/byte_manage.c index 0df9136da..14cf27fa8 100644 --- a/Ubiquitous/XiUOS/kernel/memory/byte_manage.c +++ b/Ubiquitous/XiUOS/kernel/memory/byte_manage.c @@ -1222,8 +1222,9 @@ void ShowBuddy(void) }; } - KPrintf("\n\033[41;1mlist extern memory information\033[0m\n"); + #ifdef MEM_EXTERN_SRAM + KPrintf("\n\033[41;1mlist extern memory information\033[0m\n"); for(i = 0; i < EXTSRAM_MAX_NUM; i++) { if(NONE != ExtByteManager[i].done){ KPrintf("\nlist extern sram[%d] memory information\n\n",i); diff --git a/Ubiquitous/XiUOS/kernel/thread/tick.c b/Ubiquitous/XiUOS/kernel/thread/tick.c index 6c2c01439..faf39ef93 100644 --- a/Ubiquitous/XiUOS/kernel/thread/tick.c +++ b/Ubiquitous/XiUOS/kernel/thread/tick.c @@ -74,7 +74,9 @@ void TickAndTaskTimesliceUpdate(void) RoundRobinTaskTimesliceUpdate(task); #elif defined (SCHED_POLICY_RR_REMAINSLICE) task = GetKTaskDescriptor(); - RoundRobinRemainTaskTimesliceUpdate(task); + if(task){ + RoundRobinRemainTaskTimesliceUpdate(task); + } #endif CheckTaskDelay(); #ifdef KERNEL_SOFTTIMER