diff --git a/arch/risc-v/src/bl602/bl602_boot2.h b/arch/risc-v/src/bl602/bl602_boot2.h index cc91ae2f2ba..4a7ff08bf17 100644 --- a/arch/risc-v/src/bl602/bl602_boot2.h +++ b/arch/risc-v/src/bl602/bl602_boot2.h @@ -45,6 +45,7 @@ enum pt_table_error_e PT_ERROR_ENTRY_NOT_FOUND, /* Partition table error type:entry not found */ PT_ERROR_ENTRY_UPDATE_FAIL, /* Partition table error type:entry update fail */ + PT_ERROR_CRC32, /* Partition table error type:crc32 error */ PT_ERROR_PARAMETER, /* Partition table error type:input parameter error */ PT_ERROR_FALSH_READ, /* Partition table error type:flash read error */ diff --git a/arch/risc-v/src/bl602/bl602_oneshot_lowerhalf.c b/arch/risc-v/src/bl602/bl602_oneshot_lowerhalf.c index 23184776d43..535f59d8c42 100644 --- a/arch/risc-v/src/bl602/bl602_oneshot_lowerhalf.c +++ b/arch/risc-v/src/bl602/bl602_oneshot_lowerhalf.c @@ -395,12 +395,16 @@ FAR struct oneshot_lowerhalf_s *oneshot_initialize(int chan, timstr.pl_trig_src = TIMER_PRELOAD_TRIG_COMP0; /* Timer count register preload trigger source * slelect */ + timstr.count_mode = TIMER_COUNT_PRELOAD; /* Timer count mode */ + timstr.clock_division = (TIMER_CLK_DIV * resolution) - 1; /* Timer clock divison value */ + timstr.match_val0 = TIMER_MAX_VALUE; /* Timer match 0 value 0 */ timstr.match_val1 = TIMER_MAX_VALUE; /* Timer match 1 value 0 */ timstr.match_val2 = TIMER_MAX_VALUE; /* Timer match 2 value 0 */ + timstr.pre_load_val = TIMER_MAX_VALUE; /* Timer preload value */ timer_intmask(chan, TIMER_INT_ALL, 1); diff --git a/arch/risc-v/src/bl602/bl602_tim_lowerhalf.c b/arch/risc-v/src/bl602/bl602_tim_lowerhalf.c index e0b9da3587e..ddda6fd0e07 100644 --- a/arch/risc-v/src/bl602/bl602_tim_lowerhalf.c +++ b/arch/risc-v/src/bl602/bl602_tim_lowerhalf.c @@ -52,6 +52,7 @@ struct bl602_lowerhalf_s { FAR const struct timer_ops_s *ops; /* Lower half operations */ + tccb_t callback; /* Current upper half interrupt callback */ FAR void *arg; /* Argument passed to upper half callback */ bool started; /* True: Timer has been started */ @@ -403,6 +404,7 @@ int bl602_timer_initialize(FAR const char *devpath, int timer) timstr.pl_trig_src = TIMER_PRELOAD_TRIG_COMP0; /* Timer count register preload trigger source slelect */ + timstr.count_mode = TIMER_COUNT_PRELOAD; /* Timer count mode */ timstr.clock_division = TIMER_CLK_DIV; /* Timer clock divison value */ timstr.match_val0 = TIMER_MAX_VALUE; /* Timer match 0 value 0 */ diff --git a/arch/risc-v/src/bl602/hardware/bl602_timer.h b/arch/risc-v/src/bl602/hardware/bl602_timer.h index f71755895bb..97538ba5c68 100644 --- a/arch/risc-v/src/bl602/hardware/bl602_timer.h +++ b/arch/risc-v/src/bl602/hardware/bl602_timer.h @@ -599,8 +599,11 @@ struct timer_cfg_s { timer_chan_t timer_ch; /* Timer channel */ timer_clksrc_t clk_src; /* Timer clock source */ - timer_preload_trig_t - pl_trig_src; /* Timer count register preload trigger source slelect */ + + /* Timer count register preload trigger source slelect */ + + timer_preload_trig_t pl_trig_src; + timer_countmode_t count_mode; /* Timer count mode */ uint8_t clock_division; /* Timer clock divison value */ uint32_t match_val0; /* Timer match 0 value 0 */ diff --git a/arch/risc-v/src/bl602/hardware/bl602_uart.h b/arch/risc-v/src/bl602/hardware/bl602_uart.h index 7166432850e..786c5765951 100644 --- a/arch/risc-v/src/bl602/hardware/bl602_uart.h +++ b/arch/risc-v/src/bl602/hardware/bl602_uart.h @@ -693,8 +693,13 @@ enum uart_bytebits_inverse_e enum uart_auto_baudrate_detection_e { - UART_AUTOBAUD_0X55, /* UART auto baudrate detection using codeword 0x55 */ - UART_AUTOBAUD_STARTBIT /* UART auto baudrate detection using start bit */ + /* UART auto baudrate detection using codeword 0x55 */ + + UART_AUTOBAUD_0X55, + + /* UART auto baudrate detection using start bit */ + + UART_AUTOBAUD_STARTBIT }; /* UART interrupt type definition */