Pico-C with STMF4 Discovery USB UART


C-language UART Shell

  • Pico-C is a UART terminal (shell) which can be programmed in C-language
  • Pico-C provides commands to read/write memory, peripherals and to program with C-code like scripts
  • It uses the UART VCP OTG on STMF4 Discovery [1] eval board
  • Discover the hardware of STMF4 Discovery board with USB UART [2][3]

How does it work?

The STMF4 Discovery board is a great solution and works fine.

  • The firmware is a Coocox [4] Cortex-M4 project.
  • The firmware provides an USB UART VCP device enumeration so that it works as UART serial port.
  • UART parameters: 8 bit, no flow control, baud rate: 115200
  • Pico-C is based on a project found on Internet, written by ...
  • Meanwhile I have fixed some small issues in Pico-C and extended by some commands and features.
  • The command line of Pico-C accepts C-like language statements, including variable definitions, function calls such as printf etc.
  • There are already commands to read/write memory and peripheral registers, but via C-scripting you can extend and implement new functions and commands.
  • You can add new features such as to open, read and write SD cards, to use board features and devices ...

Please find the ZIP with the project below (for Coocox).

The project is not really cleaned, it has much more file as needed and commented code intended to be used on other platforms.

In order to use it:

  • You should have an UART terminal program, e.g. TeraTerm [5][6] or Hyperterm
  • Potentially you have to install the STM UART VCP driver on the PC


Please, if you want to try, download the Cooxox project here.

Download picoc_Discovery project (2.4 MB)

If you have STM32 ST-LINK Utility [8] installed then you can download the image BIN file and flash directly

Download picoc_Discovery image (12 KB)

You should search for the STM USB UART VCP driver [7] for the PC, or try this:

Download STM UART VCP driver (12 KB)


Discovery USB UART with Pico-C Discovery USB UART with Pico-C Discovery USB UART with Pico-C


[1] ST: STMF4 Discovery

[2] Order at Digikey

[3] other STMF4 Discovery stuff

[4] Coocox ARM compiler IDE

[5] TeraTerm Terminal application

[6] TeraTerm Wikipedia

[7] STM USB VCP driver

[8] STM32 ST-LINK Utility