Introducing the new delivery for STM

The official STMicroelectronics Arduino core
User avatar
RogerClark
Posts: 5951
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Introducing the new delivery for STM

Post by RogerClark » Wed Sep 28, 2016 9:49 pm

I only used the underscores as this was the Arduino standard at the time ( as far as I could see).

But perhaps they are redundant

zmemw16
Posts: 1157
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: Introducing the new delivery for STM

Post by zmemw16 » Thu Sep 29, 2016 9:47 pm

i've always thought they were from a coding standard for defining 'system' aspects.
the underscores help their uniqueness, but i'm never sure whether it should be one or two of those. :D

stephen

danieleff
Posts: 270
Joined: Thu Sep 01, 2016 8:52 pm
Location: Hungary
Contact:

Re: Introducing the new delivery for STM

Post by danieleff » Mon Oct 03, 2016 11:16 am

The F1 code uses HAL_GetTick() for millis() calculation but the L4 uses the TIM5 timer in clock.c. Why is that?

User avatar
RogerClark
Posts: 5951
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Introducing the new delivery for STM

Post by RogerClark » Mon Oct 03, 2016 8:17 pm

Interesting

I wonder if my drystone test results are correct as the show a 80MHz L476 is considerably slower than a 72MHz F103 ( albeit the F103 tests use libmaple and the L4 use STM's HAL based core)

Perhaps an interrupt is wasting a lot of processing power, or the millis() isnt accurate on the L4 core

User avatar
Wi6Labs
Posts: 20
Joined: Fri Sep 16, 2016 11:39 am
Location: Rennes, France
Contact:

Re: Introducing the new delivery for STM

Post by Wi6Labs » Tue Oct 04, 2016 2:37 pm

danieleff wrote:The F1 code uses HAL_GetTick() for millis() calculation but the L4 uses the TIM5 timer in clock.c. Why is that?
Because the number of timer is limited on STM32F103RB. So we leave the timers for the other tasks (PWM, Tone, servo, ...).
Wi6Labs team

edogaldo
Posts: 250
Joined: Fri Jun 03, 2016 8:19 am

Re: Introducing the new delivery for STM

Post by edogaldo » Tue Oct 04, 2016 4:02 pm

Wi6Labs wrote:ST developed the NUCLEO board support for:
  • STM32F103RBT6 STM32F303RET6 STM32F429ZIT6 STM32L476RG STM32F091RCT6 STM32L053R8T6
As I can understand as of now only the cores for STM32F103RBT6 and STM32L476RG have been released, correct?
If yes, when will the other cores be released?
Wi6Labs wrote:
danieleff wrote:The F1 code uses HAL_GetTick() for millis() calculation but the L4 uses the TIM5 timer in clock.c. Why is that?
Because the number of timer is limited on STM32F103RB. So we leave the timers for the other tasks (PWM, Tone, servo, ...).
As a general rule, is it better to use gp timers for millis() rather than systick when possible? Why didn't you use systick also for the L4 core?


Thanks in advance and bye, E.

User avatar
Wi6Labs
Posts: 20
Joined: Fri Sep 16, 2016 11:39 am
Location: Rennes, France
Contact:

Re: Introducing the new delivery for STM

Post by Wi6Labs » Wed Oct 05, 2016 1:31 pm

edogaldo wrote:
Wi6Labs wrote:ST developed the NUCLEO board support for:
  • STM32F103RBT6 STM32F303RET6 STM32F429ZIT6 STM32L476RG STM32F091RCT6 STM32L053R8T6
As I can understand as of now only the cores for STM32F103RBT6 and STM32L476RG have been released, correct?
If yes, when will the other cores be released?
We don't know when ST will release the other cores.
edogaldo wrote:
Wi6Labs wrote:
danieleff wrote:The F1 code uses HAL_GetTick() for millis() calculation but the L4 uses the TIM5 timer in clock.c. Why is that?
Because the number of timer is limited on STM32F103RB. So we leave the timers for the other tasks (PWM, Tone, servo, ...).
As a general rule, is it better to use gp timers for millis() rather than systick when possible? Why didn't you use systick also for the L4 core?
If you need only millisecond delay, the easiest way is to use systick (and you will save resource). But use systick for microsecond is not natural.
So we preferred to use timer in our implementation. F1 is the exception that shows another solution.
Wi6Labs team

User avatar
RogerClark
Posts: 5951
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Introducing the new delivery for STM

Post by RogerClark » Wed Oct 05, 2016 8:00 pm

I think the Arduino ARM based boards e.g. the Due, use systick for millis()

So perhaps this is the norm for Arduino cores. ( libmaple also uses systick for millis())

If systick is available, it seems the logical way to maintain a millisecond counter as there is no MCU CPU overhead for this operation.
I.e the MCU hardware prescales the master clock and then auto incremenets a register.

I wonder what other use systick is performing on the L4 core if its not counting millis()

I presume it must be doing something else, otherwise a general purpose timer is being wasted for millis() when it could be used for something else

User avatar
Slammer
Posts: 241
Joined: Tue Mar 01, 2016 10:35 pm
Location: Athens, Greece

Re: Introducing the new delivery for STM

Post by Slammer » Wed Oct 05, 2016 9:16 pm

Specially for the arduino API, I dont find a reason not to use systick. Arduino's millisecond timer is an always-on timer with fixed period.
Systick is not available on all ARM cores but all members of STM32 family have systick, so, it is not problem to use it globally.

User avatar
RogerClark
Posts: 5951
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Introducing the new delivery for STM

Post by RogerClark » Wed Oct 05, 2016 11:08 pm

@slammer

Do the Cortex M0 also have it ?

I know the nRF51822 Cortex M0 does not have systick, but this is probably something to do with the nRF51 hardware and not that its a Cortex M0

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest