Using NetBeans and Gnu ARM tools, I was able to build and run the ChibiOS/RT demos for the STM32F4 discovery board.  I downloaded the zip file containing the latest version of ChibiOS/RT and extracted it to my NetBeansProjects folder.  To build a project:

  • File -> New Project -> C/C++ -> C/C++ Project with Existing Sources
  • Browse to the appropriate directory e.g:
    • …./NetBeansProjects/ChibiOS_2.6.7/demos/ARMCM4-STM32F407-DISCOVERY
  • Select Tool Collection as GNU ARM
  • Select Automatic Configuration Mode

That’s it, the project is imported and automatically builds!  You can load it onto the target using st-flash and debug it (if desired) using st-util:

  • st-flash write \Users\dalbert\Documents\NetBeansProjects\ChibiOS_2.6.7\demos\ARMCM4-STM32F407-DISCOVERY\build\ch.bin 0x8000000
  • st-util  (make sure you’ve configured build/ch.elf as the project Properties->Build->Make->Build Result)

I’ve built and tested the three STM32F4-DISCOVERY demos and they all ran successfully including the VCP USB comm port with command interpreter in the MEMS demo.

I’ve also built the ChibiOS/RT + lwIP + PPP application here which required a few fixes and must be linked with ChibiOS/RT 3.x but then runs nicely using the serial port (PA2, PA3) to serve a PPP connection.  I have two directories under NetBeansProjects:
Then I create a symlink under stm32f4-chibi-…-master/lib called ChibiOS-RT that links to ../../ChibiOS_3.0.x.

On the remote terminal (linux box) side, I configured /etc/ppp/options including the serial port I was connected to (/dev/ttyUSB0) and the baudrate (38400); the whole file looks like this:

# Prevent pppd from forking into the background
# wait for connection if none initially found
# no hardware flow control
# don’t use modem control lines
# create a default route for this connection in the routing table
# no authorization required
# ensure exclusive access to the serial device
# do not set up any escaped control sequences
asyncmap 0
# use a maximum transmission packet size of 552 bytes
mtu 552
# use a maximum receive packet size of 552 bytes
mru 552
# IP stack configuration

Launch pppd specifying localip:remoteip: which generate the ppp0 network interface (shows on ifconfig):

sudo pppd

Reset the discovery board and the PPP connection is up!  You can ping the discovery board (ping and can bring up a remote shell connection using netcat: nc 25  (note to send a CR requires Ctrl-V <enter><enter>).