From c1c805608f0f3f005b13802857aa3070dfd2a740 Mon Sep 17 00:00:00 2001 From: Huaqi Fang <578567190@qq.com> Date: Thu, 6 Aug 2020 16:53:11 +0800 Subject: [PATCH] misc: bump to version 1.0.7 This is a important release for platform-nuclei. * It now change to use Nuclei SDK 0.2.5 version * The gnu toolchain and openocd are changed to use latest 2020.08 release from Nuclei Signed-off-by: Huaqi Fang <578567190@qq.com> --- examples/freertos_demo/src/main.c | 63 +++++++-------------- examples/helloworld/src/{hello.c => main.c} | 23 ++------ examples/rtthread_demo/platformio.ini | 2 + platform.json | 8 +-- 4 files changed, 32 insertions(+), 64 deletions(-) rename examples/helloworld/src/{hello.c => main.c} (79%) diff --git a/examples/freertos_demo/src/main.c b/examples/freertos_demo/src/main.c index 994c381..89f3f49 100644 --- a/examples/freertos_demo/src/main.c +++ b/examples/freertos_demo/src/main.c @@ -1,4 +1,3 @@ -/* Copyright 2019-2020 Nuclei, Inc */ /* FreeRTOS V9.0.0 - Copyright (C) 2016 Real Time Engineers Ltd. All rights reserved @@ -75,26 +74,17 @@ #include "task.h" /* RTOS task related API prototypes. */ #include "timers.h" /* Software timer related API prototypes. */ -/* TODO Add any manufacture supplied header files can be included -here. */ #include #include #include #include "nuclei_sdk_soc.h" -#define mainQUEUE_RECEIVE_TASK_PRIORITY (tskIDLE_PRIORITY + 2) -#define mainQUEUE_SEND_TASK_PRIORITY (tskIDLE_PRIORITY + 1) -#define mainEVENT_SEMAPHORE_TASK_PRIORITY (configMAX_PRIORITIES - 1) - -#define NBIT_DEFAULT 3 -#define REG_LEN 8 - /* The period of the example software timer, specified in milliseconds, and converted to ticks using the pdMS_TO_TICKS() macro. */ -#define mainSOFTWARE_TIMER_PERIOD_MS pdMS_TO_TICKS(1000) +#define mainSOFTWARE_TIMER_PERIOD_MS pdMS_TO_TICKS(1000) +#define mainQUEUE_LENGTH (1) -#define mainQUEUE_LENGTH (1) static void prvSetupHardware(void); extern void idle_task(void); static void vExampleTimerCallback(TimerHandle_t xTimer); @@ -102,14 +92,12 @@ static void vExampleTimerCallback(TimerHandle_t xTimer); /* The queue used by the queue send and queue receive tasks. */ static QueueHandle_t xQueue = NULL; -void prvSetupHardware(void) -{ -} +static TaskHandle_t StartTask1_Handler; +static TaskHandle_t StartTask2_Handler; -TaskHandle_t StartTask_Handler; -TaskHandle_t StartTask2_Handler; +void prvSetupHardware(void) {} -void start_task(void *pvParameters); +void start_task1(void *pvParameters); void start_task2(void *pvParameters); int main(void) @@ -126,11 +114,12 @@ int main(void) sizeof(uint32_t)); if (xQueue == NULL) { - for (;;) ; + for (;;) + ; } - xTaskCreate((TaskFunction_t)start_task, (const char *)"start_task", + xTaskCreate((TaskFunction_t)start_task1, (const char *)"start_task1", (uint16_t)256, (void *)NULL, (UBaseType_t)2, - (TaskHandle_t *)&StartTask_Handler); + (TaskHandle_t *)&StartTask1_Handler); xTaskCreate((TaskFunction_t)start_task2, (const char *)"start_task2", (uint16_t)256, (void *)NULL, (UBaseType_t)1, @@ -153,27 +142,22 @@ int main(void) }; } -void start_task(void *pvParameters) +void start_task1(void *pvParameters) { - TickType_t xNextWakeTime; - int x; - printf("task_1\r\n"); + int cnt = 0; + printf("Enter to task_1\r\n"); while (1) { - printf("task1_running..... \r\n"); - + printf("task1 is running %d.....\r\n", cnt++); vTaskDelay(200); } } void start_task2(void *pvParameters) { - uint32_t ulReceivedValue; - printf("task_2\r\n"); - /* Initialise xNextWakeTime - this only needs to be done once. */ - + int cnt = 0; + printf("Enter to task_2\r\n"); while (1) { - printf("task2_running..... \r\n"); - + printf("task2 is running %d.....\r\n", cnt++); vTaskDelay(200); } } @@ -183,21 +167,19 @@ static void vExampleTimerCallback(TimerHandle_t xTimer) /* The timer has expired. Count the number of times this happens. The timer that calls this function is an auto re-load timer, so it will execute periodically. */ - - printf("timers Callback\r\n"); + static int cnt = 0; + printf("timers Callback %d\r\n", cnt++); } void vApplicationTickHook(void) { - BaseType_t xHigherPriorityTaskWoken = pdFALSE; - static uint32_t ulCount = 0; + // BaseType_t xHigherPriorityTaskWoken = pdFALSE; /* The RTOS tick hook function is enabled by setting configUSE_TICK_HOOK to 1 in FreeRTOSConfig.h. "Give" the semaphore on every 500th tick interrupt. */ - /* If xHigherPriorityTaskWoken is pdTRUE then a context switch should normally be performed before leaving the interrupt (because during the execution of the interrupt a task of equal or higher priority than the @@ -229,9 +211,6 @@ void vApplicationMallocFailedHook(void) void vApplicationStackOverflowHook(TaskHandle_t xTask, signed char *pcTaskName) { - // ( void ) pcTaskName; - // ( void ) xTask; - /* Run time stack overflow checking is performed if configconfigCHECK_FOR_STACK_OVERFLOW is defined to 1 or 2. This hook function is called if a stack overflow is detected. pxCurrentTCB can be @@ -246,7 +225,7 @@ void vApplicationStackOverflowHook(TaskHandle_t xTask, signed char *pcTaskName) extern UBaseType_t uxCriticalNesting; void vApplicationIdleHook(void) { - volatile size_t xFreeStackSpace; + // volatile size_t xFreeStackSpace; /* The idle task hook is enabled by setting configUSE_IDLE_HOOK to 1 in FreeRTOSConfig.h. diff --git a/examples/helloworld/src/hello.c b/examples/helloworld/src/main.c similarity index 79% rename from examples/helloworld/src/hello.c rename to examples/helloworld/src/main.c index e5827b9..780a621 100644 --- a/examples/helloworld/src/hello.c +++ b/examples/helloworld/src/main.c @@ -1,6 +1,4 @@ -/* Copyright 2019 Nuclei, Inc */ -/* SPDX-License-Identifier: Apache-2.0 */ - +// See LICENSE for license details. #include #include #include @@ -91,21 +89,10 @@ int main(void) printf("MISA: 0x%lx\r\n", misa); print_misa(); - printf("Hello World!\r\n"); - printf("Hello World!\r\n"); - printf("Hello World!\r\n"); - printf("Hello World!\r\n"); - printf("Hello World!\r\n"); - printf("Hello World!\r\n"); - printf("Hello World!\r\n"); - printf("Hello World!\r\n"); - printf("Hello World!\r\n"); - printf("Hello World!\r\n"); - printf("Hello World!\r\n"); - printf("Hello World!\r\n"); - printf("Hello World!\r\n"); - printf("Hello World!\r\n"); - printf("Hello World!\r\n"); + for (int i = 0; i < 20; i ++) { + printf("%d: Hello World From Nuclei RISC-V Processor!\r\n", i); + } + return 0; } diff --git a/examples/rtthread_demo/platformio.ini b/examples/rtthread_demo/platformio.ini index 6b90bc9..ad27413 100644 --- a/examples/rtthread_demo/platformio.ini +++ b/examples/rtthread_demo/platformio.ini @@ -21,6 +21,8 @@ board_build.rtos = rtthread [env:nuclei-hbird_eval] board = hbird_eval board_build.download = flash +board_build.core = nx600 + [env:nuclei-gd32vf103v_rvstar] board = gd32vf103v_rvstar diff --git a/platform.json b/platform.json index f4fed4d..bd20e22 100644 --- a/platform.json +++ b/platform.json @@ -11,7 +11,7 @@ "type": "git", "url": "https://github.com/Nuclei-Software/platform-nuclei.git" }, - "version": "1.0.6", + "version": "1.0.7", "packageRepositories": [ "https://dl.bintray.com/platformio/dl-packages/manifest.json", "http://dl.platformio.org/packages/manifest.json", @@ -29,17 +29,17 @@ "packages": { "toolchain-riscv-gcc-nuclei": { "type": "toolchain", - "version": "~9.2.0" + "version": "~9.2.1" }, "framework-nuclei-sdk": { "optional": true, "type": "framework", - "version": "~0.2.4" + "version": "~0.2.5" }, "tool-openocd-nuclei": { "optional": true, "type": "uploader", - "version": "~0.10.0" + "version": "~0.10.1" }, "tool-jlink": { "type": "uploader",