Skip to content

Commit 4ee5803

Browse files
author
hemant
committed
Added A7(using Yocto) and M4(using cmake) Applications
1 parent 4b4bbd6 commit 4ee5803

File tree

946 files changed

+1309414
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

946 files changed

+1309414
-1
lines changed

README.md

+111-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,111 @@
1-
# stm32mp1
1+
# stm32mp1
2+
3+
4+
## This repository contains project done on STM32Mp157C-DK2 Kit, which utilizes both ARM Cortex A7 and ARM Cortex M4 processors.
5+
6+
M4 part generates some data and send it to A7.
7+
A7 has a server running which accepts messages and copy those into a shared memory region which will be read by some other application.
8+
Other Application takes data from shared memory and is responsible to process that data according to message request.
9+
10+
_________________________________________________________________________________________________________________
11+
| ________ ________ |
12+
| |Core 1| |Core 2| |
13+
| ======== ======== |
14+
| Shared Memory Region |
15+
| -------------------------- | | ------------------------ |
16+
| | IPC Sender |=====>| |==========>| IPC Reader | |
17+
| -------------------------- | | ------------------------ |
18+
| || | | |
19+
| -------------------------- | | ------------------------- |
20+
| | Active Request Handler | | | | Thread Pool Processing | |
21+
| -------------------------- | | ------------------------- |
22+
| || | | |
23+
| |------------------------ | | |
24+
| | | | | |
25+
| | SERVER | | | |
26+
| ------------------------- | | |
27+
| || ^ || | | |
28+
| || | || |
29+
| || | || |
30+
| |
31+
|-----------------ttyRPMSG0-------------------------------------------------------------------------------------|
32+
| // || \\ |
33+
| /// || \\\ |
34+
| ||| || ||| |
35+
| ||| || |||<--- Sending some Message in particular format |
36+
| ||| || ||| |
37+
| ||| || -------------------- |
38+
| ||| ========================== M4 Processor |
39+
| ------------------------------ |
40+
| |
41+
| |
42+
| Fig. Sample Processing inside system |
43+
| |
44+
| |
45+
-----------------------------------------------------------------------------------------------------------------
46+
47+
48+
Folders Description:
49+
50+
1. Utilities (C++)
51+
Utility Library containing following functionalties:
52+
a. PMR (Polymorphic Resource Allocator) which can be used with C++14. Only Monotonic Buffer resource is added but others can be added easily.
53+
b. POSIX Shared Memory Adaptor layer.
54+
c. POSIX Semaphore Adaptor layer.
55+
d. Thread Pool: can be used to process parallel requests of same type or different.
56+
e. Generic Signal Handler Interface: used to handle signals in system and can also call System Reset Handler.
57+
f. Generic Reset Handler Interface: used to handle system level failures.
58+
59+
This library can be used as a generic library in any project where some system programming using C++ is needed. Particularly for Automotive where C++14 is being used.
60+
It can easily be extended for further enhancements.
61+
62+
63+
2. HtServer (C++)
64+
Small Server Application to receive data from M4 Core. It process the requests and put the data into shared memory region.
65+
It has 3 major sections:
66+
a. Initialization of Application
67+
b. Core Server to receive data
68+
c. IPC channel using shared memory
69+
70+
It receives data on ttyRPMSG0 channel. Whenever a request comes it is placed into a queue using active thread which transfers data to shared memory using request queue in a separate thread.
71+
72+
73+
3. HtClient (C++)
74+
Application to read data from shared memory and process each request.
75+
It also has 3 major sections:
76+
a. Initialization of Application
77+
b. Core Receiver
78+
c. IPC channel
79+
80+
it receives data from shared memory and put the request into a separate thread. Just priting the received message as dummy processing.
81+
82+
83+
4. M4A7Comm (C)
84+
It is OpenAMP-FreeRTOS based sample application whcih sends some data to A7 core using ttyRPMSG0. There is a possibility to receive data from A7 also using ttyRPMSG0.
85+
86+
It has majorly 3 Threads:
87+
a. LED Task to blink led or some regular system related tasks
88+
b. OpenAMP Receive Task: to check the data on virtual UARTs
89+
c. Send Data Thread: sends data in particular format to ttyRPMSG0 after a fixed interval. Actual ADC data or other different data can also be sent accoridng the system behavior.
90+
91+
[It also receives data from A7 and sends it back to A7 (whatever was sent from there) on ttyRPMSG0, can easily be found official website as a demo part.]
92+
93+
94+
95+
How to Build:
96+
97+
yocto_steps.txt file can be found to build A7 (Linux Application) using yocto project.
98+
99+
Simple cmake can be used to build CM4 based projects.
100+
a. Create build folder in project directory
101+
b. Go to build directory. cmake .. and then make
102+
It should generate following files after successful compilation:
103+
linker.map, M4A7CommApp.bin, M4A7CommApp.elf, M4A7CommApp.hex
104+
105+
106+
107+
108+
109+
Cheers!!
110+
Happy to Help and Share :-)
111+

