Part Number: CC2564CMSP432BTBLESW
Other Parts Discussed in Thread: CC2564C
Tool/software: Code Composer Studio
I use the MSP432 launchpad 2.0 stacked with a PCB containing CC2564C chip and an audio codec. Software base is the A3DPDemo_SNK from the samples directory. After upgrading to Bluetopia 4.2.1.1 I can connect to the device and everything is working fine.
However, after adding additional functionality the program doesn't fit into MAIN memory, anymore. After studying the TI Linker Command File Primer I moved two object files (A3DPDemo_SNK.obj and btvs.obj) into SRAM_CODE memory range. And by only doing this the MCU runs into a hard fault during initialization of BT stack. Following the instruction given in this post I managed to examine the callstack and function right before the hard fault occurs: HCI_VS_InitializeAfterHCIReset. So I put a breakpoint inside and restarted for debugging. The hard fault occurs after stepping over the call to VS_Update_UART_Baud_Rate(BluetoothStackID, SpecifiedBaudRate). So I stepped into this function. The (shortened) code looks like this:
if((BluetoothStackID) && (BaudRate) && (BaudRate <= CONTROLLER_MAX_HCI_BAUD_RATE))
{
/* Write the Baud Rate. */
...
ret_val = HCI_Send_Raw_Command(BluetoothStackID, OGF, OCF, sizeof(NonAlignedDWord_t), (Byte_t *)&_BaudRate, &Status, &Length, Buffer, TRUE);
if((ret_val = MapSendRawResults(ret_val, Status, Length, Buffer)) == 0)
{
...
ret_val = HCI_Reconfigure_Driver(BluetoothStackID, FALSE, &(DriverReconfigureData));
}
}
else
ret_val = BTPS_ERROR_INVALID_PARAMETER;
The debugger steps into the if-clause (correct) and calls HCI_Reconfigure_Driver() at its end. So far so good but after that the weird things are starting:
Debugger steps into else-part and continues execution there! Any further single stepping (using F6) simply seems to follow each and every function/statement from the source file. Reaching the return statement it does NOT return but continues with next function from source code file. I don't get this - looking at the values of variables also produces wrong results. What is happening here?
