打印
[DemoCode下载]

半主机测试

[复制链接]
504|4
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
xinpian101|  楼主 | 2017-8-21 20:23 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
TE, se, ge, AC
/****************************************************************************
* [url=home.php?mod=space&uid=288409]@file[/url]     main.c
* [url=home.php?mod=space&uid=895143]@version[/url]  V3.00
* $Revision: 7 $
* $Date: 15/11/02 10:00a $
* [url=home.php?mod=space&uid=247401]@brief[/url]    A sample code to show how to debug with semihost message print.
* @note
* Copyright (C) 2014~2015 Nuvoton Technology Corp. All rights reserved.
*
******************************************************************************/

#include <stdio.h>
#include "NUC123.h"


/*---------------------------------------------------------------------------------------------------------*/
/* Main Function                                                                                            */
/*---------------------------------------------------------------------------------------------------------*/

int32_t main()
{
    int8_t item;

    /*
        To enable semihost, user must define "DEBUG_ENABLE_SEMIHOST" constant when buildind sample code.
        This sample code is used to show how to print message/getchar on IDE debug environment.
        It will echo all input character back on UART #1 of KEIL IDE.

        In KEIL MDK, user need to open "View->Serial Window->UART #1" windows in debug mode.
        In IAR Workbench, user need to open "View->Terminal I/O" in debug mode.

        NOTE1: HardFault_Handler handler is implemented in retarget.c.
        NOTE2: Semihost only works with Nuvoton NuLink ICE Dongle in debug mode.
        NOTE3: It does not print any message if Nuvoton NuLink ICE Dongle is not connected.
    */

    printf("\n Start SEMIHOST test: \n");

    while(1)
    {
        /* Get input character */
        item = getchar();

        /* Print input character back */
        printf("%c\n", item);
    }
}

/*** (C) COPYRIGHT 2014~2015 Nuvoton Technology Corp. ***/




沙发
xinpian101|  楼主 | 2017-8-21 20:23 | 只看该作者
新唐的BSP里面总有这个东西,干啥用的,今天查了百度才略有所懂。

使用特权

评论回复
板凳
天灵灵地灵灵| | 2017-8-21 22:14 | 只看该作者
就是可以直接用这个输入输出的系统函数呗

使用特权

评论回复
地板
捉虫天师| | 2017-8-21 22:35 | 只看该作者
就是在单片机上用标准输入输出函数。

使用特权

评论回复
5
wanduzi| | 2017-8-26 19:19 | 只看该作者
看样子什么都不用配置,直接可以用啊。

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

97

主题

1413

帖子

1

粉丝