Not able to Debug and test the SPP code on CYW920719Q40EVB-01 board using Jlink EDU mini

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

cross mob
EkYa_4447406
Level 1
Level 1

Hello,

I am using  CYW920719Q40EVB-01 board to test different code. First, i wanted to try SPP code to download and see the communication using any SPP app( i have downloaded "SPP" app) but not able to establish the set up and debug the code to see its functionality.

I referred to pdf " CYW920719Q40EVB-01 JTAG DEBUGGING", but i am getting one error, i am attaching the screenshot of that error.

pastedImage_0.png

Please help me how to proceed it.

Thanks & Regards,

Ekta

0 Likes
1 Solution

Updated steps:

Filename: spar_utils.h

------------------------------

1) Modify the debugging enable macros as shown below. (Or copy the below code and comment out the original macro definition)

NOTE: If you are using some other pin as SWDCK and SWDIO (other than P33 and P34), you will have to wire up the debug hardware accordingly to the EVAL kit.

#include "gpiofunction.h"

void _tx_v7m_set_int(unsigned int posture);

unsigned int _tx_v7m_get_int(void);

#ifdef DEBUG

/// When debugging is enabled, sets up the HW for debugging.

#define SETUP_APP_FOR_DEBUG_IF_DEBUG_ENABLED()   do{        \

         wiced_hal_gpio_select_function(WICED_P33, WICED_SWDCK); \

         wiced_hal_gpio_select_function(WICED_P34, WICED_SWDIO); \

        wiced_hal_wdog_disable(); \

    }while(0)

/// Optionally waits in a pseudo while(1) until the user allows the CPU to continue

#define BUSY_WAIT_TILL_MANUAL_CONTINUE_IF_DEBUG_ENABLED()     do{   \

        volatile UINT8 spar_debug_continue = 0;                     \

        unsigned int interrupt_save = _tx_v7m_get_int();\

        while(!spar_debug_continue);                                \

        spar_debug_continue = 0; \

        _tx_v7m_set_int(interrupt_save);                            \

        }while(0)

#else

#define SETUP_APP_FOR_DEBUG_IF_DEBUG_ENABLED()

#define BUSY_WAIT_TILL_MANUAL_CONTINUE_IF_DEBUG_ENABLED()

#endif

Filename: gpiofunction.h

---------------------------------

1) Replace  #include "gpiodriver.h" with  #include "wiced_hal_gpio.h".

//#include "gpiodriver.h"

#include "wiced_hal_gpio.h"

2) Remove/comment out below code.

//typedef enum GPIO_STATUS_e

//{

//    GPIO_FAILURE,

//    GPIO_SUCCESS,

//    GPIO_REMAPPED,

//    GPIO_MOVED

//} GPIO_status_t;

3) Replace all gpio_numbers_t with wiced_bt_gpio_numbers_t.

4) Replace GPIO_status_t with wiced_bt_gpio_select_status_t.

Filename:  spp.c

----------------------

1) Add below macros in APPLICATION_START()

SETUP_APP_FOR_DEBUG_IF_DEBUG_ENABLED();

BUSY_WAIT_TILL_MANUAL_CONTINUE_IF_DEBUG_ENABLED();

2) #include "spar_utils.h"

Filename: makefile.mk

------------------------------

1) add below flag.

C_FLAGS+= -DDEBUG

Filename:  maketarget string (when downloading)

------------------------------------------------------------------

In the Eclipse “Make target”, ensure DEBUG=1 is on the command line.

View solution in original post

0 Likes
4 Replies
AnjanaM_61
Moderator
Moderator
Moderator
5 comments on KBA First comment on KBA 5 questions asked

Hi Ekta,

Can you please try the steps mentioned in the following thread: Cypress CYW920719Q40-B1 eval kit debugging

Thanks,
Anjana

0 Likes

Hi Anjana,

Yes I checked this thread also and then implement it by checking that again in debugging pdf also, after completing all the steps I am getting this error.

Thanks & Regards,

Ekta

0 Likes

The issue is GDB server and client are not initiating connection properly. Please go through the below workarounds. And also check whether you have made all the changes what I listed below.

->Workaround_1:

Open a SEGGER J-link GDB Server and establish connect to the target, and, KEEP IT OPEN. Then start a debugging session from WICED as usual.

->Workaround_2:

Go to Debug Configurations in WICED and select Debugger tab.

In GDB Client Setup Select arm-none-eabi-gdb.exe for Executable from C:\Users\username\Documents\WICED-Studio-6.4.0.61\43xxx_Wi-Fi\tools\ARM_GNU\Win32\bin\arm-none-eabi-gdb.exe. Then start a debugging session from WICED as usual.

Below are the changes what I have done to start a debugging session using WICED. Please check whether you have done all the below changes properly.

Filename: spar_utils.h

------------------------------

1) Modify the debugging enable macros as shown below. (Or copy the below code and comment out the original macro definition)

NOTE: If you are using some other pin as SWDCK and SWDIO (other than P33 and P34), you will have to wire up the debug hardware accordingly to the EVAL kit.

#include "gpiofunction.h"

void _tx_v7m_set_int(unsigned int posture);

