Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
5 years, 9 months ago.
Why we cannot use FastPWM.h with NUCLEO-F031K6 ???
Hi everyone,
This morning, I meet a problem with using the FastPWM librairy with the NucleoF031K6.
Only with writing :
- include "FastPWM.h"
it cannot compile and I have this error :
Error: Undefined symbol getChannel(TIM_TypeDef*, PinName) (referred from FastPWM_STM_TIM.NUCLEO_F031K6.o).
The code is really simple :
- include "mbed.h"
- include "FastPWM.h"
FastPWM clock_system(A6,1);
int main() { clock_system.period_us(0.24f); period : 0.24µs clock_system.write(0.50f);; duty cyle 50% }
I don't know if there are mistakes but if you have the answer to my problem, I'll take it !
Thanks by advance!
Question relating to:

1 Answer
5 years, 9 months ago.
Your Board isn't supported by the library, however you can add yours as described in
https://os.mbed.com/users/Sissors/code/FastPWM/
under the section 'Adding other microcontrollers '
You have to add your microcontroller in the file FastPWM_STM_TIM_PinOut.cpp in the folder 'Device' within the imported library FastPWM
Change line 3 from
#if defined (TARGET_NUCLEO_F030R8) || (TARGET_DISCO_F051R8)
to
#if defined (TARGET_NUCLEO_F030R8) || (TARGET_DISCO_F051R8 ||(TARGET_NUCLEO_F031K6))