Guys,
I have weird problem. I succesfully ported Buetoopia FreeRTOS stack to STM32F4 using Keil and precombilled bluetopia library.
That was succesfull and product is working correctly. Recently I moved whole software into open source and I would like to use gcc as compiller instead
of uVision Keil.
I added proper Bluetopia library to the gcc project (compiled for gcc from Bluetopia/lib/gcc/libBluetopia_32_M3.a), so similar as in Keil project.
I also added proper for GCC and STM32F4 port.c and port.h files according to FreeRTOS documentation. Other code is exactly the same, only those changes was made.
Project compiles succesfully, everything before MainThread creation is done, event part which is not connected to Bluetopia library in MainThread
is working(some pin bitbanging, SPI communication, etc) but as soon as I get to this part of code:
... static int OpenStack(HCI_DriverInformation_t *HCI_DriverInformation, BTPS_Initialization_t *BTPS_Initialization) { int Result; int ret_val = 0; char BluetoothAddress[15]; Byte_t Status; BD_ADDR_t BD_ADDR; HCI_Version_t HCIVersion; L2CA_Link_Connect_Params_t L2CA_Link_Connect_Params; /* First check to see if the Stack has already been opened. */ if(!BluetoothStackID) { /* Next, makes sure that the Driver Information passed appears to */ /* be semi-valid. */ if((HCI_DriverInformation) && (BTPS_Initialization)) { /* Initialize BTPSKNRl. */ BTPS_Init(BTPS_Initialization); /* Initialize the Stack */ Result = BSC_Initialize(HCI_DriverInformation, 0); /* Next, check the return value of the initialization to see if*/ /* it was successful. */ if(Result > 0) { ..
which was taken from SPPDemo from bluetopia library, delivered by TI I get HardFaul_Handler.
The SP does not point properly to function which caused HardFault, I know that,
Result = BSC_Initialize(HCI_DriverInformation, 0);
causes that. In debbugger it just does not go forward. If I comment this and go further It agains called HaldFault_Handler as soon
as some Bluetoopia code from precompilled library is called.