Coder Social home page Coder Social logo

icub-tech-iit / study-cm4-performances Goto Github PK

View Code? Open in Web Editor NEW
0.0 6.0 0.0 379 KB

This repository hosts a study that compares the performance of the CM4 cores of STM32G474 and STM32H745 that we use for the motor control in our robots.

License: BSD 3-Clause "New" or "Revised" License

C++ 70.88% C 29.12%

study-cm4-performances's Introduction

STM32 Performance Comparison of CM4 cores

This repository explores the performance of the CM4 cores in STM32G474 and STM32H745 microcontrollers (MCUs) used for motor control in our robots.

The Challenge

We encountered an unexpected issue. Our existing FOC motor control code, which performs single-precision floating-point operations, ran poorly when transferred from the amcblcd board (using a 168 MHz STM32G474 CM4 core) to the amc board (equipped with a 200 MHz STM32H745 CM4 core). The latter after compensation of different clock speed has an execution time increase of about 10%. This surprised us!

Code Details

Generated from a MATLAB model, the code relies heavily on floating point calculation calculations, which are executed within an interrupt handler (a special code section) triggered upon completion of DMA data transfer.

Investigating the Issue

To understand the cause of the performance difference, we conducted a series of comparative tests on our custom boards, which include additional hardware and complex software like a multithreaded operating system.

The initial tests focused on measuring the execution time of the original motor control code. We later expanded the scope to include more general single-precision math code.

Sharing and Collaboration

To share our findings and gain insights from the community, we ported the general tests to development boards from STMicroelectronics featuring the same MCUs as our robot boards.

Repository Breakdown

  • The docs folder contains the results we measured on both boards.
  • The code folder contains instructions on integrating our code with the official ST code available online for these MCUs.

Community Input Wanted

If you have information about the supposed lower performance of the H7-CM4 compared to the G4, suggestions for improving execution on the H7-CM4, or notice any potential issues in our testing approach, please don't hesitate to contact Marco Accame at [email protected].

study-cm4-performances's People

Contributors

marcoaccame avatar

Watchers

Silvio Traversaro avatar Ugo Pattacini avatar Valentina Gaggero avatar marco maggiali avatar  avatar Fabrizio Larosa avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.