diff --git a/README.md b/README.md index 158fee9baf80271ddf4731f752c1e38d35c6f370..83ab54904464ee1fd8f4ccb66ddf990d3fb7f161 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Phytium-FreeRTOS-SDK -**v0.7.1** [ReleaseNote](./docs/ChangeLog.md) +**v1.0.0** [ReleaseNote](./docs/ChangeLog.md) ## 1. 介绍 diff --git a/docs/ChangeLog.md b/docs/ChangeLog.md index f5d0147c4dfbd292d122df04af5203e7a69aeea1..57085422799b49f2c26e8a2bf4b52a3158060e1b 100644 --- a/docs/ChangeLog.md +++ b/docs/ChangeLog.md @@ -1,3 +1,25 @@ +# Phytium FreeRTOS SDK 2024-05-14 v1.0.0 ChangeLog + +Change Log since 2024-05-10 + +## example + +- update sockets/udp_multicast, sockets/udp_multicast, i2s, media, pwm, amp/openamp readme file +- delete error i2s deinit report +- solve nested_interrupt conditional judgment problem +- solve fatfs variable type problem +- solve can intr example problem in d2000 testing +- update pwm default controller and channel id + +# Phytium FreeRTOS SDK 2024-05-10 ChangeLog + +Change Log since 2024-05-10 + +## example + +- modify freertos feature task example, add no letter shell mode, adapt to auto-test system +- repair bug in storage fatfs example + # Phytium FreeRTOS SDK 2024-05-10 ChangeLog Change Log since 2024-05-10 @@ -138,6 +160,7 @@ Change Log since 2024-04-26 ## example +- modify fatfs example, add no letter shell mode, adapt to auto-test system - modify qspi_spiffs example, add no letter shell mode, adapt to auto-test system # Phytium FreeRTOS SDK 2024-04-26 ChangeLog diff --git a/docs/reference/usr/usage.md b/docs/reference/usr/usage.md index 7bdc19633733ecaa21f3984e9bddc88e35c3c191..6fdcfba269e500bb13ef224921e204583611ee2a 100644 --- a/docs/reference/usr/usage.md +++ b/docs/reference/usr/usage.md @@ -26,15 +26,14 @@ src --> 用户源文件* 2. make clean 将目录下的工程进行清理 3. make image 将目录下的工程进行编译,并将生成的elf 复制到目标地址 4. make list_kconfig 当前工程支持哪些配置文件 - 5. make load_kconfig LOAD_CONFIG_NAME= 将预设配置加载至工程中 + 5. make load_kconfig LOAD_CONFIG_NAME=[kconfig configuration files] 将预设配置加载至工程中 6. make menuconfig 配置目录下的参数变量 7. make backup_kconfig 将目录下的sdkconfig 备份到./configs下 - make list_kconfig 当前工程支持哪些配置文件 -- make load_kconfig LOAD_CONFIG_NAME= 将预设配置加载至工程中 - ->配置成E2000D,使用对应的默认配置,如E2000d 32位: +- make load_kconfig LOAD_CONFIG_NAME=[kconfig configuration files] 将预设配置加载至工程中 +>例如:配置成E2000D,使用对应的默认配置,如E2000d 32位: ``` $ make load_kconfig LOAD_CONFIG_NAME=e2000d_aarch32_demo_i2c ``` @@ -159,7 +158,7 @@ $ cp ./freertos.elf /mnt/d/tftboot # setenv gatewayip 192.168.4.1 ``` -> 镜像启动的地址为`0x80100000`, 对于`BIN`文件,需要直接加载到`0x80100000`,对于`ELF`文件,启动地址会自动获取,需要加载到`DRAM`中一段可用的地址,这里选择`0x90100000` +> 镜像启动的地址为`0x80100000`, 对于`BIN`文件,需要直接加载到`0x80100000`,对于`ELF`文件,启动地址会自动获取,需要加载到`DRAM`中一段可用的地址,这里选择`0x90100000`,根据实际的文件大小,也可以选择别的地址 - 支持使用以下几种方式跳转启动(二选一) - 1. `AARCH32/AARCH64`支持加载`BIN`文件到启动地址,刷新缓存后,通过`go`命令跳转启动 diff --git a/drivers/i2s/fi2s_os.c b/drivers/i2s/fi2s_os.c index 0330c513ee0bd0e07a4fc3292924fd523bd278ab..ef963f029c80df3bee217065539f4ab6a1b03d36 100644 --- a/drivers/i2s/fi2s_os.c +++ b/drivers/i2s/fi2s_os.c @@ -13,7 +13,7 @@ * * FilePath: fi2s_os.c * Created Date: 2024-02-29 10:49:34 - * Last Modified: 2024-04-26 15:11:27 + * Last Modified: 2024-05-14 09:16:29 * Description: This file is for i2s driver * * Modify History: @@ -131,21 +131,10 @@ FError FFreeRTOSSetupI2S(FFreeRTOSI2s *os_i2s_p) FError FFreeRTOSI2SDeinit(FFreeRTOSI2s *os_i2s_p) { FASSERT(os_i2s_p); - FASSERT(os_i2s_p->i2s_semaphore != NULL); FI2sStopWork(&os_i2s_p->i2s_ctrl); FI2sDeInitialize(&os_i2s_p->i2s_ctrl); - FASSERT_MSG(NULL != os_i2s_p->i2s_semaphore, "Semaphore not exists!!!"); - vSemaphoreDelete(os_i2s_p->i2s_semaphore); - - os_i2s_p->i2s_semaphore = NULL; - - FASSERT_MSG(NULL != os_i2s_p->trx_event, "Event group not exists!!!"); - vEventGroupDelete(os_i2s_p->trx_event); - - os_i2s_p->trx_event = NULL; - return FT_SUCCESS; } \ No newline at end of file diff --git a/drivers/i2s/fi2s_os.h b/drivers/i2s/fi2s_os.h index 365ec0fd98682aea554bf649cba2c9d9d97044f9..5cac22b1460875c1ebeb41ca514b799024935667 100644 --- a/drivers/i2s/fi2s_os.h +++ b/drivers/i2s/fi2s_os.h @@ -13,7 +13,7 @@ * * FilePath: fi2s_os.h * Created Date: 2024-02-29 10:49:34 - * Last Modified: 2024-04-26 14:54:58 + * Last Modified: 2024-05-14 09:16:40 * Description: This file is for providing function related definitions of i2s driver * * Modify History: @@ -47,8 +47,6 @@ extern "C" typedef struct { FI2s i2s_ctrl; - SemaphoreHandle_t i2s_semaphore; /* i2s read and write semaphore for resource sharing */ - EventGroupHandle_t trx_event; /* i2s TX/RX completion event */ } FFreeRTOSI2s; /*init the i2s and return the i2s instance*/ diff --git a/example/freertos_feature/task/README.md b/example/freertos_feature/task/README.md index 81c22b04a29df16e7a588fc9ea913412d8349678..724940dd1e4f57c47996fa80b456fb696455c3db 100644 --- a/example/freertos_feature/task/README.md +++ b/example/freertos_feature/task/README.md @@ -78,16 +78,16 @@ bootelf -p 0x90100000 - 系统进入后,输入```task```查看指令说明 -![](.\figs\task_result.png) +![](./figs/result.png) -- 执行相应的cre和del操作,创建和删除测试任务 -![](.\figs\task_cre.png) -![](.\figs\task_del.png) +- 执行相应的cre操作,创建和删除测试任务 + +![](./figs/task_cre.png) -- 测试任务能够能正常创建和删除,输入```ps```查看任务状态正常,即测试正常 -![](./pic/task_command.png) + +- 测试任务能够能正常创建和删除,输入```ps```查看任务状态正常,即测试正常 ## 3. 如何解决问题 Q: ps查看任务状态异常 diff --git a/example/freertos_feature/task/figs/result.png b/example/freertos_feature/task/figs/result.png new file mode 100644 index 0000000000000000000000000000000000000000..b2f5d8db870cd21398b42779f09d193df25fcfb5 Binary files /dev/null and b/example/freertos_feature/task/figs/result.png differ diff --git a/example/freertos_feature/task/figs/task_cre.png b/example/freertos_feature/task/figs/task_cre.png index 3a37b004434a046c02ff130ed16b189cae469ed7..e43f785989966c8e100e8c15220600b172b3d8a0 100644 Binary files a/example/freertos_feature/task/figs/task_cre.png and b/example/freertos_feature/task/figs/task_cre.png differ diff --git a/example/freertos_feature/task/figs/task_result.png b/example/freertos_feature/task/figs/task_result.png deleted file mode 100644 index a25a0b1578a760d0cf9b04192fe6a1d79a848697..0000000000000000000000000000000000000000 Binary files a/example/freertos_feature/task/figs/task_result.png and /dev/null differ diff --git a/example/freertos_feature/task/inc/feature_task.h b/example/freertos_feature/task/inc/feature_task.h index 764ad76013847b1a05cc22b9e2d8f5b03407f54d..bd76d4fd6765952af794b6d0d11198a9b0c7d3b9 100644 --- a/example/freertos_feature/task/inc/feature_task.h +++ b/example/freertos_feature/task/inc/feature_task.h @@ -26,45 +26,46 @@ #ifndef FEATURE_TASK_H #define FEATURE_TASK_H +#include "fdebug.h" + #ifdef __cplusplus extern "C" { #endif +#define FTASK_DEBUG_TAG "FFreeRTOSTask" +#define FTASK_ERROR(format, ...) FT_DEBUG_PRINT_E(FTASK_DEBUG_TAG, format, ##__VA_ARGS__) +#define FTASK_WARN(format, ...) FT_DEBUG_PRINT_W(FTASK_DEBUG_TAG, format, ##__VA_ARGS__) +#define FTASK_INFO(format, ...) FT_DEBUG_PRINT_I(FTASK_DEBUG_TAG, format, ##__VA_ARGS__) +#define FTASK_DEBUG(format, ...) FT_DEBUG_PRINT_D(FTASK_DEBUG_TAG, format, ##__VA_ARGS__) + /* creating task */ void CreateTasks(void); -void DeleteTasks(void); /* using parameter */ void CreateTasksForParamterTest(void); -void DeleteTasksForParamterTest(void); - /* test priority */ void CreateTasksForPriorityTest(void); -void DeleteTasksForPriorityTest(void); - /* test block state */ void CreateTasksForBlockTest(void); -void DeleteTasksForBlockTest(void); /* tesk until delay */ void CreateTasksForDelayUntilTest(void); -void DeleteTasksForDelayUntilTest(void); /* blocking or none */ void CreateTasksForBlockingOrNone(void); -void DeleteTasksForBlockingOrNone(void); /* idle task */ void CreateTasksForIdleTask(void); -void DeleteTasksForForIdleTask(void); /* change priority task */ void CreateTasksForChangePriorityTest(void); -void DeleteTasksForChangePriorityTest(void); + +/*auto test*/ +void TasksExampleEntry(void); #ifdef __cplusplus } diff --git a/example/freertos_feature/task/main.c b/example/freertos_feature/task/main.c index f065deb7d9630ee7a295a70368e884973fa76077..05bb329f9baa2438abac6ff3ab08830911e2df3d 100644 --- a/example/freertos_feature/task/main.c +++ b/example/freertos_feature/task/main.c @@ -22,19 +22,39 @@ * 1.0 wangxiaodong 2022/08/09 first commit */ +#include +#include "feature_task.h" +#include "FreeRTOS.h" +#include "task.h" + +#ifdef CONFIG_USE_LETTER_SHELL #include "shell.h" #include "shell_port.h" -#include +#endif int main(void) { BaseType_t ret; +#ifdef CONFIG_USE_LETTER_SHELL ret = LSUserShellTask() ; if (ret != pdPASS) { goto FAIL_EXIT; } +#else + ret = xTaskCreate((TaskFunction_t)TasksExampleEntry, + (const char *)"TasksExampleEntry", + (uint16_t)4096, + NULL, + (UBaseType_t)2, + NULL); + if(ret != pdPASS) + { + goto FAIL_EXIT; + } + +#endif vTaskStartScheduler(); /* 启动任务,开启调度 */ while (1); /* 正常不会执行到这里 */ diff --git a/example/freertos_feature/task/pic/task_command.png b/example/freertos_feature/task/pic/task_command.png deleted file mode 100644 index 13af7262c1e299d87745ef996b939b6a623968b7..0000000000000000000000000000000000000000 Binary files a/example/freertos_feature/task/pic/task_command.png and /dev/null differ diff --git a/example/freertos_feature/task/src/block_state.c b/example/freertos_feature/task/src/block_state.c index 0b9ccb2460aa17e84c0ab4d3ece5060d3119ea9a..69bdc894b811d02d72268e5b6b3820832c80b53f 100644 --- a/example/freertos_feature/task/src/block_state.c +++ b/example/freertos_feature/task/src/block_state.c @@ -4,15 +4,22 @@ how to make task block state; */ #include "FreeRTOSConfig.h" #include "FreeRTOS.h" +#include "semphr.h" #include "task.h" +#include "feature_task.h" +#include #define TASK_STACK_SIZE 1024 -static xTaskHandle xtask1_handle; -static xTaskHandle xtask2_handle; +#define SEMAPHORE_WAIT_TIME pdMS_TO_TICKS(5000UL) +#define TASK_DELAY pdMS_TO_TICKS(1000UL) + +SemaphoreHandle_t xSemaCount = NULL; /* The task function. */ -static void vTaskFunction(void *pvParameters); +static void vTaskFunction1(void *pvParameters); +static void vTaskFunction2(void *pvParameters); + /* Define the strings that will be passed in as the task parameters. These are defined const and off the stack to ensure they remain valid when the tasks are @@ -24,55 +31,93 @@ static const char *pcTextForTask2 = "Block Task 2 is running\r\n"; void CreateTasksForBlockTest(void) { - /* Create the first task at priority 1... */ - xTaskCreate(vTaskFunction, "Block Task 1", TASK_STACK_SIZE, (void *)pcTextForTask1, 1, &xtask1_handle); + BaseType_t ret = pdPASS; + xSemaCount = xSemaphoreCreateCounting(2,0); + /* Create the first task at priority 1... */ + ret = xTaskCreate(vTaskFunction1, "Block Task 1", TASK_STACK_SIZE, (void *)pcTextForTask1, 1, NULL); + if (ret != pdPASS) + { + vPrintStringAndNumber("Block Task 1 create failed: ", ret); + goto err_ret; + } /* ... and the second task at priority 2. The priority is the second to last parameter. */ - xTaskCreate(vTaskFunction, "Block Task 2", TASK_STACK_SIZE, (void *)pcTextForTask2, 2, &xtask2_handle); - - -} - + ret = xTaskCreate(vTaskFunction2, "Block Task 2", TASK_STACK_SIZE, (void *)pcTextForTask2, 2, NULL); + if (ret != pdPASS) + { + vPrintStringAndNumber("Block Task 2 create failed: ", ret); + goto err_ret; + } -void DeleteTasksForBlockTest(void) -{ - if (xtask1_handle) + ret = xSemaphoreTake(xSemaCount,SEMAPHORE_WAIT_TIME); + if(ret != pdPASS) { - vTaskDelete(xtask1_handle); - vPrintString("DeleteTasksForBlockTest Task parameter 1 deletion \r\n"); + FTASK_ERROR("Failed to get semaphore."); + goto err_ret; } - if (xtask2_handle) + ret = xSemaphoreTake(xSemaCount,SEMAPHORE_WAIT_TIME); + if(ret != pdPASS) { - vTaskDelete(xtask2_handle); - vPrintString("DeleteTasksForBlockTest Task parameter 2 deletion \r\n"); + FTASK_ERROR("Failed to get semaphore."); + goto err_ret; } + + printf("%s@%d: Tasks for block [success].\r\n", __func__, __LINE__); + return; + +err_ret: + printf("%s@%d: Tasks for block [failure].\r\n", __func__, __LINE__); + } /*-----------------------------------------------------------*/ -static void vTaskFunction(void *pvParameters) +static void vTaskFunction1(void *pvParameters) +{ + char *pcTaskName; + BaseType_t ret; + /* The string to print out is passed in via the parameter. Cast this to a + character pointer. */ + pcTaskName = (char *) pvParameters; + /* Print out the name of this task. */ + vPrintString(pcTaskName); + + /* Delay for a period. This time a call to vTaskDelay() is used which + places the task into the Blocked state until the delay period has + expired. The parameter takes a time specified in 'ticks', and the + pdMS_TO_TICKS() macro is used (where the xDelay constant is + declared) to convert 3000 milliseconds into an equivalent time in + ticks. */ + vTaskDelay(TASK_DELAY); + xSemaphoreGive(xSemaCount); + +err_ret: + vTaskDelete(NULL); + +} + +static void vTaskFunction2(void *pvParameters) { char *pcTaskName; - const TickType_t xDelay = pdMS_TO_TICKS(3000UL); /* The string to print out is passed in via the parameter. Cast this to a character pointer. */ pcTaskName = (char *) pvParameters; - /* As per most tasks, this task is implemented in an infinite loop. */ - for (;;) - { - /* Print out the name of this task. */ - vPrintString(pcTaskName); - - /* Delay for a period. This time a call to vTaskDelay() is used which - places the task into the Blocked state until the delay period has - expired. The parameter takes a time specified in 'ticks', and the - pdMS_TO_TICKS() macro is used (where the xDelay constant is - declared) to convert 3000 milliseconds into an equivalent time in - ticks. */ - vTaskDelay(xDelay); - } + /* Print out the name of this task. */ + vPrintString(pcTaskName); + + /* Delay for a period. This time a call to vTaskDelay() is used which + places the task into the Blocked state until the delay period has + expired. The parameter takes a time specified in 'ticks', and the + pdMS_TO_TICKS() macro is used (where the xDelay constant is + declared) to convert 3000 milliseconds into an equivalent time in + ticks. */ + vTaskDelay(TASK_DELAY); + xSemaphoreGive(xSemaCount); + vTaskDelete(NULL); + } + diff --git a/example/freertos_feature/task/src/change_priority.c b/example/freertos_feature/task/src/change_priority.c index d62ead9d334b340df4e712f72239da08af6174b6..9bb2b2aecec685bd16ef61349a9ca287bd968983 100644 --- a/example/freertos_feature/task/src/change_priority.c +++ b/example/freertos_feature/task/src/change_priority.c @@ -4,9 +4,17 @@ how to change task priority; */ #include "FreeRTOS.h" #include "task.h" +#include +#include "feature_task.h" #define TASK_STACK_SIZE 1024 +#define LOOP_TIMES 2 +#define HIGH_PRIORITY 2 +#define LOW_PRIORITY 1 + +#define TASK_WAIT_TIME pdMS_TO_TICKS(5000UL) +#define TASK_DELAY pdMS_TO_TICKS(1000UL) /* The two task functions. */ static void vTask1(void *pvParameters); static void vTask2(void *pvParameters); @@ -15,101 +23,126 @@ static void vTask2(void *pvParameters); TaskHandle_t xtask1_handle; TaskHandle_t xtask2_handle; +TaskHandle_t xTaskNotifyHandle = NULL; + + /*-----------------------------------------------------------*/ void CreateTasksForChangePriorityTest(void) { + BaseType_t ret = pdPASS; + xTaskNotifyHandle = xTaskGetCurrentTaskHandle(); + u32 task_ret; /* Create the first task at priority 2. This time the task parameter is not used and is set to NULL. The task handle is also not used so likewise is also set to NULL. */ - xTaskCreate(vTask1, "ChangePriority Task 1", TASK_STACK_SIZE, NULL, 2, &xtask1_handle); + ret = xTaskCreate(vTask1, "ChangePriority Task 1", TASK_STACK_SIZE, NULL, HIGH_PRIORITY, &xtask1_handle); + if (ret != pdPASS) + { + xtask1_handle = NULL; + vPrintStringAndNumber("ChangePriority Task 1 create failed: ", ret); + goto err_ret; + } /* The task is created at priority 2 ^. */ /* Create the second task at priority 1 - which is lower than the priority given to Task1. Again the task parameter is not used so is set to NULL - BUT this time we want to obtain a handle to the task so pass in the address of the xtask2_handle variable. */ - xTaskCreate(vTask2, "ChangePriority Task 2", TASK_STACK_SIZE, NULL, 1, &xtask2_handle); + ret = xTaskCreate(vTask2, "ChangePriority Task 2", TASK_STACK_SIZE, NULL, LOW_PRIORITY, &xtask2_handle); + if (ret != pdPASS) + { + xtask2_handle = NULL; + vPrintStringAndNumber("ChangePriority Task 2 create failed: ", ret); + goto err_ret; + } /* The task handle is the last parameter ^^^^^^^^^^^^^ */ -} - -void DeleteTasksForChangePriorityTest(void) -{ - if (xtask1_handle) + ret = xTaskNotifyWait(0,0,&task_ret,TASK_WAIT_TIME); + if(ret != pdPASS || task_ret != 1) { - vTaskDelete(xtask1_handle); - vPrintString("ChangePriority Task1 deletion \r\n"); + goto err_ret; } - - if (xtask2_handle) + ret = xTaskNotifyWait(0,0,&task_ret,TASK_WAIT_TIME); + if(ret != pdPASS || task_ret != 1) { - vTaskDelete(xtask2_handle); - vPrintString("ChangePriority Task2 deletion \r\n"); + goto err_ret; } + printf("%s@%d: Tasks for change priority [success].\r\n", __func__, __LINE__); + return; + +err_ret: + printf("%s@%d: Tasks for change priority [failure].\r\n", __func__, __LINE__); } + /*-----------------------------------------------------------*/ void vTask1(void *pvParameters) { - UBaseType_t uxPriority; - + UBaseType_t uxMyPriority; + UBaseType_t uxTask2Priority; + uint32_t task_ret = 1; /* This task will always run before Task2 as it has the higher priority. Neither Task1 nor Task2 ever block so both will always be in either the Running or the Ready state. Query the priority at which this task is running - passing in NULL means "return our own priority". */ - uxPriority = uxTaskPriorityGet(NULL); - - for (;;) + uxMyPriority = uxTaskPriorityGet(NULL); + uxTask2Priority = uxTaskPriorityGet(xtask2_handle); + + /* Setting the Task2 priority above the Task1 priority will cause + Task2 to immediately start running (as then Task2 will have the higher + priority of the two created tasks). */ + vPrintString("Change Task2 priority to Task1 priority\r\n"); + vTaskPrioritySet(xtask2_handle, uxMyPriority); + /* Print out the name of this task. */ + vPrintf("ChangePriority Task1 is running, Task1 Priority=%d\r\n", uxMyPriority); + + /* Task1 will only run when it has a priority higher than Task2. + Therefore, for this task to reach this point Task2 must already have + executed and set its priority back down to 0. */ + vTaskDelay(TASK_DELAY); + /*in Task2, Task1 priority have been changed to low priority.*/ + uxMyPriority = uxTaskPriorityGet(NULL); + if(uxMyPriority != LOW_PRIORITY) { - /* Print out the name of this task. */ - vPrintf("ChangePriority Task1 is running, Task1 Priority=%d\r\n", uxPriority); - - /* Setting the Task2 priority above the Task1 priority will cause - Task2 to immediately start running (as then Task2 will have the higher - priority of the two created tasks). */ - vPrintString("ChangePriority About to raise the Task2 priority\r\n"); - vTaskPrioritySet(xtask2_handle, (uxPriority + 1)); - - /* Task1 will only run when it has a priority higher than Task2. - Therefore, for this task to reach this point Task2 must already have - executed and set its priority back down to 0. */ - vTaskDelay(3000); + task_ret = 0; + FTASK_ERROR("Task1 priority set failed. priority= %d", uxMyPriority); } + + xTaskNotify(xTaskNotifyHandle, task_ret, eSetValueWithoutOverwrite); + vTaskDelete(NULL); } /*-----------------------------------------------------------*/ void vTask2(void *pvParameters) { - UBaseType_t uxPriority; - - /* Task1 will always run before this task as Task1 has the higher priority. - Neither Task1 nor Task2 ever block so will always be in either the - Running or the Ready state. - - Query the priority at which this task is running - passing in NULL means - "return our own priority". */ - uxPriority = uxTaskPriorityGet(NULL); - - for (;;) + UBaseType_t uxMyPriority; + UBaseType_t uxTask1Priority; + uxMyPriority = uxTaskPriorityGet(NULL); + uxTask1Priority = uxTaskPriorityGet(xtask1_handle); + u32 task_ret = 1; + + /* Set our priority back down to its original value. Passing in NULL + as the task handle means "change our own priority". Setting the + priority below that of Task1 will cause Task1 to immediately start + running again. */ + vPrintString("Change the Task1 priority to low priority\r\n"); + vTaskPrioritySet(xtask1_handle, LOW_PRIORITY); + /* Print out the name of this task. */ + vPrintf("ChangePriority Task2 is running, Task2 Priority=%d\r\n", uxMyPriority); + vTaskDelay(TASK_DELAY); + /* in Task1, Task2 priority have been set Task1 priority */ + if(uxMyPriority != uxTask1Priority) { - /* For this task to reach this point Task1 must have already run and - set the priority of this task higher than its own. - - Print out the name of this task. */ - vPrintf("ChangePriority Task2 is running, Task2 Priority=%d\r\n", uxPriority); - - /* Set our priority back down to its original value. Passing in NULL - as the task handle means "change our own priority". Setting the - priority below that of Task1 will cause Task1 to immediately start - running again. */ - vPrintString("ChangePriority About to lower the Task2 priority\r\n"); - vTaskPrioritySet(NULL, (uxPriority - 2)); - vTaskDelay(3000); + task_ret = 0; + FTASK_ERROR("Task2 priority set failed. priority= %d", uxMyPriority); } + xTaskNotify(xTaskNotifyHandle, task_ret, eSetValueWithoutOverwrite); + + vTaskDelete(NULL); } /*-----------------------------------------------------------*/ diff --git a/example/freertos_feature/task/src/creating_tasks.c b/example/freertos_feature/task/src/creating_tasks.c index a38668699515a33e2fa7ea493537755076f0e244..8ade65a631dcff151b9b4c45d86a62a9570128ad 100644 --- a/example/freertos_feature/task/src/creating_tasks.c +++ b/example/freertos_feature/task/src/creating_tasks.c @@ -4,48 +4,65 @@ how to create and delete tasks; */ #include "FreeRTOSConfig.h" #include "FreeRTOS.h" +#include "semphr.h" +#include "fkernel.h" #include "task.h" +#include -#define DELAY_LOOP_COUNT ( 0x1fffffff ) +#define DELAY_LOOP_COUNT ( 0x1ffffff ) #define TASK_STACK_SIZE 1024 -static xTaskHandle xtask1_handle; -static xTaskHandle xtask2_handle; +#define SEMAPHORE_WAIT_TIME pdMS_TO_TICKS(5000UL) /* The task functions. */ static void vTask1(void *pvParameters); static void vTask2(void *pvParameters); +static SemaphoreHandle_t xSemCount = NULL; /*-----------------------------------------------------------*/ void CreateTasks(void) { /* Create one of the two tasks. */ - xTaskCreate(vTask1, /* Pointer to the function that implements the task. */ + BaseType_t ret = pdPASS; + + xSemCount = xSemaphoreCreateCounting(2,0); + + ret = xTaskCreate(vTask1, /* Pointer to the function that implements the task. */ "Create Task 1", /* Text name for the task. This is to facilitate debugging only. */ TASK_STACK_SIZE, /* Stack depth - most small microcontrollers will use much less stack than this. */ NULL, /* We are not using the task parameter. */ 1, /* This task will run at priority 1. */ - &xtask1_handle); /* We are using the task handle to delete this task. */ - + NULL); /* We are using the task handle to delete this task. */ + if (ret != pdPASS) + { + vPrintStringAndNumber("Create Task 1 create failed: ", ret); + goto err_ret; + } /* Create the other task in exactly the same way. */ - xTaskCreate(vTask2, "Create Task 2", TASK_STACK_SIZE, NULL, 1, &xtask2_handle); + ret = xTaskCreate(vTask2, "Create Task 2", TASK_STACK_SIZE, NULL, 1, NULL); + if (ret != pdPASS) + { -} + vPrintStringAndNumber("Create Task 2 create failed: ", ret); + goto err_ret; + } -void DeleteTasks(void) -{ - if (xtask1_handle) + ret = xSemaphoreTake(xSemCount, SEMAPHORE_WAIT_TIME); + if(ret != pdPASS) { - vTaskDelete(xtask1_handle); - vPrintString("DeleteTasks Task1 deletion \r\n"); + goto err_ret; } - - if (xtask2_handle) + ret = xSemaphoreTake(xSemCount, SEMAPHORE_WAIT_TIME); + if(ret != pdPASS) { - vTaskDelete(xtask2_handle); - vPrintString("DeleteTasks Task2 deletion \r\n"); + goto err_ret; } + printf("%s@%d: Tasks create [success].\r\n", __func__, __LINE__); + return; + +err_ret: + printf("%s@%d: Tasks create [failure].\r\n", __func__, __LINE__); } /*-----------------------------------------------------------*/ @@ -55,20 +72,18 @@ static void vTask1(void *pvParameters) const char *pcTaskName = "Create Task 1 is running\r\n"; volatile uint32_t ul; - /* As per most tasks, this task is implemented in an infinite loop. */ - for (;;) - { - /* Print out the name of this task. */ - vPrintString(pcTaskName); + /* Print out the name of this task. */ + vPrintString(pcTaskName); /* Delay for a period. */ - for (ul = 0; ul < DELAY_LOOP_COUNT; ul++) - { - /* This loop is just a very crude delay implementation. There is - nothing to do in here. Later exercises will replace this crude - loop with a proper delay/sleep function. */ - } + for (ul = 0; ul < DELAY_LOOP_COUNT; ul++) + { + /* This loop is just a very crude delay implementation. There is + nothing to do in here. Later exercises will replace this crude + loop with a proper delay/sleep function. */ } + xSemaphoreGive(xSemCount); + vTaskDelete(NULL); } /*-----------------------------------------------------------*/ @@ -76,19 +91,16 @@ static void vTask2(void *pvParameters) { const char *pcTaskName = "Create Task 2 is running\r\n"; volatile uint32_t ul; - - /* As per most tasks, this task is implemented in an infinite loop. */ - for (;;) - { - /* Print out the name of this task. */ - vPrintString(pcTaskName); + /* Print out the name of this task. */ + vPrintString(pcTaskName); /* Delay for a period. */ - for (ul = 0; ul < DELAY_LOOP_COUNT; ul++) - { - /* This loop is just a very crude delay implementation. There is - nothing to do in here. Later exercises will replace this crude - loop with a proper delay/sleep function. */ - } + for (ul = 0; ul < DELAY_LOOP_COUNT; ul++) + { + /* This loop is just a very crude delay implementation. There is + nothing to do in here. Later exercises will replace this crude + loop with a proper delay/sleep function. */ } + xSemaphoreGive(xSemCount); + vTaskDelete(NULL); } \ No newline at end of file diff --git a/example/freertos_feature/task/src/idle_task_hook.c b/example/freertos_feature/task/src/idle_task_hook.c index 01f9e5ba0ae71b64e8a0efe1ab39fa310ec451b7..5e087d50c3b2853ac797e9e11ae01cee04cebca5 100644 --- a/example/freertos_feature/task/src/idle_task_hook.c +++ b/example/freertos_feature/task/src/idle_task_hook.c @@ -1,11 +1,10 @@ +#include #include "FreeRTOSConfig.h" #include "FreeRTOS.h" #include "task.h" #define TASK_STACK_SIZE 1024 - -static xTaskHandle xtask1_handle; -static xTaskHandle xtask2_handle; +#define TASK_WAIT_TIME pdMS_TO_TICKS(5000UL) /* The task function. */ static void vTaskFunction(void *pvParameters); @@ -19,45 +18,48 @@ executing. */ static const char *pcTextForTask1 = "Idle Task 1 is running"; static const char *pcTextForTask2 = "Idle Task 2 is running"; +static TaskHandle_t xTaskNotifyHandle = NULL; /*-----------------------------------------------------------*/ void CreateTasksForIdleTask(void) { BaseType_t ret; - + xTaskNotifyHandle = xTaskGetCurrentTaskHandle(); + uint32_t task_ret; /* Create the first task at priority 1... */ ret = xTaskCreate(vTaskFunction, "Idle Task 1", - TASK_STACK_SIZE, (void *)pcTextForTask1, 1, &xtask1_handle); + TASK_STACK_SIZE, (void *)pcTextForTask1, 1, NULL); if (ret != pdPASS) { - xtask1_handle = NULL; vPrintStringAndNumber("Idle Task 1 create failed: ", ret); + goto err_ret; } /* ... and the second task at priority 2. The priority is the second to last parameter. */ ret = xTaskCreate(vTaskFunction, "Idle Task 2", - TASK_STACK_SIZE, (void *)pcTextForTask2, 2, &xtask2_handle); + TASK_STACK_SIZE, (void *)pcTextForTask2, 2, NULL); if (ret != pdPASS) { - xtask1_handle = NULL; vPrintStringAndNumber("Idle Task 2 create failed: ", ret); + goto err_ret; } -} - -void DeleteTasksForForIdleTask(void) -{ - if (xtask1_handle) + ret = xTaskNotifyWait(0,0, &task_ret, TASK_WAIT_TIME); + if(ret != pdPASS || task_ret != 1) { - vTaskDelete(xtask1_handle); - vPrintString("Idle Task 1 deletion \r\n"); + goto err_ret; } - - if (xtask2_handle) + ret = xTaskNotifyWait(0,0, &task_ret, TASK_WAIT_TIME); + if(ret != pdPASS || task_ret != 1) { - vTaskDelete(xtask2_handle); - vPrintString("Idle Task 2 deletion \r\n"); + goto err_ret; } + printf("%s@%d: Tasks for idle [success].\r\n", __func__, __LINE__); + return; + +err_ret: + printf("%s@%d: Tasks for idle [failure].\r\n", __func__, __LINE__); + } /*-----------------------------------------------------------*/ @@ -65,24 +67,29 @@ void DeleteTasksForForIdleTask(void) static void vTaskFunction(void *pvParameters) { char *pcTaskName; - const TickType_t xDelay = pdMS_TO_TICKS(5000UL); - + const TickType_t xDelay = pdMS_TO_TICKS(1000UL); + int ulIdleCycleCountTemp; + uint32_t task_ret = 1; /* The string to print out is passed in via the parameter. Cast this to a character pointer. */ pcTaskName = (char *) pvParameters; - /* As per most tasks, this task is implemented in an infinite loop. */ - for (;;) - { - /* Print out the name of this task AND the number of times ulIdleCycleCount - has been incremented. */ - vPrintf("%s, count: %lu\n", pcTaskName, ulIdleCycleCount); + /* Print out the name of this task AND the number of times ulIdleCycleCount + has been incremented. */ + vPrintf("%s, count: %lu\n", pcTaskName, ulIdleCycleCount); + ulIdleCycleCountTemp = ulIdleCycleCount; + /* Delay for a period. This time we use a call to vTaskDelay() which + puts the task into the Blocked state until the delay period has expired. + The delay period is specified in 'ticks'. */ + vTaskDelay(xDelay); - /* Delay for a period. This time we use a call to vTaskDelay() which - puts the task into the Blocked state until the delay period has expired. - The delay period is specified in 'ticks'. */ - vTaskDelay(xDelay); + if(ulIdleCycleCount <= ulIdleCycleCountTemp) + { + task_ret = 0; } + + xTaskNotify(xTaskNotifyHandle, task_ret, eSetValueWithoutOverwrite); + vTaskDelete(NULL); } /*-----------------------------------------------------------*/ diff --git a/example/freertos_feature/task/src/priority_task.c b/example/freertos_feature/task/src/priority_task.c index c9a5d42c91e01b49c26777e44d9ff1b25af703dd..7e6abdb98ba0a1a2e4c8ea080fe44e151730fa49 100644 --- a/example/freertos_feature/task/src/priority_task.c +++ b/example/freertos_feature/task/src/priority_task.c @@ -2,17 +2,27 @@ This example demonstrates: how to create and delete tasks use priority; */ +#include #include "FreeRTOSConfig.h" #include "FreeRTOS.h" #include "task.h" +#include "queue.h" +#include "feature_task.h" /* Used as a loop counter to create a very crude delay. */ #define DELAY_LOOP_COUNT ( 0x1fffffff ) +#define QUEUE_WAIT_TIME pdMS_TO_TICKS(10000U) +#define LOOP_TIMES 2 #define TASK_STACK_SIZE 1024 +#define HIGH_PRIORITY 2 +#define LOW_PRIORITY 1 + static xTaskHandle xtask1_handle; -static xTaskHandle xtask2_handle; + + + /* The task function. */ static void vTaskFunction(void *pvParameters); @@ -23,40 +33,65 @@ executing. */ static const char *pcTextForTask1 = "Priority Task 1 is running\r\n"; static const char *pcTextForTask2 = "Priority Task 2 is running\r\n"; +static QueueHandle_t xQueue = NULL; /*-----------------------------------------------------------*/ + void CreateTasksForPriorityTest(void) { + BaseType_t ret = pdPASS; + int task_ret = 0; + xQueue = xQueueCreate(1,sizeof(int)); + if(xQueue == NULL) + { + FTASK_ERROR("xQueue create failed."); + goto err_ret; + } /* Create the first task at priority 1... */ - xTaskCreate(vTaskFunction, "Priority Task 1", TASK_STACK_SIZE, (void *)pcTextForTask1, 1, &xtask1_handle); - + ret = xTaskCreate(vTaskFunction, "Priority Task 1", TASK_STACK_SIZE, (void *)pcTextForTask1, LOW_PRIORITY, &xtask1_handle); + if (ret != pdPASS) + { + xtask1_handle = NULL; + vPrintStringAndNumber("Priority Task 1 create failed: ", ret); + goto err_ret; + } /* ... and the second task at priority 2. The priority is the second to last parameter. */ - xTaskCreate(vTaskFunction, "Priority Task 2", TASK_STACK_SIZE, (void *)pcTextForTask2, 2, &xtask2_handle); -} - -void DeleteTasksForPriorityTest(void) -{ + ret = xTaskCreate(vTaskFunction, "Priority Task 2", TASK_STACK_SIZE, (void *)pcTextForTask2, HIGH_PRIORITY, NULL); + if (ret != pdPASS) + { + vPrintStringAndNumber("Priority Task 2 create failed: ", ret); + goto err_ret; + } + ret = xQueueReceive(xQueue, &task_ret, QUEUE_WAIT_TIME); + /* task 1 will not excute, delete directly.*/ if (xtask1_handle) { vTaskDelete(xtask1_handle); - vPrintString("DeleteTasksForPriorityTest Task priority 1 deletion \r\n"); } - - if (xtask2_handle) + if(ret != pdPASS || task_ret != 1) { - vTaskDelete(xtask2_handle); - vPrintString("DeleteTasksForPriorityTest Task priority 2 deletion \r\n"); + goto err_ret; } + printf("%s@%d: Tasks for priority [success].\r\n", __func__, __LINE__); + return; + +err_ret: + + printf("%s@%d: Tasks for priority [failure].\r\n", __func__, __LINE__); } + + /*-----------------------------------------------------------*/ static void vTaskFunction(void *pvParameters) { char *pcTaskName; volatile uint32_t ul; - + UBaseType_t uxPriority; + int i = 0; + int task_ret = 1; /* The string to print out is passed in via the parameter. Cast this to a character pointer. */ pcTaskName = (char *) pvParameters; @@ -65,8 +100,13 @@ static void vTaskFunction(void *pvParameters) for (;;) { /* Print out the name of this task. */ - vPrintString(pcTaskName); + uxPriority = uxTaskPriorityGet(NULL); + printf("Current task's priority is %d\r\n",uxPriority); + if(uxPriority != HIGH_PRIORITY) + { + task_ret = 0; + } /* Delay for a period. */ for (ul = 0; ul < DELAY_LOOP_COUNT; ul++) { @@ -74,5 +114,14 @@ static void vTaskFunction(void *pvParameters) nothing to do in here. Later exercises will replace this crude loop with a proper delay/sleep function. */ } + + if(++i > LOOP_TIMES) + { + break; + } } +ret: + xQueueSend(xQueue, &task_ret, 0); + vTaskDelete(NULL); + } diff --git a/example/freertos_feature/task/src/task_cmd.c b/example/freertos_feature/task/src/task_cmd.c index f943b688d7567b571b29adfaf3875933f4be2195..051729e5771a122d41211838381e9a561b069f62 100644 --- a/example/freertos_feature/task/src/task_cmd.c +++ b/example/freertos_feature/task/src/task_cmd.c @@ -13,73 +13,48 @@ * * FilePath: task_cmd.c * Date: 2022-06-17 10:41:45 - * LastEditTime: 2022-06-17 10:41:45 + * LastEditTime: 2024-05-10 10:41:45 * Description: This file is for task example command interface * * Modify History: * Ver Who Date Changes * ----- ------ -------- -------------------------------------- * 1.0 wangxiaodong 2022/08/09 first commit + * 2.0 liyilun 2024/05/10 add no letter shell mode, adapt to auto test system */ -#include "shell.h" + #include "feature_task.h" #include #include - -typedef enum -{ - CREATING_TASK_INDEX = 0, - PARAMETERS_TEST_INDEX = 1, - PRIORITY_TEST_INDEX, - BLOCK_STATE_TEST_INDEX, - DELAY_UNTIL_TEST_INDEX, - BLOCKING_NON_BLOCKING_INDEX, - IDLE_TEST_INDEX, - CHANGE_PRIORITY_TEST_INDEX, - TASK_FEATURE_LENGTH -} FreeRtosTaskFeatureSelect; +#include "FreeRTOS.h" +#include "task.h" +#ifdef CONFIG_USE_LETTER_SHELL +#include "shell.h" static void CreateTasksCmdUsage(void) { printf("Usage:\r\n"); printf(" task cre \r\n"); printf(" -- Create tasks now. \r\n"); - printf(" task del \r\n"); - printf(" -- Del tasks now. \r\n"); printf(" task para_cre \r\n"); printf(" -- Create parameter test tasks now. \r\n"); - printf(" task para_del \r\n"); - printf(" -- Del parameter test tasks now. \r\n"); printf(" task pri_cre \r\n"); printf(" -- Create priority test tasks now. \r\n"); - printf(" task pri_del \r\n"); - printf(" -- Del priority test tasks now. \r\n"); printf(" task blo_cre \r\n"); printf(" -- Create block state test tasks now. \r\n"); - printf(" task blo_del \r\n"); - printf(" -- Del block state test tasks now. \r\n"); printf(" task dn_cre \r\n"); printf(" -- Create task until test tasks now. \r\n"); - printf(" task dn_del \r\n"); - printf(" -- Del task until test tasks now. \r\n"); printf(" task bn_cre \r\n"); printf(" -- Create task combining blocking non blocking tasks now. \r\n"); - printf(" task bn_del \r\n"); - printf(" -- Del task combining blocking non blocking tasks now. \r\n"); printf(" task idle_cre \r\n"); printf(" -- Create task idle tasks now. \r\n"); - printf(" task idle_del \r\n"); - printf(" -- Del task idle tasks now \r\n"); printf(" task cha_cre \r\n"); printf(" -- Create task change priority tasks now. \r\n"); - printf(" task cha_del \r\n"); - printf(" -- Del task change priority tasks now. \r\n"); } int CreateTasksCmd(int argc, char *argv[]) { - static int create_flg[TASK_FEATURE_LENGTH] = {0}; /* 1 is tasks has been created*/ if (argc < 2) { @@ -89,195 +64,35 @@ int CreateTasksCmd(int argc, char *argv[]) if (!strcmp(argv[1], "cre")) { - if (create_flg[CREATING_TASK_INDEX] == 0) - { - CreateTasks(); - create_flg[CREATING_TASK_INDEX] = 1; - } - else - { - printf("Please use del cmd first. \r\n"); - } - } - else if (!strcmp(argv[1], "del")) - { - if (create_flg[CREATING_TASK_INDEX] == 1) - { - DeleteTasks(); - create_flg[CREATING_TASK_INDEX] = 0; - } - else - { - printf("Please use cre cmd first. \r\n"); - } + CreateTasks(); } else if (!strcmp(argv[1], "para_cre")) { - if (create_flg[PARAMETERS_TEST_INDEX] == 0) - { - CreateTasksForParamterTest(); - create_flg[PARAMETERS_TEST_INDEX] = 1; - } - else - { - printf("Please use task para_del cmd first. \r\n"); - } - } - else if (!strcmp(argv[1], "para_del")) - { - if (create_flg[PARAMETERS_TEST_INDEX] == 1) - { - DeleteTasksForParamterTest(); - create_flg[PARAMETERS_TEST_INDEX] = 0; - } - else - { - printf("Please use task para_cre cmd first. \r\n"); - } + CreateTasksForParamterTest(); } else if (!strcmp(argv[1], "pri_cre")) { - if (create_flg[PRIORITY_TEST_INDEX] == 0) - { - CreateTasksForPriorityTest(); - create_flg[PRIORITY_TEST_INDEX] = 1; - } - else - { - printf("Please use task pri_del cmd first. \r\n"); - } - } - else if (!strcmp(argv[1], "pri_del")) - { - if (create_flg[PRIORITY_TEST_INDEX] == 1) - { - DeleteTasksForPriorityTest(); - create_flg[PRIORITY_TEST_INDEX] = 0; - } - else - { - printf("Please use task pri_cre cmd first. \r\n"); - } + CreateTasksForPriorityTest(); } else if (!strcmp(argv[1], "blo_cre")) { - if (create_flg[BLOCK_STATE_TEST_INDEX] == 0) - { - CreateTasksForBlockTest(); - create_flg[BLOCK_STATE_TEST_INDEX] = 1; - } - else - { - printf("Please use task blo_del cmd first. \r\n"); - } - } - else if (!strcmp(argv[1], "blo_del")) - { - if (create_flg[BLOCK_STATE_TEST_INDEX] == 1) - { - DeleteTasksForBlockTest(); - create_flg[BLOCK_STATE_TEST_INDEX] = 0; - } - else - { - printf("Please use task blo_cre cmd first. \r\n"); - } + CreateTasksForBlockTest(); } else if (!strcmp(argv[1], "dn_cre")) { - if (create_flg[DELAY_UNTIL_TEST_INDEX] == 0) - { - CreateTasksForDelayUntilTest(); - create_flg[DELAY_UNTIL_TEST_INDEX] = 1; - } - else - { - printf("Please use task dn_del cmd first. \r\n"); - } - } - else if (!strcmp(argv[1], "dn_del")) - { - if (create_flg[DELAY_UNTIL_TEST_INDEX] == 1) - { - DeleteTasksForDelayUntilTest(); - create_flg[DELAY_UNTIL_TEST_INDEX] = 0; - } - else - { - printf("Please use task dn_cre cmd first. \r\n"); - } + CreateTasksForDelayUntilTest(); } else if (!strcmp(argv[1], "bn_cre")) { - if (create_flg[BLOCKING_NON_BLOCKING_INDEX] == 0) - { - CreateTasksForBlockingOrNone(); - create_flg[BLOCKING_NON_BLOCKING_INDEX] = 1; - } - else - { - printf("Please use task bn_del cmd first. \r\n"); - } - } - else if (!strcmp(argv[1], "bn_del")) - { - if (create_flg[BLOCKING_NON_BLOCKING_INDEX] == 1) - { - DeleteTasksForBlockingOrNone(); - create_flg[BLOCKING_NON_BLOCKING_INDEX] = 0; - } - else - { - printf("Please use task bn_cre cmd first. \r\n"); - } + CreateTasksForBlockingOrNone(); } else if (!strcmp(argv[1], "idle_cre")) { - if (create_flg[IDLE_TEST_INDEX] == 0) - { - CreateTasksForIdleTask(); - create_flg[IDLE_TEST_INDEX] = 1; - } - else - { - printf("Please use task idle_del cmd first. \r\n"); - } - } - else if (!strcmp(argv[1], "idle_del")) - { - if (create_flg[IDLE_TEST_INDEX] == 1) - { - DeleteTasksForForIdleTask(); - create_flg[IDLE_TEST_INDEX] = 0; - } - else - { - printf("Please use task idle_cre cmd first. \r\n"); - } + CreateTasksForIdleTask(); } else if (!strcmp(argv[1], "cha_cre")) { - if (create_flg[CHANGE_PRIORITY_TEST_INDEX] == 0) - { - CreateTasksForChangePriorityTest(); - create_flg[CHANGE_PRIORITY_TEST_INDEX] = 1; - } - else - { - printf("Please use task cha_del cmd first. \r\n"); - } - } - else if (!strcmp(argv[1], "cha_del")) - { - if (create_flg[CHANGE_PRIORITY_TEST_INDEX] == 1) - { - DeleteTasksForChangePriorityTest(); - create_flg[CHANGE_PRIORITY_TEST_INDEX] = 0; - } - else - { - printf("Please use task cha_cre cmd first. \r\n"); - } + CreateTasksForChangePriorityTest(); } else { @@ -289,4 +104,21 @@ int CreateTasksCmd(int argc, char *argv[]) SHELL_EXPORT_CMD(SHELL_CMD_TYPE(SHELL_TYPE_CMD_MAIN), task, CreateTasksCmd, task creating test); +#else + +void TasksExampleEntry(void) +{ + CreateTasks(); + CreateTasksForParamterTest(); + CreateTasksForPriorityTest(); + CreateTasksForBlockTest(); + CreateTasksForDelayUntilTest(); + CreateTasksForBlockingOrNone(); + CreateTasksForIdleTask(); + CreateTasksForChangePriorityTest(); + printf("[test_end].\r\n"); + vTaskDelete(NULL); + +} +#endif diff --git a/example/freertos_feature/task/src/task_combining_blocking_non_blocking.c b/example/freertos_feature/task/src/task_combining_blocking_non_blocking.c index d17cbab95aea9798d3e8109852def11525574151..f373fa7e4b85ca7c0747a1763fed7eebdb0522ad 100644 --- a/example/freertos_feature/task/src/task_combining_blocking_non_blocking.c +++ b/example/freertos_feature/task/src/task_combining_blocking_non_blocking.c @@ -1,16 +1,17 @@ #include "FreeRTOSConfig.h" #include "FreeRTOS.h" #include "task.h" +#include #define TASK_STACK_SIZE 1024 +#define TASK_WAIT_TIME pdMS_TO_TICKS(8000UL) +#define TASK_DELAY pdMS_TO_TICKS(1000UL) /* The task functions. */ static void vContinuousProcessingTask(void *pvParameters); static void vPeriodicTask(void *pvParameters); -static xTaskHandle xtask1_handle; -static xTaskHandle xtask2_handle; -static xTaskHandle xtask3_handle; +static TaskHandle_t xTaskNotifyHandle = NULL; /* Define the strings that will be passed in as the task parameters. These are defined const and off the stack to ensure they remain valid when the tasks are @@ -21,38 +22,56 @@ static const char *pcTextForPeriodicTask = "BlockingOrNone Periodic task is runn /*-----------------------------------------------------------*/ void CreateTasksForBlockingOrNone(void) -{ +{ + BaseType_t ret = pdPASS; + uint32_t task_ret; + xTaskNotifyHandle = xTaskGetCurrentTaskHandle(); /* Create two instances of the continuous processing task, both at priority 1. */ - xTaskCreate(vContinuousProcessingTask, "BlockingOrNone Task 1", - TASK_STACK_SIZE, (void *)pcTextForTask1, 1, &xtask1_handle); + ret = xTaskCreate(vContinuousProcessingTask, "BlockingOrNone Task 1", + TASK_STACK_SIZE, (void *)pcTextForTask1, 1, NULL); + if (ret != pdPASS) + { + vPrintStringAndNumber("BlockingOrNone Task 1 create failed: ", ret); + goto err_ret; + } - xTaskCreate(vContinuousProcessingTask, "BlockingOrNone Task 2", - TASK_STACK_SIZE, (void *)pcTextForTask2, 1, &xtask2_handle); + ret = xTaskCreate(vContinuousProcessingTask, "BlockingOrNone Task 2", + TASK_STACK_SIZE, (void *)pcTextForTask2, 1, NULL); + if (ret != pdPASS) + { + vPrintStringAndNumber("BlockingOrNone Task 2 create failed: ", ret); + goto err_ret; + } /* Create one instance of the periodic task at priority 2. */ - xTaskCreate(vPeriodicTask, "BlockingOrNone Task 3", - TASK_STACK_SIZE, (void *)pcTextForPeriodicTask, 2, &xtask3_handle); -} - -void DeleteTasksForBlockingOrNone(void) -{ - if (xtask1_handle) + ret = xTaskCreate(vPeriodicTask, "BlockingOrNone Task 3", + TASK_STACK_SIZE, (void *)pcTextForPeriodicTask, 2, NULL); + if (ret != pdPASS) { - vTaskDelete(xtask1_handle); - vPrintString("BlockingOrNone Task 1 deletion \r\n"); + vPrintStringAndNumber("BlockingOrNone Task 3 create failed: ", ret); + goto err_ret; } - if (xtask2_handle) + ret = ulTaskNotifyTake(pdTRUE, TASK_WAIT_TIME); + if(ret != pdPASS) { - vTaskDelete(xtask2_handle); - vPrintString("BlockingOrNone Task 2 deletion \r\n"); + goto err_ret; } - - if (xtask3_handle) + ret = ulTaskNotifyTake(pdTRUE, TASK_WAIT_TIME); + if(ret != pdPASS) + { + goto err_ret; + } + ret = ulTaskNotifyTake(pdTRUE, TASK_WAIT_TIME); + if(ret != pdPASS) { - vTaskDelete(xtask3_handle); - vPrintString("BlockingOrNone Task 3 deletion \r\n"); + goto err_ret; } + printf("%s@%d: Tasks for blocking or none [success].\r\n", __func__, __LINE__); + return; + +err_ret: + printf("%s@%d: Tasks for blocking or none [failure].\r\n", __func__, __LINE__); } /*-----------------------------------------------------------*/ @@ -63,22 +82,23 @@ void vContinuousProcessingTask(void *pvParameters) character pointer. */ pcTaskName = (char *) pvParameters; - /* As per most tasks, this task is implemented in an infinite loop. */ - for (;;) - { - /* Print out the name of this task. This task just does this repeatedly - without ever blocking or delaying. */ - vPrintString(pcTaskName); - vTaskDelay(5000); + /* Print out the name of this task. This task just does this repeatedly + without ever blocking or delaying. */ + vPrintString(pcTaskName); - } + vTaskDelay(TASK_DELAY); + + xTaskNotifyGive(xTaskNotifyHandle); + vTaskDelete(NULL); } /*-----------------------------------------------------------*/ void vPeriodicTask(void *pvParameters) { TickType_t xLastWakeTime; - const TickType_t xDelay = pdMS_TO_TICKS(5000UL); + + /* Print out the name of this task. */ + vPrintString("Periodic task is running\r\n"); /* The xLastWakeTime variable needs to be initialized with the current tick count. Note that this is the only time we access this variable. From this @@ -86,13 +106,11 @@ void vPeriodicTask(void *pvParameters) API function. */ xLastWakeTime = xTaskGetTickCount(); - /* As per most tasks, this task is implemented in an infinite loop. */ - for (;;) - { - /* Print out the name of this task. */ - vPrintString("Periodic task is running\r\n"); + + /* We want this task to execute exactly every 100 milliseconds. */ + vTaskDelayUntil(&xLastWakeTime, TASK_DELAY); + /*xLastWakeTime have been updated*/ - /* We want this task to execute exactly every 100 milliseconds. */ - vTaskDelayUntil(&xLastWakeTime, xDelay); - } + xTaskNotifyGive(xTaskNotifyHandle); + vTaskDelete(NULL); } \ No newline at end of file diff --git a/example/freertos_feature/task/src/task_delay_until.c b/example/freertos_feature/task/src/task_delay_until.c index dacba9eb334e5d2af6161ea947596ee448f06ded..7286608bf2ea82f689575196ee95b15ee9c69450 100644 --- a/example/freertos_feature/task/src/task_delay_until.c +++ b/example/freertos_feature/task/src/task_delay_until.c @@ -5,12 +5,15 @@ how to use delay until in tasks; #include "FreeRTOSConfig.h" #include "FreeRTOS.h" #include "task.h" +#include #define TASK_STACK_SIZE 1024 -static xTaskHandle xtask1_handle; -static xTaskHandle xtask2_handle; +#define DELAY_UNTIL pdMS_TO_TICKS(1000UL) +#define TASK_WAIT_TIME pdMS_TO_TICKS(5000UL) + +static TaskHandle_t xTaskNotifyHandle = NULL; /* The task function. */ static void vTaskFunction(void *pvParameters); @@ -21,61 +24,77 @@ static const char *pcTextForTask1 = "Delay Until Task 1 is running\r\n"; static const char *pcTextForTask2 = "Delay Until Task 2 is running\r\n"; /*-----------------------------------------------------------*/ - - void CreateTasksForDelayUntilTest(void) { - /* Create the first task at priority 1... */ - xTaskCreate(vTaskFunction, "Delay Until Task 1", TASK_STACK_SIZE, (void *)pcTextForTask1, 1, &xtask1_handle); + BaseType_t ret = pdPASS; + int task_ret = 0; + + xTaskNotifyHandle = xTaskGetCurrentTaskHandle(); + /* Create the first task at priority 1... */ + ret = xTaskCreate(vTaskFunction, "Delay Until Task 1", TASK_STACK_SIZE, (void *)pcTextForTask1, 1, NULL); + if (ret != pdPASS) + { + vPrintStringAndNumber("Delay Until Task 1 create failed: ", ret); + goto err_ret; + } /* ... and the second task at priority 2. The priority is the second to last parameter. */ - xTaskCreate(vTaskFunction, "Delay Until Task 2", TASK_STACK_SIZE, (void *)pcTextForTask2, 2, &xtask2_handle); -} - -void DeleteTasksForDelayUntilTest(void) -{ - if (xtask1_handle) + xTaskCreate(vTaskFunction, "Delay Until Task 2", TASK_STACK_SIZE, (void *)pcTextForTask2, 2, NULL); + if (ret != pdPASS) { - vTaskDelete(xtask1_handle); - vPrintString("Delay Until Task parameter 1 deletion \r\n"); + vPrintStringAndNumber("Delay Until Task 2 create failed: ", ret); + goto err_ret; } - if (xtask2_handle) + ret = ulTaskNotifyTake(pdTRUE,TASK_WAIT_TIME); + if(ret != pdPASS) + { + goto err_ret; + } + ret = ulTaskNotifyTake(pdTRUE,TASK_WAIT_TIME); + if(ret != pdPASS) { - vTaskDelete(xtask2_handle); - vPrintString("Delay Until Task parameter 2 deletion \r\n"); + goto err_ret; } + + printf("%s@%d: Tasks for delay until [success].\r\n", __func__, __LINE__); + return; + +err_ret: + printf("%s@%d: Tasks for delay until [failure].\r\n", __func__, __LINE__); } + /*-----------------------------------------------------------*/ static void vTaskFunction(void *pvParameters) { char *pcTaskName; TickType_t xLastWakeTime; - const TickType_t xDelay = pdMS_TO_TICKS(3000UL); - + TickType_t xLastWakeTimeTemp; /* The string to print out is passed in via the parameter. Cast this to a character pointer. */ pcTaskName = (char *) pvParameters; + /* Print out the name of this task. */ + vPrintString(pcTaskName); /* The xLastWakeTime variable needs to be initialized with the current tick count. Note that this is the only time we access this variable. From this point on xLastWakeTime is managed automatically by the vTaskDelayUntil() API function. */ xLastWakeTime = xTaskGetTickCount(); + xLastWakeTimeTemp = xLastWakeTime; - /* As per most tasks, this task is implemented in an infinite loop. */ - for (;;) - { - /* Print out the name of this task. */ - vPrintString(pcTaskName); + /* We want this task to execute exactly every 1000 milliseconds. As per + the vTaskDelay() function, time is measured in ticks, and the + pdMS_TO_TICKS() macro is used to convert this to milliseconds. + xLastWakeTime is automatically updated within vTaskDelayUntil() so does not + have to be updated by this task code. */ + vTaskDelayUntil(&xLastWakeTime, DELAY_UNTIL); - /* We want this task to execute exactly every 1000 milliseconds. As per - the vTaskDelay() function, time is measured in ticks, and the - pdMS_TO_TICKS() macro is used to convert this to milliseconds. - xLastWakeTime is automatically updated within vTaskDelayUntil() so does not - have to be updated by this task code. */ - vTaskDelayUntil(&xLastWakeTime, xDelay); + if(xLastWakeTime == xLastWakeTimeTemp + DELAY_UNTIL) + { + xTaskNotifyGive(xTaskNotifyHandle); } + vTaskDelete(NULL); } diff --git a/example/freertos_feature/task/src/using_task_parameter.c b/example/freertos_feature/task/src/using_task_parameter.c index 10847638da9ad79d973addfd7e0a130bc443a8c8..acec1d106d51178dd4401cf036fde7f831ae615a 100644 --- a/example/freertos_feature/task/src/using_task_parameter.c +++ b/example/freertos_feature/task/src/using_task_parameter.c @@ -2,10 +2,13 @@ This example demonstrates: how to create and delete tasks use parameters; */ - +#include #include "FreeRTOSConfig.h" #include "FreeRTOS.h" +#include "fkernel.h" #include "task.h" +#include "string.h" +#include "feature_task.h" /* Used as a loop counter to create a very crude delay. */ #define DELAY_LOOP_COUNT ( 0x1fffffff ) @@ -13,13 +16,16 @@ how to create and delete tasks use parameters; /* task stack size set. */ #define TASK_STACK_SIZE 1024 -static xTaskHandle xtask1_handle; -static xTaskHandle xtask2_handle; +#define TASK_DELAY pdMS_TO_TICKS(1000UL) +#define TASK_WAIT_TIME pdMS_TO_TICKS(5000UL) /* The task function. */ -static void vTaskFunction(void *pvParameters); +static void vTaskFunction1(void *pvParameters); +static void vTaskFunction2(void *pvParameters); + +static TaskHandle_t xTaskNotifyHandle = NULL; /* Define the strings that will be passed in as the task parameters. These are defined const and off the stack to ensure they remain valid when the tasks are executing. */ @@ -30,59 +36,96 @@ const char *pcTextForTask2 = "Parameter Task 2 is running\r\n"; void CreateTasksForParamterTest(void) { + BaseType_t ret = pdPASS; + xTaskNotifyHandle = xTaskGetCurrentTaskHandle(); + uint32_t task_ret = 0; /* Create one of the two tasks. */ - xTaskCreate(vTaskFunction, /* Pointer to the function that implements the task. */ + ret = xTaskCreate(vTaskFunction1, /* Pointer to the function that implements the task. */ "Parameter Task 1", /* Text name for the task. This is to facilitate debugging only. */ TASK_STACK_SIZE, /* Stack depth - most small microcontrollers will use much less stack than this. */ (void *)pcTextForTask1, /* Pass the text to be printed in as the task parameter. */ 1, /* This task will run at priority 1. */ - &xtask1_handle); /* We are not using the task handle. */ - + NULL); /* We are not using the task handle. */ + if (ret != pdPASS) + { + vPrintStringAndNumber("Parameter Task 1 create failed: ", ret); + goto err_ret; + } /* Create the other task in exactly the same way. Note this time that we are creating the SAME task, but passing in a different parameter. We are creating two instances of a single task implementation. */ - xTaskCreate(vTaskFunction, "Parameter Task 2", TASK_STACK_SIZE, (void *)pcTextForTask2, 1, &xtask2_handle); + ret = xTaskCreate(vTaskFunction2, "Parameter Task 2", TASK_STACK_SIZE, (void *)pcTextForTask2, 1, NULL); + if (ret != pdPASS) + { + vPrintStringAndNumber("Parameter Task 2 create failed: ", ret); + goto err_ret; + } + ret = xTaskNotifyWait(0, 0, &task_ret, TASK_WAIT_TIME); + if(ret != pdPASS || task_ret != 1) + { + goto err_ret; + } + ret = xTaskNotifyWait(0, 0, &task_ret, TASK_WAIT_TIME); + if(ret != pdPASS || task_ret != 1) + { + goto err_ret; + } + printf("%s@%d: Tasks for parameter [success].\r\n", __func__, __LINE__); + return; + +err_ret: + printf("%s@%d: Tasks for parameter [failure].\r\n", __func__, __LINE__); } +/*-----------------------------------------------------------*/ -void DeleteTasksForParamterTest(void) +static void vTaskFunction1(void *pvParameters) { - if (xtask1_handle) - { - vTaskDelete(xtask1_handle); - vPrintString("DeleteTasksForParamterTest Task parameter 1 deletion \r\n"); - } + char *pcTaskName; + volatile uint32_t ul; + uint32_t task_ret; + /* The string to print out is passed in via the parameter. Cast this to a + character pointer. */ + pcTaskName = (char *) pvParameters; + + /* Print out the name of this task. */ + vPrintString(pcTaskName); - if (xtask2_handle) + if(!strcmp(pcTaskName, pcTextForTask1)) { - vTaskDelete(xtask2_handle); - vPrintString("DeleteTasksForParamterTest Task parameter 2 deletion \r\n"); + task_ret = 1; + } + else{ + task_ret = 0; } + /* Delay for a period. */ + vTaskDelay(TASK_DELAY); + xTaskNotify(xTaskNotifyHandle, task_ret, eSetValueWithoutOverwrite); + vTaskDelete(NULL); } -/*-----------------------------------------------------------*/ -static void vTaskFunction(void *pvParameters) +static void vTaskFunction2(void *pvParameters) { char *pcTaskName; volatile uint32_t ul; - + uint32_t task_ret = 0; /* The string to print out is passed in via the parameter. Cast this to a character pointer. */ pcTaskName = (char *) pvParameters; - - /* As per most tasks, this task is implemented in an infinite loop. */ - for (;;) + + /* Print out the name of this task. */ + vPrintString(pcTaskName); + if(!strcmp(pcTaskName, pcTextForTask2)) { - /* Print out the name of this task. */ - vPrintString(pcTaskName); - - /* Delay for a period. */ - for (ul = 0; ul < DELAY_LOOP_COUNT; ul++) - { - /* This loop is just a very crude delay implementation. There is - nothing to do in here. Later exercises will replace this crude - loop with a proper delay/sleep function. */ - } + task_ret = 1; + } + else{ + task_ret = 0; } + + /* Delay for a period. */ + vTaskDelay(TASK_DELAY); + xTaskNotify(xTaskNotifyHandle, task_ret, eSetValueWithoutOverwrite); + vTaskDelete(NULL); } \ No newline at end of file diff --git a/example/network/lwip_iperf/README.md b/example/network/lwip_iperf/README.md index 93834fc63b6d07244437aac49a851e14cab065b7..3a1e5f696bf2afc819a256cd4bdbbf61b1265975 100644 --- a/example/network/lwip_iperf/README.md +++ b/example/network/lwip_iperf/README.md @@ -120,6 +120,7 @@ lwip iperfc ![iperf_client_example_result](./fig/iperf_client_example.png) ![iperf_client_test_result](./fig/iperf_client_test.png) + #### 2.4.2 网卡iperf server测试例程 (lwip_iperf_server_example.c) ``` lwip iperfs @@ -146,7 +147,12 @@ lwip iperfs ``` .mac_address={0x98, 0x0e, 0x24, 0x00, 0x11, 0x1}, ``` + - Q: 在进行lwip_iperfc测试时如何配置server的ip地址? + - A: 在lwip_iperf_client_example中修改如下代码即可: +``` + const ip_addr_t remote= IPADDR4_INIT_BYTES(192,168,4,50); +``` ## 4. 修改历史记录 >记录例程的重大修改记录,标明修改发生的版本号
diff --git a/example/network/lwip_startup/README.md b/example/network/lwip_startup/README.md index 47c1ecb9eeced7177fa0c189994db2c7a27ec82b..408321a86ea5dc3d56f3fc45bcfc6a6960e43261 100644 --- a/example/network/lwip_startup/README.md +++ b/example/network/lwip_startup/README.md @@ -163,5 +163,4 @@ lwip dhcp ## 4. 修改历史记录 -v0.2.0 重构lwip - +v0.2.0 重构lwip \ No newline at end of file diff --git a/example/network/sockets/udp_multicast/README.md b/example/network/sockets/udp_multicast/README.md index 119260134a0b70e05642e9ce6829c6821406f19b..d84a7fb9047eaf1387b4eeeadb6bc2264312a27c 100644 --- a/example/network/sockets/udp_multicast/README.md +++ b/example/network/sockets/udp_multicast/README.md @@ -84,7 +84,6 @@ make make image ``` - #### 2.3.2 下载过程 - host侧设置重启host侧tftp服务器 @@ -116,8 +115,6 @@ make menuconfig ![](./pic/ipv4_config.png) - - ##### IPv4 && IPv6 共存的模式 - 输入以下命令 @@ -125,18 +122,14 @@ make menuconfig ``` make menuconfig ``` - - 需将Multicast IP type 选为 IPV4 & IPV6 ![](./pic/ipv4_ipv6_config.png) - - 关闭仅仅使用IPv4 选项 ![](./pic/DisableNotusingIPV4attheaSametime.png) - - #### 2.4.2 如何进行实验 - 当开发者配置好程序之后,通过2.3.1/2.3.2的方式将编译好的镜像文件拷贝至开发板中。 @@ -163,19 +156,15 @@ lwip probe < ![](./pic/lwip_probe.png) - - - - - #### 2.4.3 进行multicast 测试 - 完成2.4.1 / 2.4.2 之后 ,可以进行multcast 的相关实验 ,以下以ipv6 的实验为例 -- 在串口终端上输入以下指令 +- 在开发板的letter-shell终端上输入以下指令 ``` multicast e0 ``` - 在编译器环境下执行 +>在上位机(一般是个人PC)shell终端中输入make test_code以生成multicast_server_ipv6.out脚本 ``` ./multicast_server_ipv6.out ``` @@ -188,14 +177,8 @@ multicast e0 ![](./pic/测试终端打印.png) - ## 3. 如何解决问题 - - - ## 4. 修改历史记录 -v0.1.0 完成第一版初始化 - - +v0.1.0 完成第一版初始化 \ No newline at end of file diff --git a/example/peripheral/can/can/src/can_intr_loopback_mode_example.c b/example/peripheral/can/can/src/can_intr_loopback_mode_example.c index 1a1118355f8708c09b6c38de8bf9ce96a4fac806..e38530ea8bc0801f340b5865fd7d088fb773b98f 100644 --- a/example/peripheral/can/can/src/can_intr_loopback_mode_example.c +++ b/example/peripheral/can/can/src/can_intr_loopback_mode_example.c @@ -82,6 +82,12 @@ static FError FFreeRTOSCanSendThenRecvData(int ide); static FError FFreeRTOSCanRecvData(FCanQueueData * xReceiveStructure); static void FFreeRTOSCanDelete(void); +static void FCanTxIrqCallback(void *args) +{ + FFreeRTOSCan *os_can_p = (FFreeRTOSCan *)args; + FCAN_TEST_DEBUG("Can%d irq send frame is ok.", os_can_p->can_ctrl.config.instance_id); +} + static void FCanRxIrqCallback(void *args) { FFreeRTOSCan *os_can_p = (FFreeRTOSCan *)args; @@ -104,6 +110,16 @@ static FError FFreeRTOSCanIntrSet(FFreeRTOSCan *os_can_p) FCanIntrEventConfig intr_event; memset(&intr_event, 0, sizeof(intr_event)); + intr_event.type = FCAN_INTR_EVENT_SEND; + intr_event.handler = FCanTxIrqCallback; + intr_event.param = (void *)os_can_p; + ret = FFreeRTOSCanControl(os_can_p, FREERTOS_CAN_CTRL_INTR_SET, &intr_event); + if (FCAN_SUCCESS != ret) + { + FCAN_TEST_ERROR("FFreeRTOSCanControl FCAN_INTR_EVENT_SEND failed."); + return ret; + } + intr_event.type = FCAN_INTR_EVENT_RECV; intr_event.handler = FCanRxIrqCallback; intr_event.param = (void *)os_can_p; diff --git a/example/peripheral/gpio/src/gpio_io_irq.c b/example/peripheral/gpio/src/gpio_io_irq.c index ddc9175a7d96738200d0292c10d3ac2aecd34aaa..ed5282fa4923b1d9eb854029331e8beff0277f23 100644 --- a/example/peripheral/gpio/src/gpio_io_irq.c +++ b/example/peripheral/gpio/src/gpio_io_irq.c @@ -41,8 +41,8 @@ #endif #ifdef CONFIG_FIREFLY_DEMO_BOARD - #define IN_PIN_INDEX FFREERTOS_GPIO_PIN_INDEX(1, 0, 12) - #define OUT_PIN_INDEX FFREERTOS_GPIO_PIN_INDEX(1, 0, 11) + #define IN_PIN_INDEX FFREERTOS_GPIO_PIN_INDEX(3, 0, 1) + #define OUT_PIN_INDEX FFREERTOS_GPIO_PIN_INDEX(3, 0, 2) #endif #define PIN_IRQ_OCCURED BIT(0) diff --git a/example/peripheral/media/lvgl_demo/README.md b/example/peripheral/media/lvgl_demo/README.md index fd77da15b779aa80cc91e8d25f0cd0af684a0096..22e6c7bd3dc29c80fc4fff69e72ba14762028aed 100644 --- a/example/peripheral/media/lvgl_demo/README.md +++ b/example/peripheral/media/lvgl_demo/README.md @@ -7,7 +7,7 @@ DC 是一个显示控制器,主要完成将 CPU/GPU/VPU 处理后的图像数据,按照 Display 协议处理后送给 DP PHY 接入显示器。 本司E2000系列型号芯片采用DisplayPort1.4协议,兼容 DisplayPort1.4/Embedded DisplayPort1.3 协议。 -本例程主要展示本司E2000系列芯片DC显示驱动功能以及lvgl中benchmark, stress以及widgets例程的操作。 +本例程主要展示本司E2000系列以及phytiumpi芯片DC显示驱动功能以及lvgl中benchmark, stress以及widgets例程的操作。 lvgl中benchmark是一个基准测试,用来测试硬件平台的性能和驱动支持buufer刷新能力,主要是测试屏幕刷新的流畅度以及帧率。 @@ -28,7 +28,7 @@ lvgl中widgets属于组件测试,将lvgl中库组件组合运行,此demo属 本例程需要用到 -- Phytium开发板(E2000Q) +- Phytium开发板(E2000开发板或phytiumpi)) - 显示器及连接线 - [Phytium Standalone SDK](https://gitee.com/phytium_embedded/phytium-standalone-sdk) @@ -44,14 +44,14 @@ lvgl中widgets属于组件测试,将lvgl中库组件组合运行,此demo属 本例程所需的硬件设备包括 -- 通过DP线将显示器与E2000板卡连接 +- 通过DP线将显示器与板卡连接 - 利用串口调试线连接板卡和调试电脑,波特率设为 115200-8-1-N +- phytiumpi上Dp需通过转接线连接,无直接Dp接口 ### 2.2 SDK配置方法 >依赖哪些驱动、库和第三方组件,如何完成配置(列出需要使能的关键配置项)
- - 本例子已经提供好具体的编译指令,以下进行介绍: - make 将目录下的工程进行编译 - make clean 将目录下的工程进行清理 @@ -80,15 +80,12 @@ make menuconfig make image ``` - 在host侧完成构建 -- 选择即将要运行的例程 - -![demo_select](fig/demo_select.png) -选定demo例程后, 利用2.2 SDK配置方法进行编译下载,默认demo为benchmark,色深设置为32 +利用2.2 SDK配置方法进行编译下载,默认demo为benchmark,色深设置为32 -目前在menuconfig中支持配置demo选择以及色深设置,其余设置值为third-party/lvgl-8.3/lv_conf.h设置默认值 +LVGL提供可配置文件,配置目录为third-party/lvgl-8.3/lv_conf.h设置 -在使用过程中, 使用者可根据实际硬件情况以及需要,在third-party/lvgl-8.3/lv_conf.h中进行相应组件配置。 +在使用过程中,使用者可根据实际硬件情况以及需要,在third-party/lvgl-8.3/lv_conf.h中进行相应组件配置。 #### 2.3.2 下载过程 @@ -116,20 +113,15 @@ bootelf -p 0x90100000 #### 2.4.1 初始化硬件设备控制器 -Media init 2 640 480 2 32 60 +Media init -- 2 : 通道号 -- 640 : 宽 -- 480 : 高 -- 2 :模式(克隆,水平,垂直) -- 32 :色深 -- 60 :刷新率 +![media_init](fig/media_init.png) 初始化LVGL图形库: Media lvgl-init -![init](fig/media_init.png) +![lvgl_init](fig/lvgl_init.png) #### 2.4.2 example测试 @@ -143,7 +135,6 @@ Media demo ![widgets](fig/lvgl_widgets.jpg) - ## 3. 如何解决问题 >主要记录使用例程中可能会遇到的问题,给出相应的解决方案
@@ -153,5 +144,4 @@ Media demo >记录例程的重大修改记录,标明修改发生的版本号
- 2022-12-6 :v0.0.1 添加example -- 2023-03-03: v0.0.2 添加多屏 - +- 2023-03-03: v0.0.2 添加多屏 \ No newline at end of file diff --git a/example/peripheral/media/lvgl_demo/fig/demo_select.png b/example/peripheral/media/lvgl_demo/fig/demo_select.png deleted file mode 100644 index 5b69566ff19de9583ab00635c60af4655e6d0f93..0000000000000000000000000000000000000000 Binary files a/example/peripheral/media/lvgl_demo/fig/demo_select.png and /dev/null differ diff --git a/example/peripheral/media/lvgl_demo/fig/lvgl_init.png b/example/peripheral/media/lvgl_demo/fig/lvgl_init.png new file mode 100644 index 0000000000000000000000000000000000000000..88874b7a4c267a86a672ec8160d94cf104c87cf9 Binary files /dev/null and b/example/peripheral/media/lvgl_demo/fig/lvgl_init.png differ diff --git a/example/peripheral/media/lvgl_demo/fig/media_cmd.png b/example/peripheral/media/lvgl_demo/fig/media_cmd.png deleted file mode 100644 index 1a00c0e15863b2ec158d5f0782aa5126d9704a80..0000000000000000000000000000000000000000 Binary files a/example/peripheral/media/lvgl_demo/fig/media_cmd.png and /dev/null differ diff --git a/example/peripheral/media/lvgl_demo/fig/media_init.png b/example/peripheral/media/lvgl_demo/fig/media_init.png new file mode 100644 index 0000000000000000000000000000000000000000..9e8c96348c5a973afb144111a87d58adfb40be56 Binary files /dev/null and b/example/peripheral/media/lvgl_demo/fig/media_init.png differ diff --git a/example/peripheral/media/lvgl_demo/makefile b/example/peripheral/media/lvgl_demo/makefile index d1eea10c696e5fe644767b24f2b2945c521cadb2..941abe469ed0be7dc0390def62cecbeba1bb14d9 100644 --- a/example/peripheral/media/lvgl_demo/makefile +++ b/example/peripheral/media/lvgl_demo/makefile @@ -8,7 +8,6 @@ BOOT_IMG_NAME ?= freertos USER_CSRC := main.c USER_CSRC += $(wildcard src/*.c) -USER_CSRC += $(wildcard ../common/*.c) USER_ASRC := USER_CXXSRC := diff --git a/example/peripheral/media/lvgl_demo/src/cmd.c b/example/peripheral/media/lvgl_demo/src/cmd.c index 477a51d068dbab60a73f7819298f4c310314a335..42d7358991538197e8e800bff7cc828193e440b4 100644 --- a/example/peripheral/media/lvgl_demo/src/cmd.c +++ b/example/peripheral/media/lvgl_demo/src/cmd.c @@ -29,15 +29,7 @@ #include "FreeRTOS.h" #include "../src/shell.h" -#include "fdc_common_hw.h" -#include "fdcdp.h" -#include "fdp_hw.h" - -#include "lv_port_disp.h" -#include "lv_obj.h" -#include "lv_conf.h" #include "lv_demo_create.h" -#include "lv_demo_test.h" static void FFreeRTOSMediaCmdUsage(void) { diff --git a/example/peripheral/media/lvgl_indev/README.md b/example/peripheral/media/lvgl_indev/README.md index 3e5700c9404d8236ed28971f057e9664c64c5d82..2aed5da31ffdd1e3da275775d5d32212e4611819 100644 --- a/example/peripheral/media/lvgl_indev/README.md +++ b/example/peripheral/media/lvgl_indev/README.md @@ -7,7 +7,7 @@ DC 是一个显示控制器,主要完成将 CPU/GPU/VPU 处理后的图像数据,按照 Display 协议处理后送给 DP PHY 接入显示器。 本司E2000系列型号芯片采用DisplayPort1.4协议,兼容 DisplayPort1.4/Embedded DisplayPort1.3 协议。 -本例程主要展示本司E2000系列芯片DC显示驱动功能以及驱动外设的能力,当前支持的设备有鼠标以及键盘 +本例程主要展示本司E2000系列以及phytiumpi芯片DC显示驱动功能以及驱动外设的能力,当前支持的设备有鼠标以及键盘 本例程支持的cmd包括 @@ -22,7 +22,7 @@ DC 是一个显示控制器,主要完成将 CPU/GPU/VPU 处理后的图像数 本例程需要用到 -- Phytium开发板(E2000Q,E2000D) +- Phytium开发板(E2000Q,E2000D, Phytiumpi) - 显示器及连接线 - [Phytium Standalone SDK](https://gitee.com/phytium_embedded/phytium-standalone-sdk) @@ -76,8 +76,6 @@ make image - 在host侧完成构建 -目前在menuconfig中支持配置色深,色深设置为32,其余设置值为third-party/lvgl-8.3/lv_conf.c设置默认值 - 在使用过程中, 使用者可根据实际硬件情况以及需要,在third-party/lvgl-8.3/lv_conf.c中进行相应组件配置。 #### 2.3.2 下载过程 @@ -108,18 +106,9 @@ bootelf -p 0x90100000 初始化DP: -Media init 2 640 480 2 32 60 - -注:此色深32应与lvgl中的色深参数相等,否则可能出现画面填充错位的现象 - -- 2 : 通道号 -- 640 : 宽 -- 480 : 高 -- 2 :模式(克隆,水平,垂直) -- 32 :色深 -- 60 :刷新率 +Media init -![init](fig/media_init.png) +![meida init](fig/media_init.png) 初始化LVGL图形库: diff --git a/example/peripheral/media/lvgl_indev/fig/media_cmd.png b/example/peripheral/media/lvgl_indev/fig/media_cmd.png index e1057d81dfc6612a6b90d90ed80305e3e5c15751..6ec37a9d5aa2ebb6a90c86d747386f60c271b26a 100644 Binary files a/example/peripheral/media/lvgl_indev/fig/media_cmd.png and b/example/peripheral/media/lvgl_indev/fig/media_cmd.png differ diff --git a/example/peripheral/media/lvgl_indev/fig/media_init.png b/example/peripheral/media/lvgl_indev/fig/media_init.png new file mode 100644 index 0000000000000000000000000000000000000000..0792ca495c7230ac66e561b9d266d50d40929ff6 Binary files /dev/null and b/example/peripheral/media/lvgl_indev/fig/media_init.png differ diff --git a/example/peripheral/media/lvgl_indev/src/lv_indev_test.c b/example/peripheral/media/lvgl_indev/src/lv_indev_test.c index faa7a3f4ea9fb4f56d645d1abad30c09b5e53a40..493542eb2376dc3200d559a99ba3e92587eafef4 100644 --- a/example/peripheral/media/lvgl_indev/src/lv_indev_test.c +++ b/example/peripheral/media/lvgl_indev/src/lv_indev_test.c @@ -13,7 +13,7 @@ * * FilePath: lv_indev_test.c * Created Date: 2023-07-06 14:36:43 - * Last Modified: 2024-02-20 15:31:05 + * Last Modified: 2024-05-14 09:35:36 * Description: This file is for config the test * * Modify History: diff --git a/example/peripheral/media/lvgl_ui/README.md b/example/peripheral/media/lvgl_ui/README.md index 579165da3cf155695fc30f16f9515922baa5b14d..a02d4f7594528d3f6134e8ce494c9a37a3b32a57 100644 --- a/example/peripheral/media/lvgl_ui/README.md +++ b/example/peripheral/media/lvgl_ui/README.md @@ -19,7 +19,7 @@ LVGL (Light and Versatile Graphics Library) 是最流行的免费开源嵌入式 本例程需要用到 -- Phytium开发板(E2000Q,E2000D) +- Phytium开发板(E2000Q, E2000D, Phytiumpi) - 显示器及连接线 - [Phytium Standalone SDK](https://gitee.com/phytium_embedded/phytium-standalone-sdk) @@ -105,18 +105,9 @@ bootelf -p 0x90100000 初始化DP: -Media init 2 800 600 2 32 60 +Media init -注:此色深32应与lvgl中的色深参数相等,否则可能出现画面填充错位的现象 - -- 2 : 通道号 -- 800 : 宽 -- 600 : 高 -- 2 :模式(克隆,水平,垂直) -- 32 :色深 -- 60 :刷新率 - -![init](fig/media_init.png) +![meidia_init](fig/media_init.png) 初始化LVGL图形库: diff --git a/example/peripheral/media/lvgl_ui/fig/media_cmd.png b/example/peripheral/media/lvgl_ui/fig/media_cmd.png index e1057d81dfc6612a6b90d90ed80305e3e5c15751..6ec37a9d5aa2ebb6a90c86d747386f60c271b26a 100644 Binary files a/example/peripheral/media/lvgl_ui/fig/media_cmd.png and b/example/peripheral/media/lvgl_ui/fig/media_cmd.png differ diff --git a/example/peripheral/media/lvgl_ui/fig/media_init.png b/example/peripheral/media/lvgl_ui/fig/media_init.png new file mode 100644 index 0000000000000000000000000000000000000000..bc773592011eb40f919ae530fef3ffbebd44ded3 Binary files /dev/null and b/example/peripheral/media/lvgl_ui/fig/media_init.png differ diff --git a/example/peripheral/media/lvgl_ui/src/lv_indev_test.c b/example/peripheral/media/lvgl_ui/src/lv_indev_test.c index 6f662a307ffcad42516803780e55130084233e81..16c4d47042ec367d7704edf157ca46ce7cbca0aa 100644 --- a/example/peripheral/media/lvgl_ui/src/lv_indev_test.c +++ b/example/peripheral/media/lvgl_ui/src/lv_indev_test.c @@ -13,7 +13,7 @@ * * FilePath: lv_indev_test.c * Created Date: 2023-07-06 14:36:43 - * Last Modified: 2024-02-21 09:57:09 + * Last Modified: 2024-05-14 09:35:32 * Description: This file is for config the test * * Modify History: diff --git a/example/peripheral/media/media_test/README.md b/example/peripheral/media/media_test/README.md index 787d0be260966085d9488d6e0c65fe16bf94ab84..4554d4a34fe5a6cf2e1aaea4d264735638c0696a 100644 --- a/example/peripheral/media/media_test/README.md +++ b/example/peripheral/media/media_test/README.md @@ -7,7 +7,7 @@ DC 是一个显示控制器,主要完成将 CPU/GPU/VPU 处理后的图像数据,按照 Display 协议处理后送给 DP PHY 接入显示器。 本司E2000系列型号芯片采用DisplayPort1.4协议,兼容 DisplayPort1.4/Embedded DisplayPort1.3 协议。 -本例程主要展示本司E2000系列芯片DC显示驱动功能。 +本例程主要展示本司E2000系列以及phytiumpi芯片DC显示驱动功能。 本例程example主要是测试驱动能否正常点亮屏幕。 @@ -24,7 +24,7 @@ DC 是一个显示控制器,主要完成将 CPU/GPU/VPU 处理后的图像数 本例程需要用到 -- Phytium开发板(E2000Q,E2000D) +- Phytium开发板(E2000Q,E2000D,Phytiumpi) - 显示器及连接线 - [Phytium Standalone SDK](https://gitee.com/phytium_embedded/phytium-standalone-sdk) @@ -107,16 +107,7 @@ bootelf -p 0x90100000 初始化DP: -Media init 2 640 480 2 32 60 - -注:此色深32应与lvgl中的色深参数相等,否则可能出现画面填充错位的现象 - -- 2 : 通道号 -- 640 : 宽 -- 480 : 高 -- 2 :模式(克隆,水平,垂直) -- 32 :色深 -- 60 :刷新率 +Media init 演示一个demo: diff --git a/example/peripheral/pwm/README.md b/example/peripheral/pwm/README.md index 7924b0bf142b87786cc931325ddb4cc553a4292e..4c6dac87439b05bb352968ddc3d15807eed4a4b9 100644 --- a/example/peripheral/pwm/README.md +++ b/example/peripheral/pwm/README.md @@ -44,7 +44,7 @@ PWM双通道测试例程 (pwm_dual_channel_example.c) ### 2.1.1 E2000 - E2000 demo板需外接逻辑分析仪或示波器测试,方法如下 -- 选择控制器PWM6的pwm12_dat_out(CHANNEL0)作为输出,对应开发板上J30引脚7 +- 选择控制器PWM2的pwm5_dat_out(CHANNEL1)作为输出,对应开发板上J30引脚3 ![e2000_pwm](./figs/e2000_pwm.png) @@ -161,8 +161,4 @@ pwm双通道测试对应波形 - PWM死区测试例程中,`PWM_TEST_CHANNEL`决定死区输入源,另一个CHANNEL作为输出源。 - E2000 DEMO V0.8板无法使用PWM4至PWM7,故无法进行本用例 -## 4. 修改历史记录 - - - - +## 4. 修改历史记录 \ No newline at end of file diff --git a/example/peripheral/pwm/inc/pwm_example.h b/example/peripheral/pwm/inc/pwm_example.h index 215320c8530f1087e93d736f699494e519e113f3..cbbffd3398a636503ee81eb0d184057d65ab090e 100644 --- a/example/peripheral/pwm/inc/pwm_example.h +++ b/example/peripheral/pwm/inc/pwm_example.h @@ -34,8 +34,8 @@ extern "C" /************************** Constant Definitions *****************************/ #if defined(CONFIG_E2000Q_DEMO_BOARD)||defined(CONFIG_E2000D_DEMO_BOARD) -#define PWM_TEST_ID FPWM6_ID -#define PWM_TEST_CHANNEL FPWM_CHANNEL_0 +#define PWM_TEST_ID FPWM2_ID +#define PWM_TEST_CHANNEL FPWM_CHANNEL_1 #elif defined(CONFIG_FIREFLY_DEMO_BOARD) #define PWM_TEST_ID FPWM4_ID #define PWM_TEST_CHANNEL FPWM_CHANNEL_0 diff --git a/example/storage/fatfs/src/fatfs_examples.c b/example/storage/fatfs/src/fatfs_examples.c index 861a449cc5d3c362833799d69ce7db63b40d0d2c..04d290a3a1e4365518b28f8d4a3a41a89757c2d4 100644 --- a/example/storage/fatfs/src/fatfs_examples.c +++ b/example/storage/fatfs/src/fatfs_examples.c @@ -42,10 +42,13 @@ /************************** Constant Definitions *****************************/ #define FATFS_EVT_INIT_DONE (0x1 << 0) #define FATFS_EVT_CYC_TEST_DONE (0x1 << 1) + +/*The macro WR_SECTOR, RAM_WR_SECTOR, CYCLE_TIMES affects the test time. +*If you want to increase the macro value, increase WAIT_TIMEOUT as well*/ #define WR_SECTOR 3000U #define RAM_WR_SECTOR 300000U - -#define WAIT_TIMEOUT 1800000U +#define CYCLE_TIMES 1 +#define WAIT_TIMEOUT pdMS_TO_TICKS(3000000U) /************************** Variable Definitions *****************************/ static const char *mount_points[FFREERTOS_DISK_TYPE_NUM] = { @@ -304,7 +307,7 @@ static FRESULT FatfsCycleTest(void) FRESULT fr = FR_OK; #ifdef CONFIG_FATFS_RAM_DISK printf("\r\n========Cycle test for RAM Disk=================\r\n"); - fr = ff_cycle_test(mount_points[FFREERTOS_FATFS_RAM_DISK], 3); + fr = ff_cycle_test(mount_points[FFREERTOS_FATFS_RAM_DISK], CYCLE_TIMES); if (FR_OK != fr) { FF_ERROR("RAM cycle test failed, err = %d.", fr); @@ -314,7 +317,7 @@ static FRESULT FatfsCycleTest(void) #ifdef CONFIG_FATFS_SDMMC_FSDIF_TF printf("\r\n========Cycle test for TF Disk=================\r\n"); - fr = ff_cycle_test(mount_points[FFREERTOS_FATFS_TF_CARD], 3); + fr = ff_cycle_test(mount_points[FFREERTOS_FATFS_TF_CARD], CYCLE_TIMES); if (FR_OK != fr) { FF_ERROR("TF cycle test failed, err = %d.", fr); @@ -324,7 +327,7 @@ static FRESULT FatfsCycleTest(void) #ifdef CONFIG_FATFS_SDMMC_FSDIF_EMMC printf("\r\n========Cycle test for SDIO Disk=================\r\n"); - fr = ff_cycle_test(mount_points[FFREERTOS_FATFS_EMMC_CARD], 3); + fr = ff_cycle_test(mount_points[FFREERTOS_FATFS_EMMC_CARD], CYCLE_TIMES); if (FR_OK != fr) { FF_ERROR("SDIO cycle test failed, err = %d.", fr); @@ -335,7 +338,7 @@ static FRESULT FatfsCycleTest(void) #ifdef CONFIG_FATFS_USB printf("\r\n========Cycle test for USB Disk=================\r\n"); - fr = ff_cycle_test(mount_points[FFREERTOS_FATFS_USB_DISK], 3); + fr = ff_cycle_test(mount_points[FFREERTOS_FATFS_USB_DISK], CYCLE_TIMES); if (FR_OK != fr) { FF_ERROR("USB cycle test failed, err = %d.", fr); @@ -345,7 +348,7 @@ static FRESULT FatfsCycleTest(void) #ifdef CONFIG_FATFS_FSATA printf("\r\n========Cycle test for SATA Disk=================\r\n"); - fr = ff_cycle_test(mount_points[FFREERTOS_FATFS_SATA_DISK], 3); + fr = ff_cycle_test(mount_points[FFREERTOS_FATFS_SATA_DISK], CYCLE_TIMES); if (FR_OK != fr) { FF_ERROR("SATA cycle test failed, err = %d.", fr); @@ -355,7 +358,7 @@ static FRESULT FatfsCycleTest(void) #ifdef CONFIG_FATFS_FSATA_PCIE printf("\r\n========Cycle test for SATA PCIE Disk=================\r\n"); - fr = ff_cycle_test(mount_points[FFREERTOS_FATFS_SATA_PCIE_DISK], 3); + fr = ff_cycle_test(mount_points[FFREERTOS_FATFS_SATA_PCIE_DISK], CYCLE_TIMES); if (FR_OK != fr) { FF_ERROR("SATA pcie cycle test failed, err = %d.", fr); @@ -405,8 +408,8 @@ task_ret: BaseType_t FFreeRTOSFatfsTest(void) { BaseType_t ret = pdPASS; - int task_ret = FR_OK; - xQueue = xQueueCreate(1,sizeof(int)); + FRESULT task_ret = FR_OK; + xQueue = xQueueCreate(1, sizeof(FRESULT)); ret = xTaskCreate((TaskFunction_t)FatfsRunTask, (const char *)"FatfsRunTask", diff --git a/example/system/amp/openamp/README.md b/example/system/amp/openamp/README.md index 58536280e63f5160963d6fea3046ca9e5e7eed5b..6a1913718ed545e6b859210cd9c14daa87b4b4ec 100644 --- a/example/system/amp/openamp/README.md +++ b/example/system/amp/openamp/README.md @@ -156,9 +156,9 @@ device_core 的 elf 文件加载地址需要修改为 0xe0100000 : 1. 在编译环境下,切换至 phytium-free-rtos-sdk/example/system/amp/openamp 目录 1.1 输入 'make config_e2000d_aarch32' 加载默认配置信息 1.2 输入 'make clean' 清理 ./driver_core ./device_core 下的编译结果 - 1.3 输入 'make image' 编译driver_core / device_core 代码,并且生成对应的elf 文件 + 1.3 输入 'make image' 编译driver_core / device_core 代码,生成对应的elf 文件,并拷贝至 tftp 目录下 1.4 先将 ./driver_core/makefile 与 ./device_core/makefile 中 的 USR_BOOT_DIR 修改为您的 tftp 所覆盖的目录 - 1.5 输入 'make boot' 将生成的elf 拷贝至 tftp 的目录下 + 2. 使用串口连接E2000开发板 ,并且打开串口终端工具 2.1 复位开发板之后,将E2000开发板的网络与tftp 服务器在同一局域网中 2.2 在板子串口终端工具下输入以下命令 @@ -189,9 +189,9 @@ device_core 的 elf 文件加载地址需要修改为 0xe0100000 : 1. 在编译环境下,切换至 phytium-standalone-sdk/example/system/amp/openamp 目录 1.1 输入 'make config_e2000d_aarch64' 加载默认配置信息 1.2 输入 'make clean' 清理 ./driver_core ./device_core 下的编译结果 - 1.3 输入 'make image' 编译driver_core / device_core 代码,并且生成对应的elf 文件 + 1.3 输入 'make image' 编译driver_core / device_core 代码,生成对应的elf 文件,并拷贝至 tftp 目录下 1.4 先将 ./driver_core/makefile 与 ./device_core/makefile 中 的 USR_BOOT_DIR 修改为您的tftp 所覆盖的目录 - 1.5 输入 'make boot' 将生成的elf 拷贝至 tftp 的目录下 + 2. 使用串口连接E2000开发板 ,并且打开串口终端工具 2.1 复位开发板之后,将E2000开发板的网络与tftp 服务器在同一局域网中 2.2 在板子串口终端工具下输入以下命令 diff --git a/example/system/nested_interrupt/src/nested_interrupt.c b/example/system/nested_interrupt/src/nested_interrupt.c index d90e59b6a60eb022b2cd778332a56b95bd67ae06..019d6f9b57b3ab8b0e76fad0f428d460da15740e 100644 --- a/example/system/nested_interrupt/src/nested_interrupt.c +++ b/example/system/nested_interrupt/src/nested_interrupt.c @@ -167,7 +167,7 @@ void NestedIntrTask(void) prvSetupSoftwareNestedInterrupt(); vNestedPeriod(); /*取1E-6精度下比较计算结果,此精度可修改*/ - if (fabs(val_low - VAL_LOW_CALC_RES) <= 1E-6 || fabs(val_high - VAL_HIGH_CALC_RES) <= 1E-6) + if (fabs(val_low - VAL_LOW_CALC_RES) >= 1E-6 || fabs(val_high - VAL_HIGH_CALC_RES) >= 1E-6) { task_res = NESTED_INTR_TEST_FAILURE; } diff --git a/install.py b/install.py index 6b303200767fb04e281934a304e9d6b05d3ee542..946be44cb3c4d1abe3f431f821d2daa52d08b336 100755 --- a/install.py +++ b/install.py @@ -36,12 +36,12 @@ freertos_sdk_path = install_path print("Standalone SDK at {}".format(freertos_sdk_path)) # Add standalone sdk -standalone_sdk_v="b37fd3196b7890e5c90255d2dfa5c8d7a55a4828" +standalone_sdk_v="2c7372083baba48fd0694b34ff0c8b6fc3bce6b7" if (install_platform == windows_x64): standalone_path=freertos_sdk_path + '\\standalone' else: standalone_path=freertos_sdk_path + '/standalone' -standalone_branch="master" +standalone_branch="release_v1.3.1" standalone_remote="https://gitee.com/phytium_embedded/phytium-standalone-sdk.git" if not os.path.exists(standalone_path):