STM32L4 Core

Cores are the underlying magic that make the Arduino API possible
User avatar
GrumpyOldPizza
Posts: 174
Joined: Fri Apr 15, 2016 4:15 pm
Location: Denver, CO

Re: STM32L4 Core

Post by GrumpyOldPizza » Tue Sep 13, 2016 12:02 pm

inaba_nl wrote:sorry for the late response ^^;

you said the platform is open? if so, why not the bootloader? (just questioning)
I am not sure what you are referring to with the "bootloader". We do use the regular onchip "STM32 BOOTLOADER" to reflash the user flash (which would be under ST's control). All the rest of the code is on github. What are you missing ?

User avatar
GrumpyOldPizza
Posts: 174
Joined: Fri Apr 15, 2016 4:15 pm
Location: Denver, CO

Re: STM32L4 Core

Post by GrumpyOldPizza » Thu Sep 15, 2016 11:49 am

GrumpyOldPizza wrote:
inaba_nl wrote:sorry for the late response ^^;

you said the platform is open? if so, why not the bootloader? (just questioning)
I am not sure what you are referring to with the "bootloader". We do use the regular onchip "STM32 BOOTLOADER" to reflash the user flash (which would be under ST's control). All the rest of the code is on github. What are you missing ?
Ah I think now I understand what you are referring to, the file under the "bootloaders" directory. That is actually just the regular "Blinky" sketch from Arduino. The UCB/CDC core is part of every sketch, which switches the the STM32L476 part back into USB/DFU mode. So really nothing magic there, other than you need to get one of those sketches onto the chip before the normal, simpler upload process will work.

inaba_nl
Posts: 10
Joined: Thu Jul 14, 2016 9:07 pm

Re: STM32L4 Core

Post by inaba_nl » Tue Sep 27, 2016 12:10 am

GrumpyOldPizza wrote:
GrumpyOldPizza wrote:
inaba_nl wrote:sorry for the late response ^^;

you said the platform is open? if so, why not the bootloader? (just questioning)
I am not sure what you are referring to with the "bootloader". We do use the regular onchip "STM32 BOOTLOADER" to reflash the user flash (which would be under ST's control). All the rest of the code is on github. What are you missing ?
Ah I think now I understand what you are referring to, the file under the "bootloaders" directory. That is actually just the regular "Blinky" sketch from Arduino. The UCB/CDC core is part of every sketch, which switches the the STM32L476 part back into USB/DFU mode. So really nothing magic there, other than you need to get one of those sketches onto the chip before the normal, simpler upload process will work.

yes i meant that ^^;

anyhow, still didn't had the time to explore the features of the dragonfly tbh.
but my plant on creating a watch based on the platform is still there :)

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

Re: STM32L4 Core

Post by RogerClark » Tue Sep 27, 2016 12:50 am

inaba_nl wrote: but my plant on creating a watch based on the platform is still there :)
I think you may be better off creating a watch with a nRF52 or nRF51 instead of the L4, purely because of the Bluetooth part of the nRF52 or nRF51

User avatar
GrumpyOldPizza
Posts: 174
Joined: Fri Apr 15, 2016 4:15 pm
Location: Denver, CO

Re: STM32L4 Core

Post by GrumpyOldPizza » Tue Sep 27, 2016 3:54 pm

RogerClark wrote:
inaba_nl wrote: but my plant on creating a watch based on the platform is still there :)
I think you may be better off creating a watch with a nRF52 or nRF51 instead of the L4, purely because of the Bluetooth part of the nRF52 or nRF51
An interesting thought. I have been looking into nRF52 quite a bit. IMHO the nRF51 is irrelevant at that point of time due to the severe CPU limitations.

Anyway, STM32L4 is substantially better than nRF52 when it comes to lowpower. nRF52 has no sleep mode clock gating for example. It also always runs at 64MHz, while with STM32L4 you can throttle the clock if you need to.

The only advantage that nRF52 has is that it has the BLE/ANT+ stack more or less integrated. That might win out over a STM32L4+external-BLE.

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

Re: STM32L4 Core

Post by RogerClark » Tue Sep 27, 2016 8:48 pm

I'm not sure what severe limitations the nRF51 has.

The clock speed is low by comparison with modern ARM devices, as it only runs at 16MHz, but its got 32k RAM (in the QFAC version) which is more than the BluePill etc, and it has 256k flash ( in the QFAA and QFAC versions).

For anyone currently using AVR hardware, the nRF51 is a significantly better device.

In my experience, the low power consumption is also very good, i.e from memory the low power modes operate in the micro amps range.

