Giter VIP home page Giter VIP logo

Comments (6)

casas45 avatar casas45 commented on May 23, 2024 1

I got it, I made the blinking and interrupt examples, and now I'm working on my app.
Thanks for your help.

from trampoline.

mbriday avatar mbriday commented on May 23, 2024

Hi,
We're in the process of drafting documentation for STM32 boards. Even if the document was written with Cortex M4/M7 in mind, it should be able to serve as a basis for your porting. This draft uses a python script that has not yet been put on master, but is available in the stm32h743 branch (porting in progress).

Goil templates

The templates should be adapted in 4 parts:

  • config : OIL configuration, including interrupts, libraries, …
  • code :
  • linker : ld script (memory mapping)
  • build : build rules (cmake specific, …)

template/config

In config templates, each file inherits from higher level directories. For instance, the config.oil is built from:

  • goil/templates/config/config.oil : common part
  • goil/templates/config/cortex-m/config.oil : common to cortex-m architecture
  • goil/templates/config/cortex-m/armv7em/config.oil : common to cortex M4/M7, Thumb2 based ISA
  • goil/templates/config/cortex-m/armv7em/stm32h743/config.oil : specific to the STM32H743

First, the config templates should be adapted. Copy the configuration template from another port (i.e. STM32L432) to the new arch (i.e. STM32H743): goil/templates/config/cortex-m/armv7em/stm32h743:

Files are:

  • config.oil: main file with configuration: build options, files to include, paths
  • interruptDefs.oil may be generated by setInterruptDefsOil.py python script, thanks to the ST cmsis header file.
  • interruptSources.oil may be partially generated by the same script. It takes only into account specificities for EXTI and U(S)ART

template/code

Most of these files are generic to the STM32. They are related to the way the interrupts are handled (exti for instance).

You have to update the tpl_wrapper.goilTemplate to the name of the main register header file.

template/linker

The linker scripts are pretty much the same for a given family (CortexM4, cortexM7,...), except for:

  • the memory size which is defined in the memory_map.goilTemplate file.
  • the _estack symbol in the beginning of the main template script.goilTemplate

template/build

The build scripts have been already defined in the config templates. However, one can set VSCode related tools (when using the CMake build system) for a better integration. The directory should be copied from another port (stm32l432 for instance) and vscode_launch_json.goilTemplate should be adapted with

  • the device, used when debugging by ST-Link
  • the SVD file, used by VSCode ARM extension to deal with peripheral registers.

Code

Some files should be specialized in the machine directory

machine

We need to take a file from a similar target (CM4/CM7). In fact, only one file should be updated: system_stm32xx.c, but this can be extracted from ST Cube IDE.

Different files (copied from the STM32L432 target):

  • system_stm32xx.c: contains the SystemInit() function, that largely depends on the clock tree. This part is specific! However, if you can build an example from ST Cube IDE, you can get the system_stm32hxxx.c file direcly.
  • tpl_trace.c: allows you to trace kernel events (debug). It depends on uart. No other dependencies. Not compiled if the TRACE is not enabled in the .oil file.
  • startup_stmxx.c: second stage startup (in C): init .bss, .data, libc. This part is linked with symbols defined in the linker script. It should be similar for most STM32 flavors. Note: first stage startup is common to each cortex-m (in tpl_startup.S)
  • tpl_machine_stmxx.c: contains the Systick configuration. Similar to most targets, as the Systick is provided by ARM.
  • handlers_stm32...c/.h: these are ARM related handlers. They should not be different from one target to another.
  • tpl_memory_protection.c/.h: MPU config. Not required to make Trampoline start…

example

To build the first application, a basic application should be defined. The best way is to copy a basic app (blink) from another target, and get .c, .oil and README files.

from trampoline.

mbriday avatar mbriday commented on May 23, 2024

Great,
Could you make a pull request to integrate the port into the master branch?
regards,
Mik

from trampoline.

rafal19921989 avatar rafal19921989 commented on May 23, 2024

Hi @mbriday

Where can I find or when will the script you mentioned above - setInterruptDefsOil.py - be available?

from trampoline.

mbriday avatar mbriday commented on May 23, 2024

Hi,
It is available in the stm32h743 branch here.
This is just an helper to port STM32 cortex-m targets. There are still some few parameters that are hard-coded.
regards,
Mik

from trampoline.

rafal19921989 avatar rafal19921989 commented on May 23, 2024

@mbriday thanks for your reply.

I have a question about external communication - between ECUs.
Is it supported by Trampoline?

from trampoline.

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.