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: Code Composer Studio
Hi,
I'm working on BLE application for cc2640 target.
I'm able to build the app successfully. I could open CCS debug window and app binary is successfully loaded into target via JTAG cable through XDS110 debug probe.
I'm using TI RTOS V2.20.01.08, BLE STACK V2.02.01.18, Compiler version V5.2.5
Now, after calling BIOS_start() in my main function, none of the created tasks get run except for the ICall_taskEntry and the Idle task. All other tasks show as "Ready" but never execute .(as shown below)
I couldn't find what is the problem.
1) Is there any issues with ICall_taskEntry function?
2) Please share pointers to solve this issue.
Hi,
We started with Sensortag_cc2650stk_app which is available as sample BLE app.
We have implemented Movement sensor GATT profile.
The main code flow is shown in below image. We have enabled GAP role task and SensorTag application task (Movement sensor).
Did you modify the content of SensorTag_createTask?
Did you program the BIM project?
Hi Christin Lee,
We are struck with this problem and unable proceed further.
We need to get some pointers on why the execution has not gone into application Task function (SenTag_taskfxn()) after BIOS_start()
1) We have increased heap size by 1000 bytes more (Please refer below screenshot). Even then, we are getting same above issue. Is the heap config fine?.
2) The very first line of above screenshot shows importing of cc2640.cfg file. We doubt that this cc2640.cfg file is not getting imported properly. How to check this importing of cc2640.cfg file working fine?.
3) This cc2640.cfg file is not visible under TOOLS folder of Project Explorer (Please refer below Project explorer window screenshot). We feel that cc2640.cfg is not imported properly. How to make this cc2640.cfg file visible under the TOOLS folder of Project explorer window?
4) The cc2640.cfg file is not visible under the Project explorer include path as well (please refer below image). Is this okay?. But this cc2640.cfg file is anyway there under this include path when we browse and see via Windows File Manager.
Hi Sean,
Thanks for your pointer on checking heapmgr metrics.
1) I need to add ICall_heapGetMetrics() function call in the main function before BIOS_start(), right?. This function will return heapmgrMemFail global variable value, right?. Please suggest suitable location to add this function call.
2) The HEAPMGR_SIZE size is defined as 2872 in predefined symbols section of project properties. Is this fine?
3) We will revert the BIOS heap size changes now.
Hi Sean,
I have added the heapmgrMemFail in the CCS watch window , and I ran the processor in the debug mode after run when I paused in watch window I t is showing variable not found.
and it is showing HWI.C FILE .(Hwi exception handler as shown below) I'm not getting what is happening ? and I set the HEAPMGR_SIZE to 0.
Hi Sean2,
1) I added the variable as heapmgrMemFail as you said, then also I'm getting identifier not found as shown below.
2) I went through the deciphering CPU exceptions , the CFSR register contents is shown below( after run the target)
I'm not getting what is the wrong can you give some suggestions?
Hi Sean2,
We did following 2 tests by having BLINK LED task (BlinkLED_createTask) and ICALL task (ICall_createRemoteTasks).
1) In main, the BlinkLED_createTask alone is enabled (as per below screen shot image). Here the ICall_createRemoteTasks is commented out. With this, the project is working fine and no exceptions were raised. The CFSR register is set to all 0's (i.e no errors in CFSR).
Debug window screen shot image:
2) Next time in main, both BlinkLED_createTask and ICall_createRemoteTasks are enabled (as per below screenshot image). With this, the project is NOT working fine and Hard Fault Exceptions were raised (Please refer screenshot image). In CFSR, the INVSTATE flag is set.
Debug window image:
3) With respect to above tests in point 1 and 2, We feel that ICall_createRemoteTasks is having issue and causing exceptions. For your information, we have compiled both app and stack projects successfully. But, we have downloaded only app project out file (sensortag_cc2650stk_app.out) into CC2640 target via XDS110 JTAG debugger probe. We have NOT downloaded stack out file (sensortag_cc2650stk_stack.out) into target. We assumed that app out file is combined with stack out, when we compile app project. Are we doing it correctly?
Thanks in advance
Roopa kalmath
Hi Sean,
Thanks for your update. This time we have compiled and flashed both app and stack images separately in following order.
- Built and flash the stack image and then build and flash the app image in this order
- The ICALL_STACK0_ADDR(0x11001) from ccs_compiler_defines.bcfg matches for both app and stack projects.
1) In main, BlinkLED_createTask, ICall_createRemoteTasks and GAPRole_createTask are enabled. We flashed both stack and app images as per above order. With this the project is WORKING FINE without any exceptions. The LED is blinking fine.
2) In main, BlinkLED_createTask, ICall_createRemoteTasks, GAPRole_createTask and SensorTag_createTask are enabled (as per below image). We flashed both stack and app images as per above order. With this the project is NOT running fine, LED is NOT blinking and got Hard Fault exception: FORCED: BUSFAULT: PRECISERR.Data Access Error. Address = 0x10d78.
We loaded the LR register value ((0xfa07) of this exception which points to Icall_taskentry function as shown in the below image.
Debug window image:
Please share some pointers to solve this BUSFAULT:PRECISERR.
Hi Sean,
Finally, We could solve this BUSFAULT:PRECISERR problem. This problem has come mainly due to the app binary flash memory is overlapping with stack binary flash memory area. The app and stack binary size and flash area details are given below:
App binary flash space :
Flash start address: 0x0
App binary size: 66000 bytes
Flash end address: 0x101D0 (here 1D0 bytes are overlapping onto stack flash space)
Stack binary flash space :
Flash start address: 0x11000 (As per ICALL_STACK0_ADDR)
Stack binary size: 56000 bytes
Flash end address: 0x1EAC0
If you carefully see here, the 1D0 bytes are overlapping onto stack flash space. i.e)
We optimized the app code size below 66kb so that app binary size is NOT overlapping into stack flash space. i.e) the app binary space is separated from the stack binary space. With this, we see that the project is working fine and LED is blinking. No exceptions raised.
1) But We got another problem after overcoming this BUSFAULT error. We see that GAP role task is running fine. But the GAP advertising is NOT visible to Mobile app. i.e) The Mobile app is NOT listing the BLE device's name and other associated GAP advertising and scan response data. We suspect, the Flash last page (0x1E000) is overwritten with stack binary and hence the app binary is unable to cleanly keep CCA and CCFG contents on the Flash last page of 0x1E000.
Am I right?. Please give me some pointers to solve now the GAP advertising NOT visible to Mobile app problem.
Best regards,
Roopa
Hi Sean,
Thanks for your update.
>>The stack linker file (cc26xx_stack.cmd) should align to a flash page and should set ICALL_STACK0_ADDR accordingly based on the last address of the stack.
Here, We see that the ICALL_STACK0_ADDR is NOT defined. But the following key values are defined:
#define FLASH_START 0x0
#define RAM_START 0x20000000
#define RAM_END 0x200048E7
Please explain more what do you mean by saying stack linker file (cc26xx_stack.cmd) should align to a flash page.
>> 1. Whenever making any changes to the stack, you re-build the stack first and then the app. Using Project > rebuild all?
We could successfully rebuild stack project without any errors.
With app project we see strange behavior. When we build app project, the build is successful. Please refer the below image.
But when we rebuild app project, the build is NOT successful and getting errors in pem3 file as shown in below image.
App project Build image:
App project Rebuild image:
1) What could be the problem with rebuild option?.
With successful build of app and stack project binaries, we flashed both on to the target.
With this, we see that SensorTag_processAppMsg() is getting called successfully and following AppMsg events are coming
in following order.
GAPROLE_STARTED
GAPROLE_ADVERTISING
We see that gapRole_processGAPMsg() is getting called successfully and following GAPMsg events are coming
in following order.
GAP_DEVICE_INIT_DONE_EVENT
GAP_ADV_DATA_UPDATE_DONE_EVENT
GAP_MAKE_DISCOVERABLE_DONE_EVENT
2) Is this rebuild error causing GAP advertising not visible to Mobile app?.
Best regards,
Roopa
Hi ,
finally we could solve this problem by identifying followings
before going to compile both stack and app we need to follow some rules
1) ICALL_STACK0_START should ALWAYS be defined in the cc26xx_app.cmd (as shown in below image)
2) stack always starts after the ICALL_STACK0_ADDR
3) ccfg (configuration file ) should properly comming out in .out fie
4) Ensure APP size is less than ICALL_STACK0_START (view-->memory allocation as ashown below )
memory allocation for app:
memory allocation for stack:
5) STACK need to be flashed first, and then the app need to be compiled and flashed.
Regards,
Roopa kalmath