2013-01-24 07:59 AM
hi
I am using STM32W108CB and made my own pcb. I've stlink v2 and want to use it as Serial Wire Debugger.When I press 'connect to the target' in stlink utility I get message 'Internal command error'.I've tried to search a lot but can't find what that error means.I've not soldered crystal oscillator to the board yet. Does SWD needs the MCU with external clock?I've triple check all the connection power supply. Each connection is perfect and well, don't know why SWD isn't working.Any kind of help would be appreciated.2013-01-24 08:30 AM
You don't need an external crystal for the debug interface to run, by the CPU has to function.
Most likely a power supply issue, check the voltage on NRST. Typical failures beyond that are that it's just wired up wrong, the interface isn't correct, the chip is not correctly orientated, or you have solder shorts, or open connections. Post a schematic of the board, of specifically the STM32 if other stuff is sensitive.2013-01-25 10:22 AM
Thanks clive1.
There was problem with power supply. Now stlink detects the stm32w108.I am right now facing another problem. I am using uvision 4 and can program stm32w108 properly, but the problem is that each time when I debug, mcu goes into NMI Handler() function.Is it happening due to clock issues? I think I've not properly soldered 24MHz crystal oscillator.2013-01-25 11:38 AM
Sure it's not in the Hard Fault handler?
Suggest you turn off ''Run to main'' and debug the initial start up through SystemInit()2013-01-27 07:09 AM
Thanks clive1.
I've soldered crystal properly and it's working fine.Now program doesn't go into NMI Handler()Thank you for your reply.