Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
prk_4086136
Level 3
Level 3
25 sign-ins 25 replies posted 10 replies posted

Hello

I had initially created example project Bluetooth_LE_HelloSensor and added my SPI driver code. It works well.

When I replicate the same setting for Battery Server example with OTA, the SPI gets stuck here:

prk_4086136_0-1701194428947.png

I am not using hal driver but pdl one. What can be the issue?

 

0 Likes
1 Solution
ADSW
Moderator
Moderator
Moderator
50 likes received 250 sign-ins 50 solutions authored

Hello @prk_4086136 

For PSoC63, it will build the MCUBoot image to start application from CM0+ first ( CM0P_BLESS_OTA image).
The map address of memory will refer to flashmap configuration ( *.json file ).
You may need to check if the clock configuration is run properly or not and you may to add this several flag in makefile for the PSOC_063_1M or PSOC_062_1M: 
DEFINES+=CY_USING_PREBUILT_CM0P_IMAGE    CORE_NAME_CM4_0

Warm regards,
Andri

View solution in original post

0 Likes
9 Replies
advait_kulkarni
Moderator
Moderator
Moderator
First question asked 25 likes received 250 sign-ins

Hi @prk_4086136 ,

Can you please tell which chip you are using? And does it throw any error?

Thanks and regards,

Advait Kulkarni

0 Likes
prk_4086136
Level 3
Level 3
25 sign-ins 25 replies posted 10 replies posted

Hi Advait,

Chip being used is CY8C6347FMI-BLD33T and BSP being used is CY8CPROTO-63BLE.

It doesnt throw any error. Just gets stuck in the loop.

0 Likes

Hi @advait_kulkarni - Just checking in on this

0 Likes
prk_4086136
Level 3
Level 3
25 sign-ins 25 replies posted 10 replies posted

Hello?

0 Likes

Hi @prk_4086136 

Please can you share the code snippet of SPI that you are adding in your battery server code example so that we can understand the issue better.

 

Thanks & Regards

Pratiksha V

0 Likes
prk_4086136
Level 3
Level 3
25 sign-ins 25 replies posted 10 replies posted

Hi,

SPI Code:

uint32 status = 0;
uint8_t txbuffer1[1] = {(0x0F)|0x80};//For IMU
status = startSPITransaction(txbuffer1, spiRxBuffer, 2);//For IMU
    /* If no error wait till master sends data in the Tx FIFO */
    if(status == CY_SCB_SPI_SUCCESS)
    {
    status = checkTranferStatus(2);
    }
 
uint32 checkTranferStatus(uint32 transferSize)
{
    uint32 masterStatus = TRANSFER_FAILURE;
 
/* Wait until master complete the transfer */
do
{
masterStatus  = Cy_SCB_SPI_GetTransferStatus(mSPI_HW, &mSPI_context);
 
} while (0UL != (masterStatus & CY_SCB_SPI_TRANSFER_ACTIVE));
 
numTransferred = Cy_SCB_SPI_GetNumTransfered(mSPI_HW, &mSPI_context);
 
/* Check for any errors */
if ((0UL == (MASTER_ERROR_MASK & masterStatus)) &&
(transferSize == Cy_SCB_SPI_GetNumTransfered(mSPI_HW, &mSPI_context)))
{
/* No error */
masterStatus = TRANSFER_COMPLETE;
}
else
{
/* Error encountered in the transfer */
masterStatus = TRANSFER_FAILURE;
}
 
    return (masterStatus);
}
 
This same code is working in my RTOS based BLE_Hello_Sensor modified code (without OTA). So I can confirm this is not RTOS issue.
0 Likes
prk_4086136
Level 3
Level 3
25 sign-ins 25 replies posted 10 replies posted

Hi @PratikshaV  - Is there any update on this?

0 Likes
ADSW
Moderator
Moderator
Moderator
50 likes received 250 sign-ins 50 solutions authored

Hello @prk_4086136 , 

Could you please give the report while you run the code in debug mode ? 
and please get the call stack when you do a debug. 
So we can check through the call stack & register status..

Thanks & regards
Andri

0 Likes
ADSW
Moderator
Moderator
Moderator
50 likes received 250 sign-ins 50 solutions authored

Hello @prk_4086136 

For PSoC63, it will build the MCUBoot image to start application from CM0+ first ( CM0P_BLESS_OTA image).
The map address of memory will refer to flashmap configuration ( *.json file ).
You may need to check if the clock configuration is run properly or not and you may to add this several flag in makefile for the PSOC_063_1M or PSOC_062_1M: 
DEFINES+=CY_USING_PREBUILT_CM0P_IMAGE    CORE_NAME_CM4_0

Warm regards,
Andri

0 Likes