meta-stm32mp/COPYING.MIT

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Permission is hereby granted, free of charge, to any person obtaining a copy
2+
of this software and associated documentation files (the "Software"), to deal
3+
in the Software without restriction, including without limitation the rights
4+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
5+
copies of the Software, and to permit persons to whom the Software is
6+
furnished to do so, subject to the following conditions:
7+
8+
The above copyright notice and this permission notice shall be included in
9+
all copies or substantial portions of the Software.
10+
11+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
17+
THE SOFTWARE.

meta-stm32mp/README

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
This README file contains information on the contents of the meta-stm32mp layer.
2+
3+
Please see the corresponding sections below for details.
4+
5+
Dependencies
6+
============
7+
8+
URI: <first dependency>
9+
branch: <branch name>
10+
11+
URI: <second dependency>
12+
branch: <branch name>
13+
14+
.
15+
.
16+
.
17+
18+
Patches
19+
=======
20+
21+
Please submit any patches against the meta-stm32mp layer to the xxxx mailing list (xxxx@zzzz.org)
22+
and cc: the maintainer:
23+
24+
Maintainer: XXX YYYYYY <xxx.yyyyyy@zzzzz.com>
25+
26+
Table of Contents
27+
=================
28+
29+
I. Adding the meta-stm32mp layer to your build
30+
II. Misc
31+
32+
33+
I. Adding the meta-stm32mp layer to your build
34+
=================================================
35+
36+
Run 'bitbake-layers add-layer meta-stm32mp'
37+
38+
II. Misc
39+
========
40+
41+
--- replace with specific information about the meta-stm32mp layer ---

