The SWO feature would be interesting for me as well.
Why not just hook up a USB to Serial adaptor to USART1 ( PA9 and PA10),
I have tested with the arm eclipse plugin (it can be enabled during creation of the project), but finally I think that using a uart for this is a better option. Personally for difficult points I prefer to debug with ST-Link directly (with breakpoints, step execution, etc)
While SWO is working with Nucleo boards, this is not working with ST-Link V2 clones as the SWO does not exist.
http://www.eevblog.com/forum/microcontr … nk-clones/
If one day, Arduino or stm32duino will have the debugger support, I hope that it would go one step further and leverage all the capabilities built in the M3 platform. Please, take a look of the following blog explaining and demonstrating these capabilities.
http://essentialscrap.com/tips/arm_trace/theory.html
Cheers, Ollie
interesting the last post in the thread
I’ve figured it out, but still waiting with pulling the trigger
There is an active thread by @stevestrong where he now uses Eclipse + an Arduino plugin.
This may be the best of both worlds, but it looks like the install is a little tricky.
I dont think the Arduino IDE is going to get debugger support any time in the near future, as for AVR Arduino now recommends the use of Atmel Studio ( aka AVR Studio) if you want debugger support, and surprisingly the Arduino team seem to think debug support is not something beginners would want ( but I think debug support makes things easier for beginners not harder, even web browsers now come with Javascript debuggers by default)
It nicely prints information at about 2Mhz in stlink, and 4.5Mhz in swo viewer.
Now I do have a problem with #define and ifdef in the arduino IDE.
This works fine in both Eclipse and Arduino IDE if I define SWODEBUG, but if I comment it out “#define SWODEBUG” to eliminate the debug output, then in Arduino it doesn’t compile:
#define SWODEBUG
#ifdef SWODEBUG
SWO_Channel SWO;
#define SWO_ErrLog(...) SWO.printf(__VA_ARGS__);
#else /* Not DEBUG */
#define SWO_ErrLog(...)
#endif
#define SWODEBUG 1#define SWODEBUG 1I suspect the problem is that it needs to be defined globally and if you only define it in the sketch it only gets applied to includes directly included by the sketch not by any of the other core files
You could also try putting it in something like arduino.h as I think that may get included in most files (though not all)
Nothing goes wrong when I declare the functions in the ino (or rather some of them) myself. It seems like Arduino IDE places the functions before the #define if there is only the pin one, and the #ifdef, but doesn’t do so where there is the other #define there.. In any case, seems to be totally a problem of the Arduino IDE and nothing else. Since I found a way around it if it happens again I can move forward to other things.
Thank you both for the suggestions.
#if (SWODEBUG > 0)
SWO_Channel SWO;
#define SWO_ErrLog(...) \
SWO.printf(__VA_ARGS__); \
SWO.printf("LINE: %d, FUNCTION: %s, FILE: %s \r\n", __LINE__, __FILE__, __FUNCTION__);
#else /* Not DEBUG */
#define SWO_ErrLog(...)
#endif Also, what was the line above the toggleLED definition?
Also, what was the line above the toggleLED definition?


