From c2c09caab4df6a8cccfe675c79910efd7808ccd5 Mon Sep 17 00:00:00 2001 From: zhugengyu Date: Wed, 7 Jul 2021 15:02:45 +0800 Subject: [PATCH 1/7] support make install --- Makefile | 42 +++++++++++++++++++ example/ft2004_aarch32_start_up/sdkconfig | 1 + example/ft2004_aarch32_start_up/sdkconfig.old | 4 +- install_offline.sh | 19 +++++++++ install_online.sh | 18 ++++++++ 5 files changed, 82 insertions(+), 2 deletions(-) create mode 100644 Makefile create mode 100644 install_offline.sh create mode 100644 install_online.sh diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..64a51247 --- /dev/null +++ b/Makefile @@ -0,0 +1,42 @@ +PROFILE_PATH ?= ~/.profile +FREERTOS_ROOT ?= $(shell pwd) +STANDALONE_PATH ?= ./standalone-sdk +STANDALONE_SDK_V ?= v0.0.2 +FREERTOS_SDK_V ?= v0.0.1 +STANDALONE_GIT ?= https://gitee.com/phytium_embedded/phytium-standalone-sdk.git +A32_CC_PACK ?= $(FREERTOS_ROOT)/tools/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2 +A64_CC_PACK ?= $(FREERTOS_ROOT)/tools/gcc-arm-10.2-2020.11-x86_64-aarch64-none-elf.tar.xz +.PHONY: uninstall install + +setup_standalone: +# 只拉取tag对应的版本,不拉取历史版本 +ifeq ("$(wildcard $(STANDALONE_PATH))", "$(STANDALONE_PATH)") + @echo ++++++Standalone SDK Already Installed !!! +else + git clone -b $(STANDALONE_SDK_V) --depth=1 \ + $(STANDALONE_GIT) $(STANDALONE_PATH) +endif +# 离线安装---复制编译器安装包 +ifneq ( $(MAKECMDGOALS),install_online) +ifeq ("$(wildcard $(A32_CC_PACK))", "$(A32_CC_PACK)") + @cp $(A32_CC_PACK) $(STANDALONE_PATH)/tools + @echo ++++++Copy $(A32_CC_PACK) to $(STANDALONE_PATH)/tools +else + $(error error, ******Please Put $(A32_CC_PACK) first!!) +endif + +ifeq ("$(wildcard $(A64_CC_PACK))", "$(A64_CC_PACK)") + @cp $(A64_CC_PACK) $(STANDALONE_PATH)/tools + @echo ++++++Copy $(A64_CC_PACK) to $(STANDALONE_PATH)/tools +else + $(error error, ******Please Put $(A64_CC_PACK) first!!) +endif +endif + +uninstall: + +install_online: + ./install_online.sh + +install_offline: + ./install_offline.sh \ No newline at end of file diff --git a/example/ft2004_aarch32_start_up/sdkconfig b/example/ft2004_aarch32_start_up/sdkconfig index 7c4a5212..f510e1dc 100644 --- a/example/ft2004_aarch32_start_up/sdkconfig +++ b/example/ft2004_aarch32_start_up/sdkconfig @@ -67,6 +67,7 @@ CONFIG_E2000_FT2004_AARCH32_RAM_LD=y # CONFIG_LOG_INFO is not set # CONFIG_LOG_WARN is not set CONFIG_LOG_ERROR=y +# CONFIG_LOG_NONE is not set # end of Common Configuration # diff --git a/example/ft2004_aarch32_start_up/sdkconfig.old b/example/ft2004_aarch32_start_up/sdkconfig.old index 51f39b15..7c4a5212 100644 --- a/example/ft2004_aarch32_start_up/sdkconfig.old +++ b/example/ft2004_aarch32_start_up/sdkconfig.old @@ -7,9 +7,9 @@ # FT2000-4 AARCH32 FreeRTOS Configuration # CONFIG_TARGET_NAME="ft2004_freertos" -CONFIG_DEMO_HELLO_WORLD=y +# CONFIG_DEMO_HELLO_WORLD is not set # CONFIG_DEMO_GET_CPU_STATS is not set -# CONFIG_DEMO_MSG_QUEUE is not set +CONFIG_DEMO_MSG_QUEUE=y # CONFIG_DEMO_SEMAPHORE is not set # end of FT2000-4 AARCH32 FreeRTOS Configuration # end of Project Configuration diff --git a/install_offline.sh b/install_offline.sh new file mode 100644 index 00000000..1cf0bf13 --- /dev/null +++ b/install_offline.sh @@ -0,0 +1,19 @@ +### + # @ : Copyright (c) 2021 Phytium Information Technology, Inc. + # + # SPDX-License-Identifier: Apache-2.0. + # + # @Date: 2021-07-07 14:13:43 + # @LastEditTime: 2021-07-07 14:43:03 + # @Description:  This files is for + # + # @Modify History: + # Ver   Who        Date         Changes + # ----- ------     --------    -------------------------------------- +### +#!/bin/sh + +make setup_standalone -s +cd ./standalone-sdk +make install_offline -s +cd ../ \ No newline at end of file diff --git a/install_online.sh b/install_online.sh new file mode 100644 index 00000000..454fcc0e --- /dev/null +++ b/install_online.sh @@ -0,0 +1,18 @@ +### + # @ : Copyright (c) 2021 Phytium Information Technology, Inc. + # + # SPDX-License-Identifier: Apache-2.0. + # + # @Date: 2021-07-07 14:13:32 + # @LastEditTime: 2021-07-07 14:40:11 + # @Description:  This files is for + # + # @Modify History: + # Ver   Who        Date         Changes + # ----- ------     --------    -------------------------------------- +### + +make setup_standalone -s +cd ./standalone-sdk +make install_online -s +cd ../ \ No newline at end of file -- Gitee From 00b3008d342c966d5cdf233f00c9fc3a5016075c Mon Sep 17 00:00:00 2001 From: zhugengyu Date: Wed, 7 Jul 2021 15:43:39 +0800 Subject: [PATCH 2/7] ignore sdkconfig.old --- .gitignore | 1 + Makefile | 6 +++++- install_offline.sh | 3 ++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 678a55cd..0bbdfd82 100644 --- a/.gitignore +++ b/.gitignore @@ -46,6 +46,7 @@ app* *.su *.idb *.pdb +*.old # Kernel Module Compile Results *.mod* diff --git a/Makefile b/Makefile index 64a51247..40a49439 100644 --- a/Makefile +++ b/Makefile @@ -16,10 +16,12 @@ else git clone -b $(STANDALONE_SDK_V) --depth=1 \ $(STANDALONE_GIT) $(STANDALONE_PATH) endif + +offline_cp: # 离线安装---复制编译器安装包 ifneq ( $(MAKECMDGOALS),install_online) ifeq ("$(wildcard $(A32_CC_PACK))", "$(A32_CC_PACK)") - @cp $(A32_CC_PACK) $(STANDALONE_PATH)/tools + @cp $(A32_CC_PACK) $(STANDALONE_PATH)/tools -f @echo ++++++Copy $(A32_CC_PACK) to $(STANDALONE_PATH)/tools else $(error error, ******Please Put $(A32_CC_PACK) first!!) @@ -36,7 +38,9 @@ endif uninstall: install_online: + @chmod +x ./install_online.sh ./install_online.sh install_offline: + @chmod +x ./install_offline.sh ./install_offline.sh \ No newline at end of file diff --git a/install_offline.sh b/install_offline.sh index 1cf0bf13..7fc6dfb0 100644 --- a/install_offline.sh +++ b/install_offline.sh @@ -4,7 +4,7 @@ # SPDX-License-Identifier: Apache-2.0. # # @Date: 2021-07-07 14:13:43 - # @LastEditTime: 2021-07-07 14:43:03 + # @LastEditTime: 2021-07-07 15:31:33 # @Description:  This files is for # # @Modify History: @@ -14,6 +14,7 @@ #!/bin/sh make setup_standalone -s +make offline_cp -s cd ./standalone-sdk make install_offline -s cd ../ \ No newline at end of file -- Gitee From 11cb92b6fe26e315df80e4f3971be1b2ac0e63c7 Mon Sep 17 00:00:00 2001 From: zhugengyu Date: Wed, 7 Jul 2021 16:58:08 +0800 Subject: [PATCH 3/7] add hello world example to demo freertos task schedule --- README.md | 6 +- example/ft2004_aarch32_hello_world/Kconfig | 19 ++ example/ft2004_aarch32_hello_world/Makefile | 8 + example/ft2004_aarch32_hello_world/Readme.md | 53 ++++++ .../ft2004_configs.c | 108 +++++++++++ example/ft2004_aarch32_hello_world/main.c | 170 ++++++++++++++++++ example/ft2004_aarch32_hello_world/sdkconfig | 117 ++++++++++++ .../ft2004_aarch32_hello_world/sdkconfig.h | 18 ++ 8 files changed, 496 insertions(+), 3 deletions(-) create mode 100644 example/ft2004_aarch32_hello_world/Kconfig create mode 100644 example/ft2004_aarch32_hello_world/Makefile create mode 100644 example/ft2004_aarch32_hello_world/Readme.md create mode 100644 example/ft2004_aarch32_hello_world/ft2004_configs.c create mode 100644 example/ft2004_aarch32_hello_world/main.c create mode 100644 example/ft2004_aarch32_hello_world/sdkconfig create mode 100644 example/ft2004_aarch32_hello_world/sdkconfig.h diff --git a/README.md b/README.md index cf7f5f65..48a49a00 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0. * * @Date: 2021-06-30 10:35:37 - * @LastEditTime: 2021-07-06 09:15:37 + * @LastEditTime: 2021-07-07 15:48:56 * @Description:  This files is for * * @Modify History: @@ -28,7 +28,7 @@ $ cd ~/freertos_sdk - 在线下载源代码和编译环境,完成FreeRTOS SDK安装 ``` -$ ./export.sh -online +$ make install_online ``` ### 2.2. 选择离线方式安装SDK @@ -41,7 +41,7 @@ $ ./export.sh -online - 将AARCH32、AARCH64编译器压缩包放置在'~/freertos_sd/tools'(必须放置在tools路径下) - 完成FreeRTOS SDK安装 ``` -$ ./export.sh +$ make install_offline ``` - **通过离线/在线方式完成安装后,关闭当前窗口或者运行以下命令,立即生效SDK环境变量** diff --git a/example/ft2004_aarch32_hello_world/Kconfig b/example/ft2004_aarch32_hello_world/Kconfig new file mode 100644 index 00000000..d18205c6 --- /dev/null +++ b/example/ft2004_aarch32_hello_world/Kconfig @@ -0,0 +1,19 @@ +# +# For a description of the syntax of this configuration file, +# see tools/kconfiglib/kconfig-language.txt. +# + +mainmenu "Phytium FreeRTOS SDK Configuration" + + menu "Project Configuration" + menu "FT2000-4 AARCH32 FreeRTOS Configuration" + + config TARGET_NAME + string "Build Target Name" + default "ft2004_freertos" + help + Build Target name for the demo + endmenu + endmenu +source "$(FREERTOS_SDK_ROOT)/Kconfig" + diff --git a/example/ft2004_aarch32_hello_world/Makefile b/example/ft2004_aarch32_hello_world/Makefile new file mode 100644 index 00000000..3cdf1da2 --- /dev/null +++ b/example/ft2004_aarch32_hello_world/Makefile @@ -0,0 +1,8 @@ +export PROJECT_DIR ?= . + +# prepare output dir and start make +include $(FREERTOS_SDK_ROOT)/make/build.mk + +boot: + make + @cp ./$(CONFIG_TARGET_NAME).bin /mnt/d/tftboot/ \ No newline at end of file diff --git a/example/ft2004_aarch32_hello_world/Readme.md b/example/ft2004_aarch32_hello_world/Readme.md new file mode 100644 index 00000000..d48b4f42 --- /dev/null +++ b/example/ft2004_aarch32_hello_world/Readme.md @@ -0,0 +1,53 @@ + + +# host侧设置 +- 重启host侧tftp服务器 +``` +sudo service tftpd-hpa restart +``` + +# 开发板侧设置 + +## 使用go命令跳转 +- 关闭D-cache和I-cache +``` +icache off +dcache off +``` + +- 下载新版本到FT2000-4 +``` +setenv ipaddr 192.168.4.20 +setenv serverip 192.168.4.50 +setenv gatewayip 192.168.4.1 +tftpboot 80100000 ft2004_freertos.bin +icache off +dcache off +go 0x80100000 +``` + +``` +tftpboot 80100000 ft2004_test_irq.bin +``` + +## 使用bootvx32命令跳转 +- 下载新版本到FT2000-4 +``` +setenv ipaddr 192.168.4.20 +setenv serverip 192.168.4.50 +setenv gatewayip 192.168.4.1 +tftpboot 80100000 ft2004_baremetal.bin +bootvx32 +``` \ No newline at end of file diff --git a/example/ft2004_aarch32_hello_world/ft2004_configs.c b/example/ft2004_aarch32_hello_world/ft2004_configs.c new file mode 100644 index 00000000..d0bb0748 --- /dev/null +++ b/example/ft2004_aarch32_hello_world/ft2004_configs.c @@ -0,0 +1,108 @@ +/* + * @ : Copyright (c) 2021 Phytium Information Technology, Inc. + * + * SPDX-License-Identifier: Apache-2.0. + * + * @Date: 2021-07-05 08:35:41 + * @LastEditTime: 2021-07-05 11:35:19 + * @Description:  This files is for + * + * @Modify History: + * Ver   Who        Date         Changes + * ----- ------     --------    -------------------------------------- + */ +#include "FreeRTOS.h" +#include "task.h" +#include "ft_types.h" +#include "parameters.h" +#include "gicv3.h" +#include "generic_timer.h" +#include "interrupt.h" +#include "trap.h" + +void vMainAssertCalled(const char *pcFileName, uint32_t ulLineNumber) +{ + printf("Assert Error is %s : %d \r\n", pcFileName, ulLineNumber); + for (;;) + ; +} + +void vApplicationMallocFailedHook(void) +{ + printf("Malloc Failed\r\n"); + while (1) + ; +} + +void vApplicationTickHook(void) +{ + +} + +void vApplicationIdleHook(void) +{ + +} + +u32 PlatformGetGicDistBase(void) +{ + return GICV3_BASEADDRESS; +} + +static u32 cntfrq; /* System frequency */ + +void vConfigureTickInterrupt(void) +{ + // Disable the timer + Aarch32TimerStop(); + // Get system frequency + cntfrq = Aarch32TimerFrequecy(); + + // Set tick rate + Aarch32TimerCompare(cntfrq / configTICK_RATE_HZ); + Aarch32TimerInterruptEnable(); + + // Set as the lowest priority + InterruptSetPriority(GEN_TIMER_PHYSICAL_NOSECURE_IRQN, configKERNEL_INTERRUPT_PRIORITY); + InterruptUmask(GEN_TIMER_PHYSICAL_NOSECURE_IRQN); + + Aarch32TimerStart(); + printf("tick setup done\r\n"); +} + +void vClearTickInterrupt(void) +{ + Aarch32TimerCompare(cntfrq / configTICK_RATE_HZ); +} + +volatile unsigned int gCpuRuntime; +void vApplicationFPUSafeIRQHandler(uint32_t ulICCIAR) +{ + int ulInterruptID; + + /* Interrupts cannot be re-enabled until the source of the interrupt is + cleared. The ID of the interrupt is obtained by bitwise ANDing the ICCIAR + value with 0x3FF. */ + ulInterruptID = ulICCIAR & 0x3FFUL; + + /* call handler function */ + if (ulInterruptID == 30) + { + /* Generic Timer */ + gCpuRuntime++; + //printf("run time %d\r\n", gCpuRuntime); + FreeRTOS_Tick_Handler(); + } + else + { + printf("\n%s(): IRQ happend (%u)\n", __func__, ulInterruptID); + SystemIrqHandler(ulInterruptID); + } +} + +void InitIrq() +{ + /* interrupt init */ + ArmGicRedistAddressSet(0, GICV3_RD_BASEADDRESS + 0, 0); + InterruptInit(); +} \ No newline at end of file diff --git a/example/ft2004_aarch32_hello_world/main.c b/example/ft2004_aarch32_hello_world/main.c new file mode 100644 index 00000000..47d8792d --- /dev/null +++ b/example/ft2004_aarch32_hello_world/main.c @@ -0,0 +1,170 @@ +/* + Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Copyright (c) 2012 - 2020 Xilinx, Inc. All Rights Reserved. + SPDX-License-Identifier: MIT + + + http://www.FreeRTOS.org + http://aws.amazon.com/freertos + + + 1 tab == 4 spaces! +*/ + +/* FreeRTOS includes. */ +#include +#include "FreeRTOS.h" +#include "task.h" +#include "queue.h" +#include "timers.h" + +#define TIMER_ID 1 +#define DELAY_10_SECONDS 10000UL +#define DELAY_1_SECOND 1000UL +#define TIMER_CHECK_THRESHOLD 9 +/*-----------------------------------------------------------*/ + +/* The Tx and Rx tasks as described at the top of this file. */ +static void prvTxTask( void *pvParameters ); +static void prvRxTask( void *pvParameters ); +static void vTimerCallback( TimerHandle_t pxTimer ); +/*-----------------------------------------------------------*/ + +/* The queue used by the Tx and Rx tasks, as described at the top of this +file. */ +static TaskHandle_t xTxTask; +static TaskHandle_t xRxTask; +static QueueHandle_t xQueue = NULL; +static TimerHandle_t xTimer = NULL; +char HWstring[15] = "Hello World"; +long RxtaskCntr = 0; + +extern void InitIrq(); +int main( void ) +{ + const TickType_t x10seconds = pdMS_TO_TICKS( DELAY_10_SECONDS ); + + InitIrq(); + printf( "Hello from Freertos example main\r\n" ); + + /* Create the two tasks. The Tx task is given a lower priority than the + Rx task, so the Rx task will leave the Blocked state and pre-empt the Tx + task as soon as the Tx task places an item in the queue. */ + xTaskCreate( prvTxTask, /* The function that implements the task. */ + ( const char * ) "Tx", /* Text name for the task, provided to assist debugging only. */ + configMINIMAL_STACK_SIZE, /* The stack allocated to the task. */ + NULL, /* The task parameter is not used, so set to NULL. */ + tskIDLE_PRIORITY, /* The task runs at the idle priority. */ + &xTxTask ); + + xTaskCreate( prvRxTask, + ( const char * ) "GB", + configMINIMAL_STACK_SIZE, + NULL, + tskIDLE_PRIORITY + 1, + &xRxTask ); + + /* Create the queue used by the tasks. The Rx task has a higher priority + than the Tx task, so will preempt the Tx task and remove values from the + queue as soon as the Tx task writes to the queue - therefore the queue can + never have more than one item in it. */ + xQueue = xQueueCreate( 1, /* There is only one space in the queue. */ + sizeof( HWstring ) ); /* Each space in the queue is large enough to hold a uint32_t. */ + + /* Check the queue was created. */ + configASSERT( xQueue ); + + /* Create a timer with a timer expiry of 10 seconds. The timer would expire + after 10 seconds and the timer call back would get called. In the timer call back + checks are done to ensure that the tasks have been running properly till then. + The tasks are deleted in the timer call back and a message is printed to convey that + the example has run successfully. + The timer expiry is set to 10 seconds and the timer set to not auto reload. */ + xTimer = xTimerCreate( (const char *) "Timer", + x10seconds, + pdFALSE, + (void *) TIMER_ID, + vTimerCallback); + /* Check the timer was created. */ + configASSERT( xTimer ); + + /* start the timer with a block time of 0 ticks. This means as soon + as the schedule starts the timer will start running and will expire after + 10 seconds */ + xTimerStart( xTimer, 0 ); + + /* Start the tasks and timer running. */ + vTaskStartScheduler(); + + /* If all is well, the scheduler will now be running, and the following line + will never be reached. If the following line does execute, then there was + insufficient FreeRTOS heap memory available for the idle and/or timer tasks + to be created. See the memory management section on the FreeRTOS web site + for more details. */ + for( ;; ); +} + + +/*-----------------------------------------------------------*/ +static void prvTxTask( void *pvParameters ) +{ +const TickType_t x1second = pdMS_TO_TICKS( DELAY_1_SECOND ); + + for( ;; ) + { + /* Delay for 1 second. */ + vTaskDelay( x1second ); + + /* Send the next value on the queue. The queue should always be + empty at this point so a block time of 0 is used. */ + xQueueSend( xQueue, /* The queue being written to. */ + HWstring, /* The address of the data being sent. */ + 0UL ); /* The block time. */ + } +} + +/*-----------------------------------------------------------*/ +static void prvRxTask( void *pvParameters ) +{ +char Recdstring[15] = ""; + + for( ;; ) + { + /* Block to wait for data arriving on the queue. */ + xQueueReceive( xQueue, /* The queue being read. */ + Recdstring, /* Data is read into this address. */ + portMAX_DELAY ); /* Wait without a timeout for data. */ + + /* Print the received data. */ + printf( "Rx task received string from Tx task: %s\r\n", Recdstring ); + RxtaskCntr++; + } +} + +/*-----------------------------------------------------------*/ +static void vTimerCallback( TimerHandle_t pxTimer ) +{ + long lTimerId; + configASSERT( pxTimer ); + + lTimerId = ( long ) pvTimerGetTimerID( pxTimer ); + + if (lTimerId != TIMER_ID) { + printf("FreeRTOS Hello World Example FAILED"); + } + + /* If the RxtaskCntr is updated every time the Rx task is called. The + Rx task is called every time the Tx task sends a message. The Tx task + sends a message every 1 second. + The timer expires after 10 seconds. We expect the RxtaskCntr to at least + have a value of 9 (TIMER_CHECK_THRESHOLD) when the timer expires. */ + if (RxtaskCntr >= TIMER_CHECK_THRESHOLD) { + printf("Successfully ran FreeRTOS Hello World Example"); + } else { + printf("FreeRTOS Hello World Example FAILED"); + } + + vTaskDelete( xRxTask ); + vTaskDelete( xTxTask ); +} + diff --git a/example/ft2004_aarch32_hello_world/sdkconfig b/example/ft2004_aarch32_hello_world/sdkconfig new file mode 100644 index 00000000..ca0e3046 --- /dev/null +++ b/example/ft2004_aarch32_hello_world/sdkconfig @@ -0,0 +1,117 @@ + +# +# Project Configuration +# + +# +# FT2000-4 AARCH32 FreeRTOS Configuration +# +CONFIG_TARGET_NAME="ft2004_freertos" +# end of FT2000-4 AARCH32 FreeRTOS Configuration +# end of Project Configuration + +# +# FreeRTOS Setting +# +CONFIG_BUILD_FREERTOS=y +# end of FreeRTOS Setting + +# +# Target Setting +# +CONFIG_TARGET_ARMV8_AARCH32=y +# CONFIG_TARGET_ARMV8_AARCH64 is not set +# CONFIG_TARGET_ARMV7 is not set +CONFIG_TARGET_F2000_4=y +# CONFIG_TARGET_AARCH32_QEMU is not set +# CONFIG_TARGET_AARCH64_QEMU is not set +# CONFIG_TARGET_E2000 is not set +# end of Target Setting + +# +# Building Option +# +CONFIG_ENVI_UBUNTU_20_04=y +# CONFIG_ENVI_WINDOWS10_MINGW is not set + +# +# Cross-Compiler Setting +# +CONFIG_COMPILER_NO_STD_STARUP=y +# CONFIG_USE_EXT_COMPILER is not set +# end of Cross-Compiler Setting + +# +# GNU linker +# +CONFIG_E2000_FT2004_AARCH32_RAM_LD=y +# CONFIG_E2000_FT20004_AARCH64_RAM_LD is not set +# CONFIG_QEMU_AARCH32_RAM_LD is not set +# CONFIG_USER_DEFINED_LD is not set +# end of GNU linker +# end of Building Option + +# +# Board Configuration +# + +# +# Common Configuration +# +# CONFIG_LOG_VERBOS is not set +# CONFIG_LOG_DEBUG is not set +# CONFIG_LOG_INFO is not set +# CONFIG_LOG_WARN is not set +CONFIG_LOG_ERROR=y +# CONFIG_LOG_NONE is not set +# end of Common Configuration + +# +# Components Configuration +# +# CONFIG_USE_SPI is not set +# CONFIG_USE_QSPI is not set +CONFIG_USE_GIC=y + +# +# Gic Configuration +# +CONFIG_EBABLE_GICV3=y +# end of Gic Configuration + +CONFIG_USE_USART=y + +# +# Usart Configuration +# +CONFIG_ENABLE_Pl011_UART=y +# end of Usart Configuration +# end of Components Configuration + +# +# Arch Configuration +# +CONFIG_USE_CACHE=y +CONFIG_USE_L3CACHE=y +CONFIG_USE_MMU=y +# end of Arch Configuration +# end of Board Configuration + +# +# Library Configuration +# +CONFIG_USE_NOSTD_LIBC=y +# CONFIG_USE_LIBC is not set +# end of Library Configuration + +# +# Freertos Drivers +# +CONFIG_FREERTOS_USE_UART=y +# end of Freertos Drivers + +# +# Third-Party Configuration +# +CONFIG_USE_FREERTOS=y +# end of Third-Party Configuration diff --git a/example/ft2004_aarch32_hello_world/sdkconfig.h b/example/ft2004_aarch32_hello_world/sdkconfig.h new file mode 100644 index 00000000..9a13cdb9 --- /dev/null +++ b/example/ft2004_aarch32_hello_world/sdkconfig.h @@ -0,0 +1,18 @@ +#define CONFIG_TARGET_NAME "ft2004_freertos" +#define CONFIG_BUILD_FREERTOS 1 +#define CONFIG_TARGET_ARMV8_AARCH32 1 +#define CONFIG_TARGET_F2000_4 1 +#define CONFIG_ENVI_UBUNTU_20_04 1 +#define CONFIG_COMPILER_NO_STD_STARUP 1 +#define CONFIG_E2000_FT2004_AARCH32_RAM_LD 1 +#define CONFIG_LOG_ERROR 1 +#define CONFIG_USE_GIC 1 +#define CONFIG_EBABLE_GICV3 1 +#define CONFIG_USE_USART 1 +#define CONFIG_ENABLE_Pl011_UART 1 +#define CONFIG_USE_CACHE 1 +#define CONFIG_USE_L3CACHE 1 +#define CONFIG_USE_MMU 1 +#define CONFIG_USE_NOSTD_LIBC 1 +#define CONFIG_FREERTOS_USE_UART 1 +#define CONFIG_USE_FREERTOS 1 -- Gitee From 23be0e793f9666296c7f7d7c893c2e2b9de0108c Mon Sep 17 00:00:00 2001 From: zhugengyu Date: Wed, 7 Jul 2021 16:58:58 +0800 Subject: [PATCH 4/7] remove make install --- Makefile | 46 ---------------------------------------------- install_offline.sh | 20 -------------------- install_online.sh | 18 ------------------ 3 files changed, 84 deletions(-) delete mode 100644 Makefile delete mode 100644 install_offline.sh delete mode 100644 install_online.sh diff --git a/Makefile b/Makefile deleted file mode 100644 index 40a49439..00000000 --- a/Makefile +++ /dev/null @@ -1,46 +0,0 @@ -PROFILE_PATH ?= ~/.profile -FREERTOS_ROOT ?= $(shell pwd) -STANDALONE_PATH ?= ./standalone-sdk -STANDALONE_SDK_V ?= v0.0.2 -FREERTOS_SDK_V ?= v0.0.1 -STANDALONE_GIT ?= https://gitee.com/phytium_embedded/phytium-standalone-sdk.git -A32_CC_PACK ?= $(FREERTOS_ROOT)/tools/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2 -A64_CC_PACK ?= $(FREERTOS_ROOT)/tools/gcc-arm-10.2-2020.11-x86_64-aarch64-none-elf.tar.xz -.PHONY: uninstall install - -setup_standalone: -# 只拉取tag对应的版本,不拉取历史版本 -ifeq ("$(wildcard $(STANDALONE_PATH))", "$(STANDALONE_PATH)") - @echo ++++++Standalone SDK Already Installed !!! -else - git clone -b $(STANDALONE_SDK_V) --depth=1 \ - $(STANDALONE_GIT) $(STANDALONE_PATH) -endif - -offline_cp: -# 离线安装---复制编译器安装包 -ifneq ( $(MAKECMDGOALS),install_online) -ifeq ("$(wildcard $(A32_CC_PACK))", "$(A32_CC_PACK)") - @cp $(A32_CC_PACK) $(STANDALONE_PATH)/tools -f - @echo ++++++Copy $(A32_CC_PACK) to $(STANDALONE_PATH)/tools -else - $(error error, ******Please Put $(A32_CC_PACK) first!!) -endif - -ifeq ("$(wildcard $(A64_CC_PACK))", "$(A64_CC_PACK)") - @cp $(A64_CC_PACK) $(STANDALONE_PATH)/tools - @echo ++++++Copy $(A64_CC_PACK) to $(STANDALONE_PATH)/tools -else - $(error error, ******Please Put $(A64_CC_PACK) first!!) -endif -endif - -uninstall: - -install_online: - @chmod +x ./install_online.sh - ./install_online.sh - -install_offline: - @chmod +x ./install_offline.sh - ./install_offline.sh \ No newline at end of file diff --git a/install_offline.sh b/install_offline.sh deleted file mode 100644 index 7fc6dfb0..00000000 --- a/install_offline.sh +++ /dev/null @@ -1,20 +0,0 @@ -### - # @ : Copyright (c) 2021 Phytium Information Technology, Inc. - # - # SPDX-License-Identifier: Apache-2.0. - # - # @Date: 2021-07-07 14:13:43 - # @LastEditTime: 2021-07-07 15:31:33 - # @Description:  This files is for - # - # @Modify History: - # Ver   Who        Date         Changes - # ----- ------     --------    -------------------------------------- -### -#!/bin/sh - -make setup_standalone -s -make offline_cp -s -cd ./standalone-sdk -make install_offline -s -cd ../ \ No newline at end of file diff --git a/install_online.sh b/install_online.sh deleted file mode 100644 index 454fcc0e..00000000 --- a/install_online.sh +++ /dev/null @@ -1,18 +0,0 @@ -### - # @ : Copyright (c) 2021 Phytium Information Technology, Inc. - # - # SPDX-License-Identifier: Apache-2.0. - # - # @Date: 2021-07-07 14:13:32 - # @LastEditTime: 2021-07-07 14:40:11 - # @Description:  This files is for - # - # @Modify History: - # Ver   Who        Date         Changes - # ----- ------     --------    -------------------------------------- -### - -make setup_standalone -s -cd ./standalone-sdk -make install_online -s -cd ../ \ No newline at end of file -- Gitee From d80278135c178245ddf7417c353b51a92bcf2b75 Mon Sep 17 00:00:00 2001 From: zhugengyu Date: Wed, 7 Jul 2021 17:02:28 +0800 Subject: [PATCH 5/7] rename install script --- README.md | 6 +++--- export.sh | 49 ------------------------------------------------- 2 files changed, 3 insertions(+), 52 deletions(-) delete mode 100644 export.sh diff --git a/README.md b/README.md index 48a49a00..e89b9685 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0. * * @Date: 2021-06-30 10:35:37 - * @LastEditTime: 2021-07-07 15:48:56 + * @LastEditTime: 2021-07-07 17:01:31 * @Description:  This files is for * * @Modify History: @@ -28,7 +28,7 @@ $ cd ~/freertos_sdk - 在线下载源代码和编译环境,完成FreeRTOS SDK安装 ``` -$ make install_online +$ ./install.sh ``` ### 2.2. 选择离线方式安装SDK @@ -41,7 +41,7 @@ $ make install_online - 将AARCH32、AARCH64编译器压缩包放置在'~/freertos_sd/tools'(必须放置在tools路径下) - 完成FreeRTOS SDK安装 ``` -$ make install_offline +$ ./install.sh -online ``` - **通过离线/在线方式完成安装后,关闭当前窗口或者运行以下命令,立即生效SDK环境变量** diff --git a/export.sh b/export.sh deleted file mode 100644 index 7ae7e2d4..00000000 --- a/export.sh +++ /dev/null @@ -1,49 +0,0 @@ -### - # @ : Copyright (c) 2021 Phytium Information Technology, Inc. - # - # SPDX-License-Identifier: Apache-2.0. - # - # @Date: 2021-06-30 15:45:19 - # @LastEditTime: 2021-07-05 16:21:25 - # @Description:  This files is for - # - # @Modify History: - # Ver   Who        Date         Changes - # ----- ------     --------    -------------------------------------- -### -#!/bin/sh -STANDALONE_SDK_V=v0.0.2 -FREERTOS_SDK_V=v0.0.1 - -export FREERTOS_SDK_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -STANDALONE_PATH=$FREERTOS_SDK_ROOT/standalone-sdk - -if [ "$1" = "-online" ]; then - OFFLINE_INSTALL=0 -else - OFFLINE_INSTALL=1 -fi - -if [ ! -d $STANDALONE_PATH ]; then -# 只拉取tag对应的版本,不拉取历史版本 - git clone -b $STANDALONE_SDK_V --depth=1 https://gitee.com/phytium_embedded/phytium-standalone-sdk.git $STANDALONE_PATH -fi - -# copy cc pack to standalone sdk tools path if it's offline install -if [ $OFFLINE_INSTALL = 1 ]; then - cp $FREERTOS_SDK_ROOT/tools/gcc-* $STANDALONE_PATH/tools - $STANDALONE_PATH/export.sh -else - $STANDALONE_PATH/export.sh $1 -fi - -# save freertos sdk root path -PROFILE_PATH=~/.profile - -sed -i '/export FREERTOS_SDK_ROOT=/d' $PROFILE_PATH -echo "export FREERTOS_SDK_ROOT=$FREERTOS_SDK_ROOT" >> $PROFILE_PATH - -source $PROFILE_PATH - -echo "FreeRTOS Path is set as "$FREERTOS_SDK_ROOT -- Gitee From 72178fb581d0a9a1fb82070fcc20c32a3ac17c5c Mon Sep 17 00:00:00 2001 From: zhugengyu Date: Wed, 7 Jul 2021 09:05:11 +0000 Subject: [PATCH 6/7] update README.md. --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index e89b9685..701d2c37 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0. * * @Date: 2021-06-30 10:35:37 - * @LastEditTime: 2021-07-07 17:01:31 + * @LastEditTime: 2021-07-06 09:15:37 * @Description:  This files is for * * @Modify History: @@ -28,7 +28,7 @@ $ cd ~/freertos_sdk - 在线下载源代码和编译环境,完成FreeRTOS SDK安装 ``` -$ ./install.sh +$ ./install.sh -online ``` ### 2.2. 选择离线方式安装SDK @@ -41,7 +41,7 @@ $ ./install.sh - 将AARCH32、AARCH64编译器压缩包放置在'~/freertos_sd/tools'(必须放置在tools路径下) - 完成FreeRTOS SDK安装 ``` -$ ./install.sh -online +$ ./install.sh ``` - **通过离线/在线方式完成安装后,关闭当前窗口或者运行以下命令,立即生效SDK环境变量** @@ -54,7 +54,7 @@ $ source ~/.profile ## 3.1 快速使用例程 ### 3.1.1 使用FT2000-4开发板,启动FreeRTOS ->freertos_sdk/example/ft2004_aarch32_start_up +>freertos_sdk/example/ft2004_aarch32_hello_world - 配置freertos aarch32例程 ``` $ make menuconfig @@ -71,7 +71,7 @@ $ make - 将*.bin通过TFTP服务器烧写到开发板,跳转启动 -![输入图片说明](https://images.gitee.com/uploads/images/2021/0706/155040_d294d992_8736513.png "屏幕截图.png") +![hello world](https://images.gitee.com/uploads/images/2021/0707/170359_b847c982_8736513.png "hello world.png") ## 参考资料 -- Gitee From d8a4498aaf828e2f92d35c57c306ddc1c6c31ac0 Mon Sep 17 00:00:00 2001 From: zhugengyu Date: Wed, 7 Jul 2021 17:13:34 +0800 Subject: [PATCH 7/7] release v0.0.2 --- install.sh | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 install.sh diff --git a/install.sh b/install.sh new file mode 100644 index 00000000..c14322a3 --- /dev/null +++ b/install.sh @@ -0,0 +1,49 @@ +### + # @ : Copyright (c) 2021 Phytium Information Technology, Inc. + # + # SPDX-License-Identifier: Apache-2.0. + # + # @Date: 2021-06-30 15:45:19 + # @LastEditTime: 2021-07-07 17:09:14 + # @Description:  This files is for + # + # @Modify History: + # Ver   Who        Date         Changes + # ----- ------     --------    -------------------------------------- +### +#!/bin/sh +STANDALONE_SDK_V=v0.0.3 +FREERTOS_SDK_V=v0.0.2 + +export FREERTOS_SDK_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +STANDALONE_PATH=$FREERTOS_SDK_ROOT/standalone-sdk + +if [ "$1" = "-online" ]; then + OFFLINE_INSTALL=0 +else + OFFLINE_INSTALL=1 +fi + +if [ ! -d $STANDALONE_PATH ]; then +# 只拉取tag对应的版本,不拉取历史版本 + git clone -b $STANDALONE_SDK_V --depth=1 https://gitee.com/phytium_embedded/phytium-standalone-sdk.git $STANDALONE_PATH +fi + +# copy cc pack to standalone sdk tools path if it's offline install +if [ $OFFLINE_INSTALL = 1 ]; then + cp $FREERTOS_SDK_ROOT/tools/gcc-* $STANDALONE_PATH/tools + $STANDALONE_PATH/install.sh +else + $STANDALONE_PATH/install.sh $1 +fi + +# save freertos sdk root path +PROFILE_PATH=~/.profile + +sed -i '/export FREERTOS_SDK_ROOT=/d' $PROFILE_PATH +echo "export FREERTOS_SDK_ROOT=$FREERTOS_SDK_ROOT" >> $PROFILE_PATH + +source $PROFILE_PATH + +echo "FreeRTOS Path is set as "$FREERTOS_SDK_ROOT -- Gitee