meta-stm32mp/conf/layer.conf

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# We have a conf and classes directory, add to BBPATH
2+
BBPATH .= ":${LAYERDIR}"
3+
4+
# We have recipes-* directories, add to BBFILES
5+
BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
6+
${LAYERDIR}/recipes-*/*/*.bbappend"
7+
8+
BBFILE_COLLECTIONS += "meta-stm32mp"
9+
BBFILE_PATTERN_meta-stm32mp = "^${LAYERDIR}/"
10+
BBFILE_PRIORITY_meta-stm32mp = "6"
11+
12+
LAYERDEPENDS_meta-stm32mp = "core"
13+
LAYERSERIES_COMPAT_meta-stm32mp = "dunfell"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#
2+
# Hello World Demo Project
3+
#
4+
5+
DESCRIPTION = "Example Hello World application for Yocto build."
6+
LICENSE = "MIT"
7+
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
8+
9+
10+
inherit externalsrc pkgconfig cmake
11+
12+
13+
# Absolute Path of src CMakeLists.txt
14+
EXTERNALSRC = "/home/hemant/stm32mp157/stm-apps/mp157/hello_world/"
15+
16+
DEPENDS += ""
17+
18+
EXTRA_OECMAKE = ""
19+
20+
21+
# The autotools configuration I am basing this on seems to have a problem with a race condition when parallel make is enabled
22+
PARALLEL_MAKE = ""
23+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#
2+
# Remote Processor Client
3+
#
4+
5+
DESCRIPTION = "RP-Communication Client Application for Yocto build."
6+
LICENSE = "MIT"
7+
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
8+
9+
10+
inherit externalsrc pkgconfig cmake
11+
12+
13+
# Absolute Path of src CMakeLists.txt
14+
EXTERNALSRC = "/home/hemant/stm32mp157/stm-apps/mp157/HtClient"
15+
16+
DEPENDS += "utils"
17+
18+
EXTRA_OECMAKE = ""
19+
20+
21+
# The autotools configuration I am basing this on seems to have a problem with a race condition when parallel make is enabled
22+
PARALLEL_MAKE = ""
23+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#
2+
# Remote Processor Server
3+
#
4+
5+
DESCRIPTION = "RP-Communication Server Application for Yocto build."
6+
LICENSE = "MIT"
7+
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
8+
9+
10+
inherit externalsrc pkgconfig cmake
11+
12+
13+
# Absolute Path of src CMakeLists.txt
14+
EXTERNALSRC = "/home/hemant/stm32mp157/stm-apps/mp157/HtServer"
15+
16+
DEPENDS += "utils"
17+
18+
EXTRA_OECMAKE = ""
19+
20+
21+
# The autotools configuration I am basing this on seems to have a problem with a race condition when parallel make is enabled
22+
PARALLEL_MAKE = ""
23+
+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#
2+
# Remote Processor Communication Project
3+
#
4+
5+
DESCRIPTION = "Example RP-Communication application for Yocto build."
6+
LICENSE = "MIT"
7+
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
8+
9+
10+
inherit externalsrc pkgconfig cmake
11+
12+
13+
# Absolute Path of src CMakeLists.txt
14+
EXTERNALSRC = "/home/hemant/stm32mp157/stm-apps/mp157/RPComm"
15+
16+
DEPENDS += "utils"
17+
18+
EXTRA_OECMAKE = ""
19+
20+
21+
# The autotools configuration I am basing this on seems to have a problem with a race condition when parallel make is enabled
22+
PARALLEL_MAKE = ""
23+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#
2+
# Utilities Library Project
3+
#
4+
5+
DESCRIPTION = "Utilities Library."
6+
LICENSE = "MIT"
7+
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
8+
9+
10+
inherit externalsrc pkgconfig cmake
11+
12+
13+
# Absolute Path of src CMakeLists.txt
14+
EXTERNALSRC = "/home/hemant/stm32mp157/stm-apps/mp157/Utilities"
15+
16+
DEPENDS += ""
17+
18+
EXTRA_OECMAKE = ""
19+
20+
21+
# The autotools configuration I am basing this on seems to have a problem with a race condition when parallel make is enabled
22+
PARALLEL_MAKE = ""
23+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
SUMMARY = "STM32MP1 Custom image"
2+
3+
IMAGE_INSTALL = "packagegroup-core-boot ${CORE_IMAGE_EXTRA_INSTALL}"
4+
5+
IMAGE_LINGUAS = " "
6+
7+
LICENSE = "MIT"
8+
9+
inherit core-image
10+
inherit extrausers
11+
12+
13+
IMAGE_OVERHEAD_FACTOR ?= "1.0"
14+
IMAGE_ROOTFS_SIZE ?= "8192"
15+
16+
INHERIT += "extrausers"
17+
EXTRA_USERS_PARAMS += "usermod -p root root;"
18+
19+
IMAGE_ROOTFS_EXTRA_SPACE_append = "${@bb.utils.contains("DISTRO_FEATURES", "systemd", " + 4096", "" ,d)}"
20+
21+
# Install applications in custom build
22+
IMAGE_INSTALL += \
23+
"hello-world \
24+
rpcomm \
25+
ht-server \
26+
ht-client"
27+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
SUMMARY = "bitbake-layers recipe"
2+
DESCRIPTION = "Recipe created by bitbake-layers"
3+
LICENSE = "MIT"
4+
5+
python do_display_banner() {
6+
bb.plain("***********************************************");
7+
bb.plain("* *");
8+
bb.plain("* Example recipe created by bitbake-layers *");
9+
bb.plain("* *");
10+
bb.plain("***********************************************");
11+
}
12+
13+
addtask display_banner before do_build

0 commit comments

Comments
 (0)