STM32 Nucleo HowTo

The Nucleo is not as popular as the Arduino, but here are some useful resources.

Excellent PDF to start with a STM Nucleo and a few components (Led, push button ...)  http://www.tamberg.org/fhnw/2015/LoRaWANIoTPrototyping.pdf Very basic, but very helpful.

The debug console

On Linux just use Minicom. You only have to specify 9600 baud. Other default values should be OK.

Type this in a terminal: 'minicom -b 9600 -D /dev/ttyACM0'.
And you should see the  'printf("Bonjour !\r\n");'  in your C program.

The pins, where to plug stuff

Of course it depends on your Nucleo board, but for the  L053R8, look at the Nucleo PinOut section. You have the Arduino and the Morpho headers, then focus on the PinNames.h file.
Also keep in mind the warning about D0 and D1 that are not usable, because shared for the USB communication.

Problem is that ST web site is a bit cluttered with tons of informations and it is not easy to find the relevant ones to start.


I am still reading the ST various documentation, but I did not yet find anything as useful and simple as the slides (see above) 


Midi keyboard AKAI LPK25 velocity problem

I have a cheap AKAI LPK25 MIDI keyboard. I it nice, but unusable due to unreliable sensibility. There is a utility: aseqdump that will dump MIDI messages. aseqdump -l will list the Midi client connected ; "-p client" will dump the specific client MIDI messages
  • ON PC, the plugin "MIDI velocity adjust" by Robin Gareus is excellent to compensate the poor physical MIDI keyboard.
  • Android does not seem to feature such filter. Neither does Caustic: http://singlecellsoftware.com/node/13935
To measure the problem:
$ aseqdump -p24 | tee lpk25.txt | sed --quiet -e 's/^.*Note on .*elocity //p'
 # Type some random string on the keyboard ...
$ cat lpk25.txt | sed --quiet -e 's/^.*Note on .*elocity //p' > lpk25.dat
$ cat lpk25.gp   
  n=127 #number of intervals  
  max=128. #max value  
  min=1. #min value  
  width=(max-min)/n #interval width  
  #function used to map a value to the intervals  
  hist(x,width)=width*floor(x/width)+width/2.0  set boxwidth width*0.9  
  #count and plot  
  plot "lpk25.dat" u (hist($1,width)):(1.0) smooth freq w boxes lc rgb"green" notitle

Finally plot the thing:
$ gnuplot -pc lpk25.gp
Velocity goes from 1 to 127. hitting the keys randomly for a while shows that it is not well balanced. There is a huge spike at 1. The aim is to set a minimum value somehow.

March summary - 2017-03

03 Mars



  • Security & AI
    • The scope is wider, with this insidious trends:
      • AI can find the most efficient way to influence you, analysing your tweets, Facebook and so on ...
    • Breaking Google security with Google services! ReCaptcha broken with AI https://east-ee.com/2017/02/28/rebreakcaptcha-breaking-googles-recaptcha-v2-using-google/
    • Very informed Podcast on the subject RiskyBusiness "Machine Learning: Woot or woo?" https://risky.biz/RB449/ others episodes mention AI also.
      • Key point is that Neural Networks will find solutions that are not human understandable. Of course, you can look at what it does. You have access to all the intermediates steps and all the variables, un-like a real brain for example. But that does not mean that the operations will makes sense to you. Unless you are applying Neural Networks to trivial physical data, like the position, speed, mass of a ball, you will not end-up with an nice equation showing that the speed is proportional to the weight and not to its color for example.  You end-up blindly trusting a system that is somehow better than you. But AI fails in unexpected ways that we might learn the hard ways. (and hackers may learn faster.)


Inspirational sites about IoT, DIY, makers ...

Continuing the quest for DIY components ...

Inspirational sites:

  • https://HackADay.io/
  • https://www.SparkFun.com/
  • https://www.itead.cc/
  • https://www.logre.eu/wiki/Commandes_groupées

  • Excellent PDF to start with a STM Nucleo and a few components (Led, push button ...)  http://www.tamberg.org/fhnw/2015/LoRaWANIoTPrototyping.pdf Very basic, but very helpful.

    Education about electrical motors

    I guess I should investigate the ST educational material. Looks like it is more in the spirit of what I want to do ...
    There are also tons of YouTube video to explains all kind of electrical motors. Not only brushed, brushless, AC, DC, universal ...

    Sound banks

    "Conserve the sound" http://www.conservethesound.de/  online museum for vanishing and endangered sounds. The sound of a dial tel...