263 views
in System Integration by
Hi,

The Embedded Wizard  (EW) function EwPrint() uses the uart and has been  without a problem with our custom design (STM32 based). I have recently  implemented a USB virtual comport (in our STM32 MCU), so data can be sent and  received via a USB connection. I would like to patch the  EwPrint() to use the virtual comport, what is the  place place to do this. My preliminary investigation points to the functions EwBspConsolePutCharacter() and EwBspConsoleGetCharacter() the file  ew_bsp_console.c, but these functions operate on single characters, where as the virtual comport functions operate with blocks of data. It is not to say that the block of data cannot be a consist of a single character, but for efficiency it would good to send and receive blocks of data. I would appreciate suggestions on  the best place to make the changes.

MikeZ

1 Answer

0 votes
by

Hi MikeZ,

EwPrint() is not the recommended place to make the described patch.

You can implement you own EwBspConsolePutChar() and collect the single characters within a buffer until you get a '\n' to flush the string via USB.

Alternatively, you can adapt the function EwConsoleOutput() within the file ewextrte.c, which receives the entire string and splits it into the individual characters. There you can send the entire string to your USB transmit function.

Best regards,

Manfred.

Embedded Wizard Website | Privacy Policy | Imprint

...