如题·············
Kevin Qiu1:
创建新任务参考这里:dev.ti.com/…/node
e2e.ti.com/…/935948
user1388075:
回复 Kevin Qiu1:
通过宏定义修改最大任务数在CCS哪个地方, IAR我知道在哪,CCS不知道
user1388075:
回复 Kevin Qiu1:
CCS9.0 和CCS10.0能装在同一个电脑上么?
Kevin Qiu1:
回复 user1388075:
可以的
user1388075:
回复 Kevin Qiu1:
/******************************************************************************
@file simple_peripheral.c
@brief This file contains the Simple Peripheral sample application for use with the CC2650 Bluetooth Low Energy Protocol Stack.
Group: WCS, BTS Target Device: cc2640r2
******************************************************************************
Copyright (c) 2013-2020, Texas Instruments Incorporated All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* Neither the name of Texas Instruments Incorporated nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
******************************************************************************
*****************************************************************************/
/********************************************************************* * INCLUDES */#include <string.h>
#include <ti/sysbios/knl/Task.h>#include <ti/sysbios/knl/Clock.h>#include <ti/sysbios/knl/Event.h>#include <ti/sysbios/knl/Queue.h>
#include <ti/display/Display.h>
#if !(defined __TI_COMPILER_VERSION__)#include <intrinsics.h>#endif
#include <ti/drivers/utils/List.h>
#include <icall.h>#include "util.h"#include <bcomdef.h>/* This Header file contains all BLE API and icall structure definition */#include <icall_ble_api.h>
#include <devinfoservice.h>#include <simple_gatt_profile.h>
#ifdef USE_RCOSC#include <rcosc_calibration.h>#endif //USE_RCOSC
#include <board.h>#include <board_key.h>
#include <menu/two_btn_menu.h>
#include "simple_peripheral_menu.h"#include "simple_peripheral.h"
#ifdef PTM_MODE#include "npi_task.h" // To allow RX event registration#include "npi_ble.h" // To enable transmission of messages to UART#include "icall_hci_tl.h" // To allow ICall HCI Transport Layer#endif // PTM_MODE
// Task configuration#define OXY_TASK_PRIORITY 1
#ifndef OXY_TASK_STACK_SIZE#define OXY_TASK_STACK_SIZE 1000#endif
uint8_t oxyTaskStack[OXY_TASK_STACK_SIZE];static void Oxy_taskFxn(UArg a0, UArg a1);
void Oxy_createTask(void){ Task_Params taskParams;
// Configure task Task_Params_init(&taskParams); taskParams.stack = oxyTaskStack; taskParams.stackSize = OXY_TASK_STACK_SIZE; taskParams.priority = OXY_TASK_PRIORITY;
Task_construct(&oxyTaskStack, Oxy_taskFxn, &taskParams, NULL);}
static void Oxy_taskFxn(UArg a0, UArg a1){
for (;;) { Task_sleep(100*100); }
}我用ccs9.0,创建这么一个简单的任务跑不起来,不进断点。
下面两处宏定义都改大了1:
好多坑啊。。。。
Kevin Qiu1:
回复 user1388075:
创建任务:dev.ti.com/…/creating-a-custom-bluetooth-low-energy-application.html
sunmaysky.blogspot.com/…/how-to-create-new-task-in-ti-rtos-to.html
user1388075:
回复 Kevin Qiu1:
没有OSAL_MAX_NUM_PROXY_TASKS 这个定义啊,链接中说默认是2
如果(OSAL_MAX_NUM_PROXY_TASKS + 1)!= ICALL_MAX_NUM_TASKS不匹配,则堆栈将中止。
我的工程里面配置的是4。那么默认条件不满足?!
user1388075:
回复 Kevin Qiu1:
SDK 的statck部分没有OSAL_MAX_NUM_PROXY_TASKS 这个宏的定义
Kevin Qiu1:
回复 user1388075:
有的,在osal.c中
user1388075:
回复 Kevin Qiu1:
如果是主机端移动超过蓝牙通信距离导致断线后,挪近后 再也搜不到和这个地方的配置有关系么?