Search found 165 matches

by fpiSTM
Tue Sep 19, 2017 2:40 pm
Forum: PR's bugs and enhancements
Topic: PR to add optimisation menu (to all boards individually)
Replies: 22
Views: 418

Re: PR to add optimisation menu (to all boards individually)

To conclude, by adding:

Code: Select all

uint32_t __attribute__((optimize("Os"))) pulseIn( uint32_t pin, uint32_t state, uint32_t timeout )
This will avoid any issue and allow to keep hardcoded clock cycle to 16 even if opt is changed.
by fpiSTM
Tue Sep 19, 2017 9:30 am
Forum: STM Core
Topic: pwm functions not working
Replies: 5
Views: 64

Re: pwm functions not working

the define for the L476 is here: https://github.com/stm32duino/Arduino_Core_STM32/blob/ac89c2d8d86d965099cf2e79c46b2de7bc1a2f0d/variants/NUCLEO_L476RG/variant.h#L120 So you have to go in the core installation folder: https://github.com/stm32duino/wiki/wiki/Where-are-sources and edit: variants/NUCLEO...
by fpiSTM
Tue Sep 19, 2017 7:02 am
Forum: STM Core
Topic: pwm functions not working
Replies: 5
Views: 64

Re: pwm functions not working

Currently, this core implement the Arduino API an so there is no API to do this.
PWM_FREQUENCY in variant.h could be changed at this time.
This is planned to add this function when the PWM (analog feature) will be enhanced
by fpiSTM
Tue Sep 19, 2017 4:35 am
Forum: STM Core
Topic: pwm functions not working
Replies: 5
Views: 64

Re: pwm functions not working

Hi, you should see: https://www.arduino.cc/en/Reference/AnalogWrite And do it on a pin which have PWM capability, see PeripheralPins.cpp in the Nucleo L476 variant folder: https://github.com/stm32duino/Arduino_Core_STM32/blob/master/variants/NUCLEO_L476RG/PeripheralPins.c#L111 So for example for the...
by fpiSTM
Tue Sep 19, 2017 4:22 am
Forum: PR's bugs and enhancements
Topic: PR to add optimisation menu (to all boards individually)
Replies: 22
Views: 418

Re: PR to add optimisation menu (to all boards individually)

I actually had hoped that you would say it's ok to use it :( I tried to use the DWT CYCNT for F103 but I do not succeed to write properly the DWT CTRL register. I think it locked by default (probably because I used STLink) so it required to be unlocked. I found this nice example and think I'm in th...
by fpiSTM
Tue Sep 19, 2017 4:12 am
Forum: PR's bugs and enhancements
Topic: PR to add optimisation menu (to all boards individually)
Replies: 22
Views: 418

Re: PR to add optimisation menu (to all boards individually)

I tried quickly yesterday and it seems to work, but I use the arm gcc v6, I do not test for v4.8 #pragma GCC push_options #pragma GCC optimize ("Os") your function #pragma GCC pop_options After check the gcc documentations, it should work for 4.8: https://gcc.gnu.org/onlinedocs/gcc-4.8.3/gcc/Functio...
by fpiSTM
Mon Sep 18, 2017 3:39 pm
Forum: PR's bugs and enhancements
Topic: PR to add optimisation menu (to all boards individually)
Replies: 22
Views: 418

Re: PR to add optimisation menu (to all boards individually)

Thanks Victor, I will check about the optimize. :)
About the DWT CYCCNT, I'm just stating the investigation and I think I will not use that as not supported by M0 family. And probably you're right about debugging effect.
by fpiSTM
Mon Sep 18, 2017 8:52 am
Forum: PR's bugs and enhancements
Topic: PR to add optimisation menu (to all boards individually)
Replies: 22
Views: 418

Re: PR to add optimisation menu (to all boards individually)

You could try to add this is the impacted function: __asm__("") This will tell to the compiler to not optimize the function. See https://gcc.gnu.org/onlinedocs/gcc-4.8.5/gcc/Function-Attributes.html#Function-Attributes noinline This function attribute prevents a function from being considered for in...
by fpiSTM
Mon Sep 18, 2017 8:24 am
Forum: PR's bugs and enhancements
Topic: PR to add optimisation menu (to all boards individually)
Replies: 22
Views: 418

Re: PR to add optimisation menu (to all boards individually)

@RogerClark, just FYI, I'm updating the pulseIn() function for the Arduino_Core_STM32 in order to have a better precision. I saw you have hard coded the number of cycle per iteration (to 16) but since this new menu, depending of the optimization selected, this number is not always the same so the du...