GithubHelp home page GithubHelp logo

Support STM32G4 about renode HOT 6 OPEN

qhdwight avatar qhdwight commented on May 25, 2024
Support STM32G4

from renode.

Comments (6)

PiotrZierhoffer avatar PiotrZierhoffer commented on May 25, 2024 1

Hi @qhdwight

Indeed, the autogenerated platforms don't have CAN - we don't really need them for the Zephyr samples used in the Zephyr Dashboard.

We do, however, have some CAN support for STM - please scan https://github.com/renode/renode/tree/master/platforms for "STMCAN" to see example usage.

from renode.

qhdwight avatar qhdwight commented on May 25, 2024

Datasheet can be found here: https://www.st.com/resource/en/reference_manual/rm0440-stm32g4-series-advanced-armbased-32bit-mcus-stmicroelectronics.pdf

from renode.

PiotrZierhoffer avatar PiotrZierhoffer commented on May 25, 2024

Hi @qhdwight,

Thanks for reporting the issue.

While the Renode package does not contain the STM32G4 repl file, we do run this target in our Zephyr Dashboard - https://zephyr-dashboard.renode.io/

If you search for “g4” you will find three targets running plenty of Zephyr samples passing our tests. Clicking the board name will get you here: https://renodepedia.renode.io/boards/nucleo_g431rb/?view=software&demo=hello_world - all the build artifacts, including the REPL platform file, are there to be downloaded.

Please note that the platform description is autogenerated from the device tree file, so it might not cover the whole SoC. It is, however, sufficient to run the demos in the Dashboard.

We’d be happy to learn more about your project - feel free to reach out to [email protected] if you can share some details!

from renode.

qhdwight avatar qhdwight commented on May 25, 2024

Hi @PiotrZierhoffer,

Thank you for the reply! I will check this out.

The application is for a student project team: https://github.com/umrover. We build mock rovers for a global competition that is held over the summer. Part of this is designing a custom brushed motor controller board that uses STM MCU's. We want to start doing hardware-in-the-loop testing and Renode seemed like a great place to start.

from renode.

qhdwight avatar qhdwight commented on May 25, 2024

However I noticed that the .repl file does not have any can devices on it (which we make heavy use of).

I see CAN mentioned in the .dts file but I'm not sure how that plays into everything.

from renode.

qhdwight avatar qhdwight commented on May 25, 2024

Currently trying out the .repl file from the page G431RB you linked. I added several lines for FDCAN based on the datasheet:

fdcan1: CAN.STMCAN @ sysbus <0x40006400, +0x400>

fdcan2: CAN.STMCAN @ sysbus <0x40006800, +0x400>

fdcan3: CAN.STMCAN @ sysbus <0x40006C00, +0x400>

My .resc script is:

using sysbus

mach create
machine LoadPlatformDescription @stm32g431.repl
machine StartGdbServer 3333

macro reset
"""
    sysbus LoadELF @Build/bdcmc.elf

"""

runMacro $reset

Everything seems to work until HAL_RCC_ClockConfig when I receive this error that I can see in the debugger:

image

The code can be found here: https://github.com/umrover/mrover-ros/blob/eb560e4c17ffde14cd5f0540b9712e7e723029a5/src/esw/fw/bdcmc/Core/Src/main.c#L90

I will keep debugging. Seems like this is a problem with the emulated RCC:

rcc: Python.PythonPeripheral @ sysbus 0x40021000
    size: 0x400
    initable: true
    filename: "scripts/pydev/flipflop.py"

from renode.

Related Issues (20)

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.