From 2ac806f992a32ea93f008ef893b0bedae68b9d28 Mon Sep 17 00:00:00 2001 From: rtel Date: Mon, 10 Dec 2018 20:55:32 +0000 Subject: [PATCH] Microsemi RISC-V project: Reorganize project to separate Microsemi code into its own directory. Add many more demo and tests. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@2602 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- .../.cproject | 18 ++-- .../.project | 30 ++++++ .../.settings/language.settings.xml | 2 +- .../FreeRTOSConfig.h | 25 ++--- .../{ => Microsemi_Code}/Packages/.repos.xml | 0 .../drivers/Core16550/core16550_regs.h | 0 .../drivers/Core16550/core_16550.c | 0 .../drivers/Core16550/core_16550.h | 0 .../drivers/CoreGPIO/core_gpio.c | 0 .../drivers/CoreGPIO/core_gpio.h | 0 .../drivers/CoreGPIO/coregpio_regs.h | 0 .../drivers/CoreI2C/core_i2c.c | 0 .../drivers/CoreI2C/core_i2c.h | 0 .../drivers/CoreI2C/core_smbus_regs.h | 0 .../drivers/CoreI2C/i2c_interrupt.c | 0 .../drivers/CoreTimer/core_timer.c | 0 .../drivers/CoreTimer/core_timer.h | 0 .../drivers/CoreTimer/coretimer_regs.h | 0 .../drivers/CoreUARTapb/core_uart_apb.c | 0 .../drivers/CoreUARTapb/core_uart_apb.h | 0 .../drivers/CoreUARTapb/coreuartapb_regs.h | 0 .../{ => Microsemi_Code}/hal/cpu_types.h | 0 .../{ => Microsemi_Code}/hal/hal.h | 0 .../{ => Microsemi_Code}/hal/hal_assert.h | 0 .../{ => Microsemi_Code}/hal/hal_irq.c | 0 .../{ => Microsemi_Code}/hal/hw_macros.h | 0 .../{ => Microsemi_Code}/hal/hw_reg_access.S | 0 .../{ => Microsemi_Code}/hal/hw_reg_access.h | 0 .../{ => Microsemi_Code}/riscv_hal/encoding.h | 0 .../{ => Microsemi_Code}/riscv_hal/entry.S | 0 .../{ => Microsemi_Code}/riscv_hal/init.c | 0 .../riscv_hal/microsemi-riscv-igloo2.ld | 0 .../riscv_hal/microsemi-riscv-ram.ld | 0 .../riscv_hal/riscv_hal.c | 0 .../riscv_hal/riscv_hal.h | 0 .../riscv_hal/riscv_hal_stubs.c | 0 .../riscv_hal/riscv_plic.h | 0 .../riscv_hal/sample_hw_platform.h | 0 .../{ => Microsemi_Code}/riscv_hal/syscall.c | 0 .../full_demo/main_full.c | 95 ++++++++++++++----- .../RISC-V_IGLOO2_Creative_SoftConsole/main.c | 10 +- 41 files changed, 128 insertions(+), 52 deletions(-) rename FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/{ => Microsemi_Code}/Packages/.repos.xml (100%) rename FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/{ => Microsemi_Code}/drivers/Core16550/core16550_regs.h (100%) rename FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/{ => Microsemi_Code}/drivers/Core16550/core_16550.c (100%) rename FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/{ => Microsemi_Code}/drivers/Core16550/core_16550.h (100%) rename FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/{ => Microsemi_Code}/drivers/CoreGPIO/core_gpio.c (100%) rename FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/{ => Microsemi_Code}/drivers/CoreGPIO/core_gpio.h (100%) rename FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/{ => Microsemi_Code}/drivers/CoreGPIO/coregpio_regs.h (100%) rename FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/{ => Microsemi_Code}/drivers/CoreI2C/core_i2c.c (100%) rename FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/{ => Microsemi_Code}/drivers/CoreI2C/core_i2c.h (100%) rename FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/{ => Microsemi_Code}/drivers/CoreI2C/core_smbus_regs.h (100%) rename FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/{ => Microsemi_Code}/drivers/CoreI2C/i2c_interrupt.c (100%) rename FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/{ => Microsemi_Code}/drivers/CoreTimer/core_timer.c (100%) rename FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/{ => Microsemi_Code}/drivers/CoreTimer/core_timer.h (100%) rename FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/{ => Microsemi_Code}/drivers/CoreTimer/coretimer_regs.h (100%) rename FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/{ => Microsemi_Code}/drivers/CoreUARTapb/core_uart_apb.c (100%) rename FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/{ => Microsemi_Code}/drivers/CoreUARTapb/core_uart_apb.h (100%) rename FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/{ => Microsemi_Code}/drivers/CoreUARTapb/coreuartapb_regs.h (100%) rename FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/{ => Microsemi_Code}/hal/cpu_types.h (100%) rename FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/{ => Microsemi_Code}/hal/hal.h (100%) rename FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/{ => Microsemi_Code}/hal/hal_assert.h (100%) rename FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/{ => Microsemi_Code}/hal/hal_irq.c (100%) rename FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/{ => Microsemi_Code}/hal/hw_macros.h (100%) rename FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/{ => Microsemi_Code}/hal/hw_reg_access.S (100%) rename FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/{ => Microsemi_Code}/hal/hw_reg_access.h (100%) rename FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/{ => Microsemi_Code}/riscv_hal/encoding.h (100%) rename FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/{ => Microsemi_Code}/riscv_hal/entry.S (100%) rename FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/{ => Microsemi_Code}/riscv_hal/init.c (100%) rename FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/{ => Microsemi_Code}/riscv_hal/microsemi-riscv-igloo2.ld (100%) rename FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/{ => Microsemi_Code}/riscv_hal/microsemi-riscv-ram.ld (100%) rename FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/{ => Microsemi_Code}/riscv_hal/riscv_hal.c (100%) rename FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/{ => Microsemi_Code}/riscv_hal/riscv_hal.h (100%) rename FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/{ => Microsemi_Code}/riscv_hal/riscv_hal_stubs.c (100%) rename FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/{ => Microsemi_Code}/riscv_hal/riscv_plic.h (100%) rename FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/{ => Microsemi_Code}/riscv_hal/sample_hw_platform.h (100%) rename FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/{ => Microsemi_Code}/riscv_hal/syscall.c (100%) diff --git a/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/.cproject b/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/.cproject index f14a66062..a4718e7c9 100644 --- a/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/.cproject +++ b/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/.cproject @@ -113,19 +113,19 @@ - + - + - + - + - + - + - + @@ -153,7 +153,7 @@ @@ -177,7 +177,7 @@ diff --git a/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/.project b/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/.project index 241c90a8d..7e67e3c94 100644 --- a/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/.project +++ b/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/.project @@ -34,6 +34,11 @@ 2 virtual:/virtual + + full_demo/common_demo_tasks/AbortDelay.c + 1 + FREERTOS_ROOT/FreeRTOS/Demo/Common/Minimal/AbortDelay.c + full_demo/common_demo_tasks/EventGroupsDemo.c 1 @@ -44,6 +49,21 @@ 1 FREERTOS_ROOT/FreeRTOS/Demo/Common/Minimal/GenQTest.c + + full_demo/common_demo_tasks/MessageBufferDemo.c + 1 + FREERTOS_ROOT/FreeRTOS/Demo/Common/Minimal/MessageBufferDemo.c + + + full_demo/common_demo_tasks/StreamBufferDemo.c + 1 + FREERTOS_ROOT/FreeRTOS/Demo/Common/Minimal/StreamBufferDemo.c + + + full_demo/common_demo_tasks/StreamBufferInterrupt.c + 1 + FREERTOS_ROOT/FreeRTOS/Demo/Common/Minimal/StreamBufferInterrupt.c + full_demo/common_demo_tasks/TaskNotify.c 1 @@ -59,6 +79,16 @@ 1 FREERTOS_ROOT/FreeRTOS/Demo/Common/Minimal/blocktim.c + + full_demo/common_demo_tasks/countsem.c + 1 + FREERTOS_ROOT/FreeRTOS/Demo/Common/Minimal/countsem.c + + + full_demo/common_demo_tasks/death.c + 1 + FREERTOS_ROOT/FreeRTOS/Demo/Common/Minimal/death.c + full_demo/common_demo_tasks/dynamic.c 1 diff --git a/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/.settings/language.settings.xml b/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/.settings/language.settings.xml index e5699ca2b..5b3796092 100644 --- a/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/.settings/language.settings.xml +++ b/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/.settings/language.settings.xml @@ -11,7 +11,7 @@ - + diff --git a/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/FreeRTOSConfig.h b/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/FreeRTOSConfig.h index 133d535a0..e657e635f 100644 --- a/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/FreeRTOSConfig.h @@ -94,8 +94,8 @@ //#define configCPU_CLOCK_HZ ( ( unsigned long ) ( SYS_CLK_FREQ / 100 ) ) /*_RB_ Seems to be a factor of 100 between machine timer frequency and CPU frequency. */ #define configTICK_RATE_HZ ( ( TickType_t ) 1000 ) #define configMAX_PRIORITIES ( 5 ) -#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 256 ) /* Can be as low as 60 but some of the demo tasks that use tis constant require it to be higher. */ -#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 256 * 1024 ) ) +#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 200 ) /* Can be as low as 60 but some of the demo tasks that use this constant require it to be higher. */ +#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 300 * 1024 ) ) #define configMAX_TASK_NAME_LEN ( 16 ) #define configUSE_TRACE_FACILITY 0 #define configUSE_16_BIT_TICKS 0 @@ -126,15 +126,18 @@ /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */ -#define INCLUDE_vTaskPrioritySet 1 -#define INCLUDE_uxTaskPriorityGet 1 -#define INCLUDE_vTaskDelete 1 -#define INCLUDE_vTaskCleanUpResources 1 -#define INCLUDE_vTaskSuspend 1 -#define INCLUDE_vTaskDelayUntil 1 -#define INCLUDE_vTaskDelay 1 -#define INCLUDE_eTaskGetState 1 -#define INCLUDE_xTimerPendFunctionCall 1 +#define INCLUDE_vTaskPrioritySet 1 +#define INCLUDE_uxTaskPriorityGet 1 +#define INCLUDE_vTaskDelete 1 +#define INCLUDE_vTaskCleanUpResources 1 +#define INCLUDE_vTaskSuspend 1 +#define INCLUDE_vTaskDelayUntil 1 +#define INCLUDE_vTaskDelay 1 +#define INCLUDE_eTaskGetState 1 +#define INCLUDE_xTimerPendFunctionCall 1 +#define INCLUDE_xTaskAbortDelay 1 +#define INCLUDE_xTaskGetHandle 1 +#define INCLUDE_xSemaphoreGetMutexHolder 1 /* Normal assert() semantics without relying on the provision of an assert.h header file. */ diff --git a/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Packages/.repos.xml b/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/Packages/.repos.xml similarity index 100% rename from FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Packages/.repos.xml rename to FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/Packages/.repos.xml diff --git a/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/drivers/Core16550/core16550_regs.h b/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/drivers/Core16550/core16550_regs.h similarity index 100% rename from FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/drivers/Core16550/core16550_regs.h rename to FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/drivers/Core16550/core16550_regs.h diff --git a/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/drivers/Core16550/core_16550.c b/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/drivers/Core16550/core_16550.c similarity index 100% rename from FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/drivers/Core16550/core_16550.c rename to FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/drivers/Core16550/core_16550.c diff --git a/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/drivers/Core16550/core_16550.h b/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/drivers/Core16550/core_16550.h similarity index 100% rename from FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/drivers/Core16550/core_16550.h rename to FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/drivers/Core16550/core_16550.h diff --git a/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/drivers/CoreGPIO/core_gpio.c b/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/drivers/CoreGPIO/core_gpio.c similarity index 100% rename from FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/drivers/CoreGPIO/core_gpio.c rename to FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/drivers/CoreGPIO/core_gpio.c diff --git a/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/drivers/CoreGPIO/core_gpio.h b/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/drivers/CoreGPIO/core_gpio.h similarity index 100% rename from FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/drivers/CoreGPIO/core_gpio.h rename to FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/drivers/CoreGPIO/core_gpio.h diff --git a/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/drivers/CoreGPIO/coregpio_regs.h b/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/drivers/CoreGPIO/coregpio_regs.h similarity index 100% rename from FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/drivers/CoreGPIO/coregpio_regs.h rename to FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/drivers/CoreGPIO/coregpio_regs.h diff --git a/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/drivers/CoreI2C/core_i2c.c b/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/drivers/CoreI2C/core_i2c.c similarity index 100% rename from FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/drivers/CoreI2C/core_i2c.c rename to FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/drivers/CoreI2C/core_i2c.c diff --git a/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/drivers/CoreI2C/core_i2c.h b/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/drivers/CoreI2C/core_i2c.h similarity index 100% rename from FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/drivers/CoreI2C/core_i2c.h rename to FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/drivers/CoreI2C/core_i2c.h diff --git a/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/drivers/CoreI2C/core_smbus_regs.h b/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/drivers/CoreI2C/core_smbus_regs.h similarity index 100% rename from FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/drivers/CoreI2C/core_smbus_regs.h rename to FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/drivers/CoreI2C/core_smbus_regs.h diff --git a/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/drivers/CoreI2C/i2c_interrupt.c b/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/drivers/CoreI2C/i2c_interrupt.c similarity index 100% rename from FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/drivers/CoreI2C/i2c_interrupt.c rename to FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/drivers/CoreI2C/i2c_interrupt.c diff --git a/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/drivers/CoreTimer/core_timer.c b/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/drivers/CoreTimer/core_timer.c similarity index 100% rename from FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/drivers/CoreTimer/core_timer.c rename to FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/drivers/CoreTimer/core_timer.c diff --git a/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/drivers/CoreTimer/core_timer.h b/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/drivers/CoreTimer/core_timer.h similarity index 100% rename from FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/drivers/CoreTimer/core_timer.h rename to FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/drivers/CoreTimer/core_timer.h diff --git a/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/drivers/CoreTimer/coretimer_regs.h b/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/drivers/CoreTimer/coretimer_regs.h similarity index 100% rename from FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/drivers/CoreTimer/coretimer_regs.h rename to FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/drivers/CoreTimer/coretimer_regs.h diff --git a/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/drivers/CoreUARTapb/core_uart_apb.c b/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/drivers/CoreUARTapb/core_uart_apb.c similarity index 100% rename from FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/drivers/CoreUARTapb/core_uart_apb.c rename to FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/drivers/CoreUARTapb/core_uart_apb.c diff --git a/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/drivers/CoreUARTapb/core_uart_apb.h b/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/drivers/CoreUARTapb/core_uart_apb.h similarity index 100% rename from FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/drivers/CoreUARTapb/core_uart_apb.h rename to FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/drivers/CoreUARTapb/core_uart_apb.h diff --git a/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/drivers/CoreUARTapb/coreuartapb_regs.h b/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/drivers/CoreUARTapb/coreuartapb_regs.h similarity index 100% rename from FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/drivers/CoreUARTapb/coreuartapb_regs.h rename to FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/drivers/CoreUARTapb/coreuartapb_regs.h diff --git a/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/hal/cpu_types.h b/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/hal/cpu_types.h similarity index 100% rename from FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/hal/cpu_types.h rename to FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/hal/cpu_types.h diff --git a/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/hal/hal.h b/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/hal/hal.h similarity index 100% rename from FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/hal/hal.h rename to FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/hal/hal.h diff --git a/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/hal/hal_assert.h b/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/hal/hal_assert.h similarity index 100% rename from FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/hal/hal_assert.h rename to FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/hal/hal_assert.h diff --git a/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/hal/hal_irq.c b/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/hal/hal_irq.c similarity index 100% rename from FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/hal/hal_irq.c rename to FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/hal/hal_irq.c diff --git a/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/hal/hw_macros.h b/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/hal/hw_macros.h similarity index 100% rename from FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/hal/hw_macros.h rename to FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/hal/hw_macros.h diff --git a/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/hal/hw_reg_access.S b/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/hal/hw_reg_access.S similarity index 100% rename from FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/hal/hw_reg_access.S rename to FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/hal/hw_reg_access.S diff --git a/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/hal/hw_reg_access.h b/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/hal/hw_reg_access.h similarity index 100% rename from FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/hal/hw_reg_access.h rename to FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/hal/hw_reg_access.h diff --git a/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/riscv_hal/encoding.h b/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/riscv_hal/encoding.h similarity index 100% rename from FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/riscv_hal/encoding.h rename to FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/riscv_hal/encoding.h diff --git a/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/riscv_hal/entry.S b/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/riscv_hal/entry.S similarity index 100% rename from FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/riscv_hal/entry.S rename to FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/riscv_hal/entry.S diff --git a/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/riscv_hal/init.c b/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/riscv_hal/init.c similarity index 100% rename from FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/riscv_hal/init.c rename to FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/riscv_hal/init.c diff --git a/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/riscv_hal/microsemi-riscv-igloo2.ld b/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/riscv_hal/microsemi-riscv-igloo2.ld similarity index 100% rename from FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/riscv_hal/microsemi-riscv-igloo2.ld rename to FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/riscv_hal/microsemi-riscv-igloo2.ld diff --git a/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/riscv_hal/microsemi-riscv-ram.ld b/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/riscv_hal/microsemi-riscv-ram.ld similarity index 100% rename from FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/riscv_hal/microsemi-riscv-ram.ld rename to FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/riscv_hal/microsemi-riscv-ram.ld diff --git a/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/riscv_hal/riscv_hal.c b/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/riscv_hal/riscv_hal.c similarity index 100% rename from FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/riscv_hal/riscv_hal.c rename to FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/riscv_hal/riscv_hal.c diff --git a/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/riscv_hal/riscv_hal.h b/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/riscv_hal/riscv_hal.h similarity index 100% rename from FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/riscv_hal/riscv_hal.h rename to FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/riscv_hal/riscv_hal.h diff --git a/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/riscv_hal/riscv_hal_stubs.c b/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/riscv_hal/riscv_hal_stubs.c similarity index 100% rename from FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/riscv_hal/riscv_hal_stubs.c rename to FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/riscv_hal/riscv_hal_stubs.c diff --git a/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/riscv_hal/riscv_plic.h b/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/riscv_hal/riscv_plic.h similarity index 100% rename from FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/riscv_hal/riscv_plic.h rename to FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/riscv_hal/riscv_plic.h diff --git a/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/riscv_hal/sample_hw_platform.h b/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/riscv_hal/sample_hw_platform.h similarity index 100% rename from FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/riscv_hal/sample_hw_platform.h rename to FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/riscv_hal/sample_hw_platform.h diff --git a/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/riscv_hal/syscall.c b/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/riscv_hal/syscall.c similarity index 100% rename from FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/riscv_hal/syscall.c rename to FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/Microsemi_Code/riscv_hal/syscall.c diff --git a/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/full_demo/main_full.c b/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/full_demo/main_full.c index 655d6ff15..a0efe8dd4 100644 --- a/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/full_demo/main_full.c +++ b/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/full_demo/main_full.c @@ -78,9 +78,16 @@ #include "TimerDemo.h" #include "EventGroupsDemo.h" #include "TaskNotify.h" +#include "AbortDelay.h" +#include "countsem.h" +#include "death.h" +#include "MessageBufferDemo.h" +#include "StreamBufferDemo.h" +#include "StreamBufferInterrupt.h" /* Priorities for the demo application tasks. */ #define mainCHECK_TASK_PRIORITY ( configMAX_PRIORITIES - 1 ) +#define mainCREATOR_TASK_PRIORITY ( tskIDLE_PRIORITY + 3UL ) /* The period of the check task, in ms, converted to ticks using the pdMS_TO_TICKS() macro. mainNO_ERROR_CHECK_TASK_PERIOD is used if no errors have @@ -155,6 +162,11 @@ void main_full( void ) vStartTimerDemoTask( mainTIMER_TEST_PERIOD ); vStartEventGroupTasks(); vStartTaskNotifyTask(); + vCreateAbortDelayTasks(); + vStartCountingSemaphoreTasks(); + vStartMessageBufferTasks( configMINIMAL_STACK_SIZE ); + vStartStreamBufferTasks(); + vStartStreamBufferInterruptDemo(); /* Create the register check tasks, as described at the top of this file. Use xTaskCreateStatic() to create a task using only statically allocated @@ -171,6 +183,11 @@ void main_full( void ) the top of this file. */ xTaskCreate( prvCheckTask, "Check", mainCHECK_TASK_STACK_SIZE_WORDS, NULL, mainCHECK_TASK_PRIORITY, NULL ); + /* The set of tasks created by the following function call have to be + created last as they keep account of the number of tasks they expect to see + running. */ + vCreateSuicidalTasks( mainCREATOR_TASK_PRIORITY ); + /* Start the scheduler. */ vTaskStartScheduler(); @@ -183,7 +200,7 @@ void main_full( void ) for( ;; ); } /*-----------------------------------------------------------*/ -//int count = 0; + static void prvCheckTask( void *pvParameters ) { TickType_t xDelayPeriod = mainNO_ERROR_CHECK_TASK_PERIOD; @@ -209,57 +226,76 @@ extern void vToggleLED( void ); doing gives visual feedback of the system status. */ for( ;; ) { -// if( ++count == 5 ) {taskENTER_CRITICAL();for(;;);} /* Delay until it is time to execute again. */ vTaskDelayUntil( &xLastExecutionTime, xDelayPeriod ); -// taskENTER_CRITICAL(); -// for( int i = 0; i < 100; i++ ) -// { -// for( int j = 0; j < 1000; j++ ) taskYIELD(); -// taskEXIT_CRITICAL(); -// vTaskDelay( 1 ); -// taskENTER_CRITICAL(); -// } -// taskEXIT_CRITICAL(); - /* Check all the demo tasks (other than the flash tasks) to ensure that they are all still running, and that none have detected an error. */ - if( xAreDynamicPriorityTasksStillRunning() != pdTRUE ) + if( xAreDynamicPriorityTasksStillRunning() == pdFALSE ) { pcStatusMessage = "ERROR: Dynamic priority demo/tests.\r\n"; } - if ( xAreBlockTimeTestTasksStillRunning() != pdTRUE ) + if ( xAreBlockTimeTestTasksStillRunning() == pdFALSE ) { pcStatusMessage = "ERROR: Block time demo/tests.\r\n"; } - if ( xAreGenericQueueTasksStillRunning() != pdTRUE ) + if ( xAreGenericQueueTasksStillRunning() == pdFALSE ) { pcStatusMessage = "ERROR: Generic queue demo/tests.\r\n"; } - if ( xAreRecursiveMutexTasksStillRunning() != pdTRUE ) + if ( xAreRecursiveMutexTasksStillRunning() == pdFALSE ) { pcStatusMessage = "ERROR: Recursive mutex demo/tests.\r\n"; } - if( xAreTimerDemoTasksStillRunning( ( TickType_t ) xDelayPeriod ) != pdPASS ) + if( xAreTimerDemoTasksStillRunning( ( TickType_t ) xDelayPeriod ) == pdFALSE ) { pcStatusMessage = "ERROR: Timer demo/tests.\r\n"; } - if( xAreEventGroupTasksStillRunning() != pdPASS ) + if( xAreEventGroupTasksStillRunning() == pdFALSE ) { pcStatusMessage = "ERROR: Event group demo/tests.\r\n"; } - if( xAreTaskNotificationTasksStillRunning() != pdPASS ) + if( xAreTaskNotificationTasksStillRunning() == pdFALSE ) { pcStatusMessage = "ERROR: Task notification demo/tests.\r\n"; } + if( xAreAbortDelayTestTasksStillRunning() == pdFALSE ) + { + pcStatusMessage = "ERROR: Abort delay.\r\n"; + } + + if( xAreCountingSemaphoreTasksStillRunning() == pdFALSE ) + { + pcStatusMessage = "ERROR: Counting semaphores.\r\n"; + } + + if( xIsCreateTaskStillRunning() == pdFALSE ) + { + pcStatusMessage = "ERROR: Suicide tasks.\r\n"; + } + + if( xAreMessageBufferTasksStillRunning() == pdFALSE ) + { + pcStatusMessage = "ERROR: Message buffer.\r\n"; + } + + if( xAreStreamBufferTasksStillRunning() == pdFALSE ) + { + pcStatusMessage = "ERROR: Stream buffer.\r\n"; + } + + if( xIsInterruptStreamBufferDemoStillRunning() == pdFALSE ) + { + pcStatusMessage = "ERROR: Stream buffer interrupt.\r\n"; + } + /* Check that the register test 1 task is still running. */ if( ulLastRegTest1Value == ulRegTest1LoopCounter ) { @@ -275,7 +311,7 @@ extern void vToggleLED( void ); ulLastRegTest2Value = ulRegTest2LoopCounter; /* Write the status message to the UART. */ -// vSendString( pcStatusMessage ); + vSendString( pcStatusMessage ); vToggleLED(); /* If an error has been found then increase the LED toggle rate by @@ -326,9 +362,24 @@ static void prvRegTestTaskEntry2( void *pvParameters ) void vFullDemoTickHook( void ) { - /* Called from vApplicationTickHook() when the project is configured to - build the full demo. */ + /* The full demo includes a software timer demo/test that requires + prodding periodically from the tick interrupt. */ vTimerPeriodicISRTests(); + + /* Call the periodic event group from ISR demo. */ vPeriodicEventGroupsProcessing(); + + /* Use task notifications from an interrupt. */ xNotifyTaskFromISR(); + + /* Writes to stream buffer byte by byte to test the stream buffer trigger + level functionality. */ + vPeriodicStreamBufferProcessing(); + + /* Writes a string to a string buffer four bytes at a time to demonstrate + a stream being sent from an interrupt to a task. */ + vBasicStreamBufferSendFromISR(); + + /* Called from vApplicationTickHook() when the project is configured to + build the full test/demo applications. */ } diff --git a/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/main.c b/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/main.c index 96834b822..be526c213 100644 --- a/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/main.c +++ b/FreeRTOS/Demo/RISC-V_IGLOO2_Creative_SoftConsole/main.c @@ -87,7 +87,7 @@ static gpio_instance_t g_gpio_out; int main( void ) { -// prvSetupHardware(); + prvSetupHardware(); /* The mainCREATE_SIMPLE_BLINKY_DEMO_ONLY setting is described at the top of this file. */ @@ -144,11 +144,6 @@ void vApplicationMallocFailedHook( void ) } /*-----------------------------------------------------------*/ -volatile uint64_t mtimer = 0, mcompare = 0; -volatile uint32_t mstatus; -static volatile uint64_t * const pulCompareLow = ( volatile uint64_t * const ) ( configCLINT_BASE_ADDRESS + 0x4000 ); -static volatile uint64_t * const pulTimeLow = ( volatile uint64_t * const ) ( configCLINT_BASE_ADDRESS + 0xBFF8 ); - void vApplicationIdleHook( void ) { /* vApplicationIdleHook() will only be called if configUSE_IDLE_HOOK is set @@ -160,9 +155,6 @@ void vApplicationIdleHook( void ) important that vApplicationIdleHook() is permitted to return to its calling function, because it is the responsibility of the idle task to clean up memory allocated by the kernel to any task that has since been deleted. */ - mstatus = read_csr( mstatus ); - mtimer = *pulTimeLow; - mcompare = *pulCompareLow; } /*-----------------------------------------------------------*/ -- 2.39.5