unsigned int _tx_v7m_get_int(void);

#ifdef DEBUG

/// When debugging is enabled, sets up the HW for debugging.

#define SETUP_APP_FOR_DEBUG_IF_DEBUG_ENABLED() do{ \

  wiced_hal_gpio_select_function(WICED_P33, WICED_SWDCK); \

  wiced_hal_gpio_select_function(WICED_P34, WICED_SWDIO); \

  wiced_hal_wdog_disable(); \

  }while(0)

/// Optionally waits in a pseudo while(1) until the user allows the CPU to continue

#define BUSY_WAIT_TILL_MANUAL_CONTINUE_IF_DEBUG_ENABLED() do{ \

  volatile UINT8 spar_debug_continue = 0; \

  unsigned int interrupt_save = _tx_v7m_get_int();\

  while(!spar_debug_continue); \

  spar_debug_continue = 0; \

  _tx_v7m_set_int(interrupt_save); \

  }while(0)

#else

#define SETUP_APP_FOR_DEBUG_IF_DEBUG_ENABLED()

#define BUSY_WAIT_TILL_MANUAL_CONTINUE_IF_DEBUG_ENABLED()

#endif

Filename: gpiofunction.h

---------------------------------

1) Replace #include "gpiodriver.h" with #include "wiced_hal_gpio.h".

//#include "gpiodriver.h"

#include "wiced_hal_gpio.h"

2) Remove/comment out below code.

//typedef enum GPIO_STATUS_e

//{

// GPIO_FAILURE,

// GPIO_SUCCESS,

// GPIO_REMAPPED,

// GPIO_MOVED

//} GPIO_status_t;

3) Replace all gpio_numbers_t with wiced_bt_gpio_numbers_t.

4) Replace GPIO_status_t with wiced_bt_gpio_select_status_t.

Filename: spp.c

----------------------

1) Add below macros in APPLICATION_START()

SETUP_APP_FOR_DEBUG_IF_DEBUG_ENABLED();

BUSY_WAIT_TILL_MANUAL_CONTINUE_IF_DEBUG_ENABLED();

Filename: makefile.mk

------------------------------

1) add below flag.

C_FLAGS+= -DDEBUG

Filename: maketarget string (when downloading)

------------------------------------------------------------------

In the Eclipse “Make target”, ensure DEBUG=1 is on the command line.

0 Likes

Updated steps:

Filename: spar_utils.h

------------------------------

1) Modify the debugging enable macros as shown below. (Or copy the below code and comment out the original macro definition)

NOTE: If you are using some other pin as SWDCK and SWDIO (other than P33 and P34), you will have to wire up the debug hardware accordingly to the EVAL kit.

#include "gpiofunction.h"

void _tx_v7m_set_int(unsigned int posture);

unsigned int _tx_v7m_get_int(void);

#ifdef DEBUG

/// When debugging is enabled, sets up the HW for debugging.

#define SETUP_APP_FOR_DEBUG_IF_DEBUG_ENABLED()   do{        \

         wiced_hal_gpio_select_function(WICED_P33, WICED_SWDCK); \

         wiced_hal_gpio_select_function(WICED_P34, WICED_SWDIO); \

        wiced_hal_wdog_disable(); \

    }while(0)

/// Optionally waits in a pseudo while(1) until the user allows the CPU to continue

#define BUSY_WAIT_TILL_MANUAL_CONTINUE_IF_DEBUG_ENABLED()     do{   \

        volatile UINT8 spar_debug_continue = 0;                     \

        unsigned int interrupt_save = _tx_v7m_get_int();\

        while(!spar_debug_continue);                                \

        spar_debug_continue = 0; \

        _tx_v7m_set_int(interrupt_save);                            \

        }while(0)

#else

#define SETUP_APP_FOR_DEBUG_IF_DEBUG_ENABLED()

#define BUSY_WAIT_TILL_MANUAL_CONTINUE_IF_DEBUG_ENABLED()

#endif

Filename: gpiofunction.h

---------------------------------

1) Replace  #include "gpiodriver.h" with  #include "wiced_hal_gpio.h".

//#include "gpiodriver.h"

#include "wiced_hal_gpio.h"

2) Remove/comment out below code.

//typedef enum GPIO_STATUS_e

//{

//    GPIO_FAILURE,

//    GPIO_SUCCESS,

//    GPIO_REMAPPED,

//    GPIO_MOVED

//} GPIO_status_t;

3) Replace all gpio_numbers_t with wiced_bt_gpio_numbers_t.

4) Replace GPIO_status_t with wiced_bt_gpio_select_status_t.

Filename:  spp.c

----------------------

1) Add below macros in APPLICATION_START()

SETUP_APP_FOR_DEBUG_IF_DEBUG_ENABLED();

BUSY_WAIT_TILL_MANUAL_CONTINUE_IF_DEBUG_ENABLED();

2) #include "spar_utils.h"

Filename: makefile.mk

------------------------------

1) add below flag.

C_FLAGS+= -DDEBUG

Filename:  maketarget string (when downloading)

------------------------------------------------------------------

In the Eclipse “Make target”, ensure DEBUG=1 is on the command line.

0 Likes