[ell-i-developers] Serial on stm32f334nucleo

  • From: Ivan Raul <supra.material@xxxxxxxxx>
  • To: "ell-i-developers@xxxxxxxxxxxxx" <ell-i-developers@xxxxxxxxxxxxx>
  • Date: Wed, 17 Sep 2014 21:31:23 +0200

Hi to all,

I was wondering if it is possible to receive serial communication through
the stlink bridge of the nucleo. In fact, is possible, and I already
provided a pull request for the change. I hope it helps a little for the
testing of the new PoElli in the next weeks.

Please, test accordingly :)

mkdir temp
cd temp
git clone https://github.com/supramaterial/Runtime.git
cd Runtime/stm32/build/
make sketch.cpp

#then, for testing, modify the sketch.cpp to something like this:
##---------------------------

#include <Arduino.h>

void setup() {
    Serial.begin(57600);
}

void loop() {

    Serial.write('H');
    Serial.write('e');
    Serial.write('l');
    Serial.write('l');
    Serial.write('o');
    Serial.write('\r');
    Serial.write('\n');

    for (volatile int i = 0; i < 100000; i++)
        ;

}

##------------------------

#then
make VARIANT=stm32f334nucleo

#and flash
sudo st-flash write hardware/stm32f334nucleo/sketch.bin 0x8000000

#the good part is that the stlink controller provides the USART2 through
#the usb, in linux it shows as /dev/ttyACM0

#now, to test, use a serial console, minicom, for example

#if minicom not installed
sudo apt-get install minicom
sudo minicom -s
#go to "serial port setup"
#configure in this way

+------------------------------------------
| A -    Serial Device      : /dev/ttyACM0
| B - Lockfile Location     : /var/lock
| C -   Callin Program      :
| D -  Callout Program      :
| E -    Bps/Par/Bits       : 57600 8N1
| F - Hardware Flow Control : No
| G - Software Flow Control : No
|
|    Change which setting?
+------------------------------------------

#then "save setup as dfl"

#and run minicom
sudo minicom

#it should show "hello" iteratively

With Warm Regards, Ivan Raul

Other related posts: