完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
你好,
我正在我的电路板上写一个测试程序(xpc56xx evb主板),我希望通过UART编号和文本字符串在终端上接收。当我在串行终端(RealTerm)上获取数据时,我收到了正确的字符串('测试程序启动')但不是变量的值(pcval1,pcval2,pcval3)。 (见截图)。 这是我的代码:#include'component.h' uint32_t volatile * pcval; uint32_t volatile cval; uint32_t volatile * pointer1; uint32_t volatile * pw; uint32_t volatile w = 0x000FFF; uint32_t volatile giri1,giri2,giri3; / * *申请入境点。 * / int main(void){/ *按照指定的顺序初始化所有导入的组件 应用程序向导。该功能自动生成。* / componentsInit(); giri1 = 00000001; giri2 = 0x00000002; giri3 = 0x00000003; / * *使用驱动程序默认配置激活串行驱动程序1。 * / sdStart(& SD1,NULL); / *应用程序主循环。* / 而(1){ 未签名的我; osalThreadSleepMilliseconds(100); osalThreadSleepMilliseconds(100); osalThreadSleepMilliseconds(100); osalThreadSleepMilliseconds(100); chnWriteTimeout(& SD1,(uint8_t *)'测试程序开始 r n',20,TIME_INFINITE); chnWriteTimeout(& SD1,(uint8_t *)'测试程序开始 r n',20,TIME_INFINITE); giri1 = giri1 + 1; pcval =安培; giri1; chnWriteTimeout(& SD1,(uint8_t *)pcval,4,TIME_INFINITE); giri2 = giri2 + 1; pcval =安培; giri2; chnWriteTimeout(& SD1,(uint8_t *)pcval,4,TIME_INFINITE); giri3 = giri3 + 1; pcval =安培; giri3; chnWriteTimeout(& SD1,(uint8_t *)pcval,4,TIME_INFINITE); chnWriteTimeout(& SD1,(uint8_t *)' r n',2,TIME_INFINITE); } 是否有一个策略,我可以读取正确的值? 先谢谢你! 法比奥 以上来自于谷歌翻译 以下为原文 Hello, I am writing a test program on my board (xpc56xx evb motherboard) and I want to receive on my terminal throught the UART numbers and text strings.When I get the data on my serial terminal (RealTerm) I receive properly the strings ('Test program start') but not the variables' value (pcval1,pcval2,pcval3). (see screenshot). This is my code:#include 'components.h' uint32_t volatile *pcval; uint32_t volatile cval; uint32_t volatile *pointer1; uint32_t volatile *pw; uint32_t volatile w = 0x000FFF;uint32_t volatile giri1,giri2,giri3; /* * Application entry point. */ int main(void) { /* Initialization of all the imported components in the order specified in the application wizard. The function is generated automatically.*/ componentsInit(); giri1=0x00000001; giri2=0x00000002; giri3=0x00000003; /* * Activates the serial driver 1 using the driver default configuration. */ sdStart(&SD1, NULL); /* Application main loop.*/ while (1) { unsigned i; osalThreadSleepMilliseconds(100); osalThreadSleepMilliseconds(100); osalThreadSleepMilliseconds(100); osalThreadSleepMilliseconds(100); chnWriteTimeout(&SD1, (uint8_t *)'Test program startrn', 20, TIME_INFINITE); chnWriteTimeout(&SD1, (uint8_t *)'Test program startrn', 20, TIME_INFINITE); giri1=giri1+1; pcval=&giri1; chnWriteTimeout(&SD1, (uint8_t *)pcval,4,TIME_INFINITE); giri2=giri2+1; pcval=&giri2; chnWriteTimeout(&SD1, (uint8_t *)pcval,4,TIME_INFINITE); giri3=giri3+1; pcval=&giri3; chnWriteTimeout(&SD1, (uint8_t *)pcval,4,TIME_INFINITE); chnWriteTimeout(&SD1, (uint8_t *)'rn',2,TIME_INFINITE); } }is there a strategy with I can read proper values? Thank you in advance! Fabio |
|
相关推荐
2个回答
|
|
你好Fabio,
我认为你使用的是SPC5Studio。 您可以使用输出格式化程序来执行此任务。 (RLA或HAL)最好的问候Erwan 以上来自于谷歌翻译 以下为原文 Hello Fabio , I think that you use SPC5Studio. You can use the Ouput Formatter to perform this task. (RLA or HAL) Best Regards Erwan |
|
|
|
|
|
|
|
只有小组成员才能发言,加入小组>>
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
2649 浏览 1 评论
3213 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
1787 浏览 1 评论
3617 浏览 6 评论
5996 浏览 21 评论
944浏览 4评论
1318浏览 4评论
在Linux上安装Atollic TRUEStudio的步骤有哪些呢?
589浏览 3评论
使用DMA激活某些外设会以导致外设无法工作的方式生成代码是怎么回事
1307浏览 3评论
1367浏览 3评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-28 02:10 , Processed in 1.206724 second(s), Total 82, Slave 63 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号