Tool/software:
Hello,
Environment:
Hardware | LP-EM-CC2340R5 |
Code Composer | 12.7.1.00001 |
SDK |
Same phenomenon on SIMPLELINK-LOWPOWER-F3-SDK 7.40.00.64 8.10.00.55 |
I am using CC2340 for communication between a MCU(UART connected) and a phone.
The maximum message size is about 2058 bytes.
As title, there is possibility that CC2340 run into ICall_abort() when notifying.
I simplify the problem by modifying data stream example:
1. User connect to data stream and request MTU 517
2. Upon user writes the echo characteristic, the CC2340 starts to notify 2058 bytes each second. But even prolong period to 2 seconds, same problem happens.
3. After 200~400 notification, CC2340 run into ICall_abort(), call stack:
PDU config:
conn param:
Of course, original example code that response inverse case character is replaced by calling start_tx_test() to start notify test.
main function is like:
#define TX_LEN_ (2058)
static uint8_t tx_data[TX_LEN_];
static sem_t sem_start_tx;
static sem_t sem_tx_done;
void start_tx_test()
{
sem_post(&sem_start_tx);
}
static void VNG_UART_to_BLE(char *pData)
{
DSP_sendData(tx_data, TX_LEN_);
sem_post(&sem_tx_done);
}
static void *UART_tx_Thread(void *arg0)
{
sem_wait(&sem_start_tx);
uint8_t cnt = 0;
while(1)
{
memset(tx_data, cnt, TX_LEN_);
if(BLEAppUtil_invokeFunctionNoData(VNG_UART_to_BLE) != SUCCESS)
{
while(1){}
}
sem_wait(&sem_tx_done);
cnt += 1;
vTaskDelay(pdMS_TO_TICKS(1000));
}
}
void start_thread()
{
if(sem_init(&sem_start_tx, 0, 0))
{
while(1){}
}
if(sem_init(&sem_tx_done, 0, 0))
{
while(1){}
}
pthread_t thread;
pthread_attr_t attrs;
struct sched_param priParam;
int retc;
/* Initialize the attributes structure with default values */
pthread_attr_init(&attrs);
/* Set priority, detach state, and stack size attributes */
priParam.sched_priority = 1;
retc = pthread_attr_setschedparam(&attrs, &priParam);
retc |= pthread_attr_setdetachstate(&attrs, PTHREAD_CREATE_DETACHED);
retc |= pthread_attr_setstacksize(&attrs, 1024);
if (retc != 0)
{
/* failed to set attributes */
while (1) {}
}
retc = pthread_create(&thread, &attrs, UART_tx_Thread, NULL);
if (retc != 0)
{
/* pthread_create() failed */
while (1) {}
}
}
Could someone enlighten me why ICall_abort() will be triggered just for notifying continuously?
Thank you very much
Chunmin