Part Number:CC2640R2FOther Parts Discussed in Thread:SYSBIOS
我使用例程 uartecho_CC2640R2_LAUNCHXL_tirtos_ccs 来测试串口通讯,这是部分源代码uartecheo.c未修改,实验结果正常。
然后我打开了例程 hello_CC2640R2_LAUNCHXL_tirtos_ccs,修改了hello.c,如下,就是将上面的代码照抄下来,但是实验结果却不正确,
原本应该打印两遍,却只有一遍,后面的代码也没有执行。
Kevin Qiu1:
debug单步运行看一下能否执行到第二个UART_write
,
YiKai Chen:
我這邊打印幾次都沒有問題,我用的SDK是5.30.00.03,請問你測試的SDK版本是?
,
YUN:
uarteco例程确实没有问题,问题是我把代码改写到了另外的例程里面,hello_CC2640R2_LAUNCHXL_tirtos_ccs,修改了hello.c有问题
,
YiKai Chen:
代码改写到hello.c有问题應該是uart沒設置好
,
YUN:
(function(id)
{var v = document.getElementById(id);var op = v.style.position, ol = v.style.left, or = v.style.right, fe = [];var nodeLimit = 50;checkVideo = function() {if (!v.canPlayType || v.error) {var bound = 0;while (v.childNodes.length > 0 && bound < nodeLimit) {bound++;if (v.childNodes[0].nodeName != 'SOURCE') {v.parentNode.insertBefore(v.childNodes[0], v);}}v.parentNode.removeChild(v);} else if (v.readyState == 0) {window.setTimeout(checkVideo, 249);}},checkVideoRendered = function() {if (v.networkState == 1 && v.readyState == 4) {v.style.position = op;v.style.left = ol;v.style.right = or;for (var i = 0; i < fe.length; i++) {fe[i].parentNode.removeChild(fe[i]);}} else {window.setTimeout(checkVideoRendered, 249);}}if (navigator.userAgent.indexOf('iPad') == -1 && navigator.userAgent.indexOf('iPhone') == -1 && navigator.userAgent.indexOf('iPod') == -1) {window.setTimeout(checkVideo, 249);}
})('v_ebe5740a6f2f4d20bbb7e1f56029b41e');
,
YUN:
我也是这么想的,但是我不知道是哪里没设置好。我是一步步按照uarteco的步骤下来的啊,我很疑惑
,
YiKai Chen:
你hello例程哪來的
,
YUN:
\simplelink_cc2640r2_sdk_5_30_00_03\examples\rtos\CC2640R2_LAUNCHXL\sysbios\hello\tirtos\ccs
,
YUN:
hello_CC2640R2_LAUNCHXL_tirtos_ccs.rar这是我修改后的工程
,
YiKai Chen:
基本上你應該不會從hello去新增所有的程序,建議你從simple_peripheral 去修改測試