Skip to content

Commit

Permalink
misc: bump to version 1.0.7
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
fanghuaqi committed Aug 6, 2020
1 parent 33a6388 commit c1c8056
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 64 deletions.
63 changes: 21 additions & 42 deletions examples/freertos_demo/src/main.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* Copyright 2019-2020 Nuclei, Inc */
/*
FreeRTOS V9.0.0 - Copyright (C) 2016 Real Time Engineers Ltd.
All rights reserved
Expand Down Expand Up @@ -75,41 +74,30 @@
#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 <stdio.h>
#include <stdlib.h>
#include <unistd.h>

#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);

/* 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)
Expand All @@ -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,
Expand All @@ -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);
}
}
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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.
Expand Down
23 changes: 5 additions & 18 deletions examples/helloworld/src/hello.c → examples/helloworld/src/main.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/* Copyright 2019 Nuclei, Inc */
/* SPDX-License-Identifier: Apache-2.0 */

// See LICENSE for license details.
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
Expand Down Expand Up @@ -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;
}

2 changes: 2 additions & 0 deletions examples/rtthread_demo/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions platform.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down

0 comments on commit c1c8056

Please # to comment.