Price is also good on the nRF51, probably as its now not the flagship device for Nordic, hence loads more Chinese manufacturers are switching to it instead of the CC2541.

So there are loads more hackable nRF51 devices coming into the market, which is great news for the Maker and Arduino community

User avatar
GrumpyOldPizza
Posts: 174
Joined: Fri Apr 15, 2016 4:15 pm
Location: Denver, CO

Re: STM32L4 Core

Post by GrumpyOldPizza » Tue Sep 27, 2016 9:49 pm

RogerClark wrote:I'm not sure what severe limitations the nRF51 has.

The clock speed is low by comparison with modern ARM devices, as it only runs at 16MHz, but its got 32k RAM (in the QFAC version) which is more than the BluePill etc, and it has 256k flash ( in the QFAA and QFAC versions).

For anyone currently using AVR hardware, the nRF51 is a significantly better device.

In my experience, the low power consumption is also very good, i.e from memory the low power modes operate in the micro amps range.

Price is also good on the nRF51, probably as its now not the flagship device for Nordic, hence loads more Chinese manufacturers are switching to it instead of the CC2541.

So there are loads more hackable nRF51 devices coming into the market, which is great news for the Maker and Arduino community
My comment was regards comparing Cortex-M0 vs. Cortex-M4. You are absolutely right that comparing a AVR vs. a Cortex-M0, a Cortex-M0 will most likely win.

It's my understanding that for the M0 core in the nRF51 the Systick got not implemented. That would force you to use one of the RTC peripherals, clocked off 32768Hz. So a lot of the standard Cortex-M0 code will not work that easily. Bunch of details like this that derail you coming from other Cortex-M0 products.

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

Re: STM32L4 Core

Post by RogerClark » Tue Sep 27, 2016 11:27 pm

GrumpyOldPizza wrote: It's my understanding that for the M0 core in the nRF51 the Systick got not implemented. That would force you to use one of the RTC peripherals, clocked off 32768Hz. So a lot of the standard Cortex-M0 code will not work that easily. Bunch of details like this that derail you coming from other Cortex-M0 products.
Yes. Unfortunately it doesnt have systick :-(

So the work around is to use a timer to generate these (which is one less timer that can be used for other purposes)

I think hardware PWM is limited to 3 pins, partially because of this and generally the lack of timers. So people have written a softPWM lib to partially get around the problem.

I'm currently trying to get a nRF51 watch to keep time using an interrupt every second, and this seems generally OK, but I the watch suddenly lost or gained a load of time after I left it running for about 8 hours.

Actually I want to run it from the 32khz crystal, as I want to run the whole device in its low power mode most of the time, and I think in that mode, it is actually running the whole processor from the 32khz crystal rather than the 16Mhz

Luckily most of the nRF51 devices I have, contain the 32Khz, as if they don't then keeping time is a pain, as it requires constant recalibration of the 32kHz RC Osc against the 16Mhz main system clock, which entails the MCU waking up to calibrate its self every few seconds. (though this setting can be changed to shorter or longer durations)

User avatar
GrumpyOldPizza
Posts: 174
Joined: Fri Apr 15, 2016 4:15 pm
Location: Denver, CO

Re: STM32L4 Core

Post by GrumpyOldPizza » Wed Sep 28, 2016 11:31 am

RogerClark wrote: Actually I want to run it from the 32khz crystal, as I want to run the whole device in its low power mode most of the time, and I think in that mode, it is actually running the whole processor from the 32khz crystal rather than the 16Mhz

Luckily most of the nRF51 devices I have, contain the 32Khz, as if they don't then keeping time is a pain, as it requires constant recalibration of the 32kHz RC Osc against the 16Mhz main system clock, which entails the MCU waking up to calibrate its self every few seconds. (though this setting can be changed to shorter or longer durations)
Sorry cannot help there. nRF52 seemed to have 2 clock paths, whereby the 32kHz could not drive the main 64MHz.

BTW, something interesting we have been toying around with (where my judgement from nRF51 vs. nrF52 comes from):

https://oshpark.com/shared_projects/H0zYlRI5

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

Re: STM32L4 Core

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

Interesting.

I bought a small nRF51 module from a german vendor on eBay, and it arrived yesterday.
But I have not had time to even solder some tiny wires to it.

BTW. if you are playing with nRF52, I hear the first version of the device has a number of Errata in its silicon.
There are work-arounds for this, but its the reason why at the moment I only bought one nRF52, as I could not confirm the revision number ( as it is inside a metal enclosure on the PCB)

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest