с такой конфигурацией задачи запускаются хотя бы по разу, но потом встают
This commit is contained in:
parent
c5767f8062
commit
b28f4ee090
@ -26,8 +26,8 @@ extern "C" {
|
|||||||
* See https://www.freertos.org/a00110.html.
|
* See https://www.freertos.org/a00110.html.
|
||||||
*----------------------------------------------------------*/
|
*----------------------------------------------------------*/
|
||||||
|
|
||||||
#define configMTIME_BASE_ADDRESS SCR1_TIMER_BASE_ADDRESS//((uintptr_t)&SCR1_TIMER->MTIME)
|
#define configMTIME_BASE_ADDRESS (SCR1_TIMER_BASE_ADDRESS + 0x8) // from scr1 core docs
|
||||||
#define configMTIMECMP_BASE_ADDRESS SCR1_TIMER_BASE_ADDRESS//((uintptr_t)&SCR1_TIMER->MTIMECMP)
|
#define configMTIMECMP_BASE_ADDRESS (SCR1_TIMER_BASE_ADDRESS + 0x10) // from scr1 core docs
|
||||||
|
|
||||||
/* Delay definition - here, the user can choose which delay implementation is required.
|
/* Delay definition - here, the user can choose which delay implementation is required.
|
||||||
* The default is to change nothing. */
|
* The default is to change nothing. */
|
||||||
@ -36,7 +36,7 @@ extern "C" {
|
|||||||
#define configUSE_PREEMPTION 1
|
#define configUSE_PREEMPTION 1
|
||||||
|
|
||||||
#define configCPU_CLOCK_HZ ( ( uint32_t ) F_CPU ) // This F_CPU variable set by the environment
|
#define configCPU_CLOCK_HZ ( ( uint32_t ) F_CPU ) // This F_CPU variable set by the environment
|
||||||
#define configTICK_RATE_HZ ( ( TickType_t ) 1000 )
|
#define configTICK_RATE_HZ ( ( TickType_t ) 100 )
|
||||||
#define configUSE_16_BIT_TICKS 0
|
#define configUSE_16_BIT_TICKS 0
|
||||||
|
|
||||||
#define configMAX_PRIORITIES 4
|
#define configMAX_PRIORITIES 4
|
||||||
@ -48,7 +48,7 @@ extern "C" {
|
|||||||
#define configSTACK_DEPTH_TYPE uint16_t
|
#define configSTACK_DEPTH_TYPE uint16_t
|
||||||
|
|
||||||
#define configMINIMAL_STACK_SIZE 192
|
#define configMINIMAL_STACK_SIZE 192
|
||||||
#define configISR_STACK_SIZE_WORDS 64 // todo сколько надо?
|
#define configISR_STACK_SIZE_WORDS 128 // todo сколько надо?
|
||||||
#define configCHECK_FOR_STACK_OVERFLOW 1
|
#define configCHECK_FOR_STACK_OVERFLOW 1
|
||||||
#define configUSE_TRACE_FACILITY 0
|
#define configUSE_TRACE_FACILITY 0
|
||||||
|
|
||||||
|
|||||||
@ -124,7 +124,6 @@ size_t xTaskReturnAddress = ( size_t ) portTASK_RETURN_ADDRESS;
|
|||||||
#endif /* configCHECK_FOR_STACK_OVERFLOW > 2 */
|
#endif /* configCHECK_FOR_STACK_OVERFLOW > 2 */
|
||||||
|
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
#if ( configMTIME_BASE_ADDRESS != 0 ) && ( configMTIMECMP_BASE_ADDRESS != 0 )
|
#if ( configMTIME_BASE_ADDRESS != 0 ) && ( configMTIMECMP_BASE_ADDRESS != 0 )
|
||||||
|
|
||||||
void vPortSetupTimerInterrupt( void )
|
void vPortSetupTimerInterrupt( void )
|
||||||
@ -132,11 +131,8 @@ size_t xTaskReturnAddress = ( size_t ) portTASK_RETURN_ADDRESS;
|
|||||||
uint32_t ulCurrentTimeHigh, ulCurrentTimeLow;
|
uint32_t ulCurrentTimeHigh, ulCurrentTimeLow;
|
||||||
volatile uint32_t * const pulTimeHigh = ( volatile uint32_t * const ) ( ( configMTIME_BASE_ADDRESS ) + 4UL ); /* 8-byte type so high 32-bit word is 4 bytes up. */
|
volatile uint32_t * const pulTimeHigh = ( volatile uint32_t * const ) ( ( configMTIME_BASE_ADDRESS ) + 4UL ); /* 8-byte type so high 32-bit word is 4 bytes up. */
|
||||||
volatile uint32_t * const pulTimeLow = ( volatile uint32_t * const ) ( configMTIME_BASE_ADDRESS );
|
volatile uint32_t * const pulTimeLow = ( volatile uint32_t * const ) ( configMTIME_BASE_ADDRESS );
|
||||||
volatile uint32_t ulHartId;
|
|
||||||
|
|
||||||
__asm volatile ( "csrr %0, mhartid" : "=r" ( ulHartId ) );
|
pullMachineTimerCompareRegister = ( volatile uint64_t * ) ( ullMachineTimerCompareRegisterBase );
|
||||||
|
|
||||||
pullMachineTimerCompareRegister = ( volatile uint64_t * ) ( ullMachineTimerCompareRegisterBase + ( ulHartId * sizeof( uint64_t ) ) );
|
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
|||||||
@ -81,7 +81,6 @@ typedef portUBASE_TYPE TickType_t;
|
|||||||
|
|
||||||
/* Architecture specifics. */
|
/* Architecture specifics. */
|
||||||
#define portSTACK_GROWTH ( -1 )
|
#define portSTACK_GROWTH ( -1 )
|
||||||
// todo так оставить?
|
|
||||||
#define portTICK_PERIOD_MS ( ( TickType_t ) 1000 / configTICK_RATE_HZ )
|
#define portTICK_PERIOD_MS ( ( TickType_t ) 1000 / configTICK_RATE_HZ )
|
||||||
#ifdef __riscv_32e
|
#ifdef __riscv_32e
|
||||||
#define portBYTE_ALIGNMENT 8 /* RV32E uses RISC-V EABI with reduced stack alignment requirements */
|
#define portBYTE_ALIGNMENT 8 /* RV32E uses RISC-V EABI with reduced stack alignment requirements */
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user