欢迎光临
我们一直在努力

2.7020 PS 裸机工程建立

1.打开vits后,创建工程

导入PL硬件平台,见其它文章。这里略

2.创建freertos工程

右击,新建freertos

配置freertos:

主要是将tick时间改成1ms一次。

创建应用程序:

输入代码:

/*
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 "FreeRTOS.h"
#include "task.h"
#include "queue.h"
#include "timers.h"
/* Xilinx includes. */
#include "xil_printf.h"
#include "xparameters.h"

/*———————————————————–*/

static void testTask( void *pvParameters );
/*———————————————————–*/

/* The queue used by the Tx and Rx tasks, as described at the top of this
file. */
static TaskHandle_t xTxTask;

char HWstring[15] = "Hello World";

int main( void )
{

xil_printf( "Hello from Freertos example main\\r\\n" );

xTaskCreate( testTask, /* The function that implements the task. */
( const char * ) "testTask", /* 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 );

/* Start the tasks and timer running. */
vTaskStartScheduler();

for( ;; );
}

void testTask( void *pvParameters )
{
for(;;)
{
vTaskDelay(500);
xil_printf( "Hello World\\r\\n");
}

}

编译,运行:

OK。

赞(0)
未经允许不得转载:171主机测评 » 2.7020 PS 裸机工程建立
分享到: 更多 (0)

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址