Hi Mejdoub,
The KWIKSTIK’s BSP comes with the default console channel on “iodebug”, which is the terminal of the JTAG debugger; therefore it only works when the debugger is connected (try running the application while debugging and it will work). However, when running on stand-alone mode, the debugger doesn’t respond, and the application will be halted. You could refer to section 7.2.11 “KwikStik (MK40X256)” of the MQX v4.1 Getting Started document, where is mentioned that the default console channel is the “iodebug”, and that it could be changed to use “ttyf”. In order to do so and avoid the blocking issue, please open the KWIKSTIK’s BSP project, and then, the file “kwikstik-k40x256.h”, change to 1 the following macro definition for enabling the TTYF:
#ifndef BSPCFG_ENABLE_TTYF
#define BSPCFG_ENABLE_TTYF 0
#endif
Also, it is required to indicate that TTYF will be the default console channel, so, on the same file, locate the following macro, and replace the "iodebug:" with "ttyf:":
#ifndef BSP_DEFAULT_IO_CHANNEL
#if BSPCFG_ENABLE_IODEBUG
#define BSP_DEFAULT_IO_CHANNEL "iodebug:" /* IDE debug console */
Finally, you need to recompile the BSP, then the PSP, and at the end, the CDC application
Hope this will be useful for you.
Best regards!
/Carlos
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------