Potential for a STM32U5 based DM42

This is where developers can exchange ideas and ask questions relevant to the DM42 firmware.

Please note that Swiss Micros staff are unable to provide answers here as a general rule. This is intended as a community-driven forum.
squid2
Posts: 4
Joined: Fri Oct 15, 2021 10:56 pm

Potential for a STM32U5 based DM42

Post by squid2 »

The current DM42 uses the STM32L476VG microcontroller, which was best in class for performance per milliwatt at the time of release. Recently, STMicro released the STM32U5 series which is more than twice as energy efficient (19 uA/MHz vs 39 uA/MHz, and the Cortex M33 also does a bit more per clock cycle than the M4), and can achieve more than double the peak performance in the same power budget. The STM32U5 also brings USB-C support. While the DM42 already has pretty decent performance and battery life, a new version based on the STM32U5 could double both, and also replace the micro-USB with USB-C. The U5 family is the successor to the L4 and L5 families, and the peripherals and BSP are similar, so it shouldn’t be overly difficult to migrate DMCP to the newer MCU (though it would still take some effort).

I think a lot of existing DM42 users would be eager to upgrade to a new version (maybe called DM42S) based on the STM32U5 and equipped with USB-C. Who else would be eager to buy such a device?
Last edited by squid2 on Mon Oct 18, 2021 5:16 am, edited 1 time in total.
thx1138
Posts: 24
Joined: Mon Jan 25, 2021 10:28 pm

Re: Potential for a STM32U5 based DM42

Post by thx1138 »

Count me in!
HP-15C(&LE), (2) HP-28S, HP-32Sii, HP-33S, HP-35S, HP-40gs (NewRPL), (3) HP-41CX, HP-42S, (2) HP-48SX, HP-48G+, HP-48GX, (2) HP-49g+, HP-50g (5 std,, 1 NewRPL), HP-71B, HP Prime G1/G2, WP-34S, DM15L, DM32, (3) DM42 (std, WP43S, C43), (2) DM41X
toml_12953
Posts: 795
Joined: Wed May 03, 2017 7:46 pm
Location: Malone, NY USA

Re: Potential for a STM32U5 based DM42

Post by toml_12953 »

squid2 wrote:
Sun Oct 17, 2021 8:41 pm
The current DM42 uses the STM32L476ZG microcontroller, which was best in class for performance per milliwatt at the time of release. Recently, STMicro released the STM32U5 series which is more than twice as energy efficient (19 uA/MHz vs 39 uA/MHz, and the Cortex M33 also does a bit more per clock cycle than the M4), and can achieve more than double the peak performance in the same power budget. The STM32U5 also brings USB-C support. While the DM42 already has pretty decent performance and battery life, a new version based on the STM32U5 could double both, and also replace the micro-USB with USB-C. The U5 family is the successor to the L4 and L5 families, and the peripherals and BSP are similar, so it shouldn’t be overly difficult to migrate DMCP to the newer MCU (though it would still take some effort).

I think a lot of existing DM42 users would be eager to upgrade to a new version (maybe called DM42S) based on the STM32U5 and equipped with USB-C. Who else would be eager to buy such a device?
I would. Is the new chip 100% compatible with code written for the old one? Is it pin compatible? If yes to both, it's a no-brainer.
Tom L

Some people call me inept but I'm as ept as anybody!
DM10L SN: 059/100
DM41X SN: 00023 (Beta)
DM41X SN: 00506 (Shipping)
DM42 SN: 00025 (Beta)
DM42 SN: 00221 (Shipping)
WP43 SN: 00025 (Prototype)
squid2
Posts: 4
Joined: Fri Oct 15, 2021 10:56 pm

Re: Potential for a STM32U5 based DM42

Post by squid2 »

toml_12953 wrote:
Mon Oct 18, 2021 3:33 am
I would. Is the new chip 100% compatible with code written for the old one? Is it pin compatible? If yes to both, it's a no-brainer.
The current chip is a STM32L476VGT6. The closest equivalent in the new family is the STM32U575VG, which has a similar (but upgraded) feature set, same LQFP100 package, same pinout, and same 1 MB of flash. There's also the STM32U575VI, which is the same except for having 2 MB of flash instead of 1 MB.

Software-wise, the new chip is not binary compatible, though the hardware peripherals are similar (just extended a bit), and the BSP (Board Support Package) APIs are mostly compatible. Some software changes and recompilation would be needed to migrate from the L4 to U5 series, but no massive changes, and I don't expect it to be very difficult to maintain support for both with the same codebase.

If they are to switch to USB-C too (not essential but nice to have), some minor PCB changes would be needed but nothing major again.
squid2
Posts: 4
Joined: Fri Oct 15, 2021 10:56 pm

Re: Potential for a STM32U5 based DM42

Post by squid2 »

I did some more reading on the respective datasheets:

https://www.st.com/en/microcontrollers- ... 476vg.html
https://www.st.com/en/microcontrollers- ... 575vg.html

The new MCU is more than twice as fast, though the efficiency gains are not quite as clear-cut as the headline uA/Mhz figures quoted in marketing materials.

