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.

Error in breakpoints when debugging CC2540 using IAR

Other Parts Discussed in Thread: CC2540, CC2541

Hi,

I came across the attached post when trying to figure out why, when stepping through breakpoints with the CC Debugger, I keep on getting the message: "Unable to execute: driver error". Every time this happens IAR workbench freezes and I need to force quit. This poster seems to be having the same problem without any resolution. Any ideas on what could be causing this?

Thanks,

Matt

  • Hi Matt,

    I am suspecting it might be because of some legacy code in the BLE stack, I have seen this issue in other code where IAR / CC Debugger freezes during the code sequence changing from the internal 16MHz RCOSC to the external 32MHz XOSC when single-stepping through this with IAR.

    Can you verify if the following helps in your case? :

    hal_board_cfg.h:

    Remove the following macros:

    START_HSOSC_XOSC(); \
    SET_OSC_TO_HSOSC(); \
    STOP_HSOSC(); \

     Example:

     

    /* Board Initialization */
    #define HAL_BOARD_INIT() \
    { \
    /* Set to 16Mhz to set 32kHz OSC, then back to 32MHz */ \
    SET_32KHZ_OSC(); \
    SET_OSC_TO_XOSC(); \
    /* Enable cache prefetch mode. */ \
    PREFETCH_ENABLE(); \
    }

    Best regards,
    Svend 

  • I have the same issue when debugging the cc2540 chip and running the HIDAdvRemoteDongle project.  However, in removing those lines (I removed 6 lines because it appeared in two places) I still receive this error.  

    It now appears:

    /* Board Initialization */
    #if defined HAL_USB_BOOT_CODE
    #define HAL_BOARD_INIT() \
    { \
    /* Set to 16Mhz to set 32kHz OSC, then back to 32MHz */ \
    SET_32KHZ_OSC(); \
    STOP_HSOSC(); \
    \
    /* Disconnect D+ signal to host. */ \
    HAL_USB_PULLUP_DISABLE(); \
    \
    /* Enable cache prefetch mode. */ \
    PREFETCH_ENABLE(); \
    }

    #else
    #define HAL_BOARD_INIT() \
    { \
    /* Set to 16Mhz to set 32kHz OSC, then back to 32MHz */ \
    SET_32KHZ_OSC(); \
    SET_OSC_TO_XOSC(); \
    \
    /* Enable cache prefetch mode. */ \
    PREFETCH_ENABLE(); \
    }
    #endif

  • sorry, correction, it now looks like this:

    /* Board Initialization */
    #if defined HAL_USB_BOOT_CODE
    #define HAL_BOARD_INIT() \
    { \
    /* Set to 16Mhz to set 32kHz OSC, then back to 32MHz */ \
    SET_32KHZ_OSC(); \
    SET_OSC_TO_XOSC(); \
    \
    /* Disconnect D+ signal to host. */ \
    HAL_USB_PULLUP_DISABLE(); \
    \
    /* Enable cache prefetch mode. */ \
    PREFETCH_ENABLE(); \
    }

    #else
    #define HAL_BOARD_INIT() \
    { \
    /* Set to 16Mhz to set 32kHz OSC, then back to 32MHz */ \
    SET_32KHZ_OSC(); \
    SET_OSC_TO_XOSC(); \
    \
    /* Enable cache prefetch mode. */ \
    PREFETCH_ENABLE(); \
    }
    #endif

  • Hi sved,

    I have the same issue of Matt, so I remove the macro in hal_board_cfg.h....and...... I still have the error.

    I use the SimpleBLEperiphical project from the stack 1.4 with IAR 8.30.3 and a custom board (a CC2541 with an another chip connected by I2C).

    Do you have any idea ? Something to check ? Modify ?

    Best regards,

  • I have the same problem. Any idea?