This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tool/software: TI-RTOS
Hello,
I am running my own application on CC2650MODA. I have imported the simple_central_cc2650lp_app and stack. I have removed the simple central application part and add my own application file.
If I received a message with 16 Bytes this leads to a error. After my app has received the message evaluation works and my app is connected to the peer device. So everything seems to to be oke. But when I know push a button of (which is connected with a DIO of my CC2650) or receive another message my application crash.
For example when I push a button after I have evaluated the button I am calling the a function to inform the application task.
Icall this function:
uint8_t Util_enqueueMsg(Queue_Handle msgQueue, #ifdef ICALL_EVENTS Event_Handle event, #else //!ICALL_EVENTS Semaphore_Handle sem, #endif //ICALL_EVENTS uint8_t *pMsg) { queueRec_t *pRec; // Allocated space for queue node. #ifdef USE_ICALL if ((pRec = ICall_malloc(sizeof(queueRec_t)))) #else if ((pRec = (queueRec_t *)malloc(sizeof(queueRec_t)))) #endif { pRec->pData = pMsg; // This is an atomic operation Queue_put(msgQueue, &pRec->_elem); // Wake up the application thread event handler. #ifdef ICALL_EVENTS if (event) { Event_post(event, UTIL_QUEUE_EVENT_ID); } #else //!ICALL_EVENTS /* * NEW ## */ // semCount = Semaphore_getCount(sem); /* * NEW ## */ if (sem) { Semaphore_post(sem); } /* * NEW ## */ // semCount = Semaphore_getCount(sem); /* * NEW ## */ #endif //ICALL_EVENTS return TRUE; } // Free the message. #ifdef USE_ICALL ICall_free(pMsg); #else free(pMsg); #endif return FALSE; }
In this function gets the "ICall_malloc(..)" function called.
I Can step in this function with the debugger to the call"errno = ICall_dispatcher(&args.hdr);"
Then the application chrashes.
static void *ICall_malloc(uint_least16_t size) { static volatile uint32_t malloc; static volatile uint32_t nByte[16]; static volatile uint8_t i; if(i<16) { nByte[i] = size; i++; } else { i = 0; nByte[i] = size; } ICall_AllocArgs args; ICall_Errno errno; args.hdr.service = ICALL_SERVICE_CLASS_PRIMITIVE; args.hdr.func = ICALL_PRIMITIVE_FUNC_MALLOC; args.size = size; errno = ICall_dispatcher(&args.hdr); if (errno != ICALL_ERRNO_SUCCESS) { return NULL; } /* * NEW */ else { malloc++; } /* * NEW END */ return args.ptr; }
I have looked at the RTOS Object View->HWI.
If i look at the Erorr Adress i get the message "Error memory map prevented reading 0x..."
Could you please help me?
Hello,
but regarding to the BLE SW User's Guide the calling from the HWI seems to be legit.
I have copied that from the simple_central project from TI.
When I look at the BLE SW User´s Guide (chapter 3.5.2 page 46) there gets the ICall_malloc function also called to allocate memory.
So I think this can not be the problem.