Hi, Filip,
Pls refer to the link:
3-Phase Brushless DC Motor Control Design|NXP
and download the "software for 3-Phase Brushless DC(BLDC) Motor Control" package.
after you unzip it, you can see that it only supports TWRKV10/11/31/46/58, it does not support TWR-K40D100 board.
But you can check the code and port it to TWR-K40100D yourself.
Hope it can help you
BR
xiangjun rong