The older STM32L4 based on a 90nm process has lower leakage in SRAM, so it uses less than half the current to retain the same amount of memory contents in standby (the STM32U5 has 6x the SRAM, but you can disable portions to save power). Thus, while the current MCU could theoretically retain its RAM contents for up to 20+ years on a coin cell, the STM32U5 in standby would drain the battery in around 10 years retaining a similar amount of RAM.

Active mode power consumption on the U5 is definitely lower than the L4 for equivalent performance levels, though apart from the 24 MHz mode, efficiency gains are more modest than the best case marketing numbers. The good news is that the 24 MHz mode is around the current speed the DM42 operates at, and reducing the current draw to nearly half can more than double the battery life due to high current draw behaviour of CR2032 batteries. Keep in kind the Cortex M33 can do around 20% more per clock cycle, but that depends on the workload (instructions being used), so let's just compare numbers at the same clock speed. A big difference is that the U5 has an integrated switching voltage regulator (SMPS), while the L4 only has a linear regulator (LDO) built in, though an external regulator can be used to get the right core voltage. I haven't yet examined the DM42 PCB to see if it's using an external switching regulator to generate the CPU core voltage.

The current numbers below are taken from the respective datasheets, for 3.3V supply, 25 Celsius, all peripherals disabled.

STM32L476VG on Internal LDO:
  • 26 MHz, Voltage Range 1: 2.88 mA
  • 24 MHz, Voltage Range 2: 3.21 mA
  • 80 MHz, Voltage Range 2: 10.2 mA
STM32L476VG on External SMPS at 1.1V:
  • 24 MHz: 1.15 mA
  • 80 MHz: 3.67 mA
STM32U575VG on Internal LDO:
  • 24 MHz, Voltage Range 4: 1.75 mA
  • 72 MHz, Voltage Range 2: 6.00 mA
  • 110 MHz, Voltage Range 2: 8.80 mA
  • 160 MHz, Voltage Range 1: 13.50 mA
STM32U575VG on Internal SMPS (with external passives):
  • 24 MHz, Voltage Range 4: 0.73 mA
  • 72 MHz, Voltage Range 2: 3.05 mA
  • 110 MHz, Voltage Range 2: 4.40 mA
  • 160 MHz, Voltage Range 1: 7.15 mA
The headline figure for the STM32U5 is the 0.73 mA at 24 MHz using the built-in SMPS at Voltage Range 4. For comparison, the STM32L4 draws 1.15 mA at 24 MHz on an external SMPS, and 2.88 mA at 26 MHz using the built-in LDO. I haven't yet checked if the DM42 is using an external SMPS to produce the core voltage for the STM32L4, or just using the built in LDO regulator. Regardless, the STM32L5 can give major gains in battery life for active use since 24 MHz is the CPU speed usually used on battery.
CwD
Posts: 2
Joined: Tue Sep 28, 2021 5:08 pm

Re: Potential for a STM32U5 based DM42

Post by CwD »

Mostly indifferent to the speed changes, it hasn't been a limitation for me at all, but I'd consider upgrading just for USB C. I'd rather not have to keep USB Micro cables around.
User avatar
ijabbott
Posts: 253
Joined: Fri Dec 15, 2017 2:34 pm
Location: GB-MAN

Re: Potential for a STM32U5 based DM42

Post by ijabbott »

Potential for a DM50?
thx1138
Posts: 24
Joined: Mon Jan 25, 2021 10:28 pm

Re: Potential for a STM32U5 based DM42

Post by thx1138 »

ijabbott wrote:
Tue Oct 19, 2021 8:09 pm
Potential for a DM50?
NOW you're talking!
HP-15C(&LE), (2) HP-28S, HP-32Sii, HP-33S, HP-35S, HP-40gs (NewRPL), (3) HP-41CX, HP-42S, (2) HP-48SX, HP-48G+, HP-48GX, (2) HP-49g+, HP-50g (5 std,, 1 NewRPL), HP-71B, HP Prime G1/G2, WP-34S, DM15L, DM32, (3) DM42 (std, WP43S, C43), (2) DM41X
squid2
Posts: 4
Joined: Fri Oct 15, 2021 10:56 pm

Re: Potential for a STM32U5 based DM42

Post by squid2 »

ijabbott wrote:
Tue Oct 19, 2021 8:09 pm
Potential for a DM50?
But with a HP-48GX style keyboard. Use the DM42’s screen and case design/form factor. Pair it with the new STM32U5 MCU, use the built in SMPS, and use dual CR2032 batteries to reduce the current drawn from a single battery. Include USB-C for data transfer and power for high-speed operation.

Build it! :D
CwD
Posts: 2
Joined: Tue Sep 28, 2021 5:08 pm

Re: Potential for a STM32U5 based DM42

Post by CwD »

squid2 wrote:
Wed Oct 20, 2021 2:06 am

But with a HP-48GX style keyboard.
An HP-50G with a more traditional center-left ENTER placement would already be very nearly my ideal graphing calculator.
The rest of the SM upgrades would just be icing on the cake!
Post Reply