TrampolineRTOS / trampoline

Trampoline is a static RTOS for small embedded systems. Its API is aligned with OSEK/VDX OS and AUTOSAR OS 4.2 standards.
GNU General Public License v2.0
614 stars 268 forks source link

Porting to SMT32G0 #164

Open casas45 opened 6 months ago

casas45 commented 6 months ago

Hello. I want to port the OS to a STM32G0 mcu (Nucleo board), which has the Cortex m0+, can someone tell me which files I need to modify, considering the CPU is already supported. I will really appreciate your help.

mbriday commented 6 months ago

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:

Files are:

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:

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):

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.

casas45 commented 6 months ago

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

mbriday commented 5 months ago

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

rafal19921989 commented 5 months ago

Hi @mbriday

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

mbriday commented 5 months ago

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

rafal19921989 commented 4 months ago

@mbriday thanks for your reply.

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