I started my design using the STERLING-LWB module evaluation board coupled with an STM32F411E-DISCO board. I am also using the latest WICED SDK (v4.1). My application runs and debugs fine on that setup with both the on-board FTDI interface, or an Olimex ARM-USB-TINY-H (after holding the FTDI in reset).

I now have my custom PCB in house. It is a slight deviation from the evaluation boards in that I use a smaller package STM32F411CEU6 than the eval board (STM32F411VET6U), and a 16MHz crystal instead of a 8MHz. So, I cloned the LSRSTERLING_00950 platform, and tweaked it for my new PCB. I can build, program, and run my application, or the snip examples on my board. They all run as expected. However, I cannot debug anything on my custom PCB. Whenever I start the debugger, it just keeps breaking, currently at the beginning of "_start" in crt0_GCC.c. It would seem that it is either a configuration difference due to the new processor/pinout, or something in the platform directory. However, I'm not sure what it could be. Has anyone else run into this?

Well, I figured out why I couldn't debug. ST has an errata with those parts, where you cannot use JTAG as the debug interface and use PB4 as any function other than TRST. Even if you aren't using TRST, you cannot use it for any other function. The workaround is to use SWD debugging. Unfortunately, I need PB4 pin for SPI1_MISO. So, when the OS tries to change that pin to SPI1_MISO, and I'm connected with the debugger, it resets the processor.

Unfortunately WICED is really tailored for full JTAG debugging, not SWD. I have modified the OpenOCD scripts for the Olimex ARM-USB-TINY-H, Segger J-Link, and even the ST-Link. I can get close to getting them to work, but haven't been successful in getting them to debug over SWD.

At this point I've given up on SWD, and have designed a new board that uses a larger package where I don't need PB4. Therefore I'll be able to use JTAG.