Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
47f6ff0
fix: sysdev: fix issue of an \ifdefconfig
antoine3818 Jul 8, 2025
a889f78
fix: sysdev: fix in buildroot lab wrong header for the toolchain
antoine3818 Jul 8, 2025
81ba55b
labs: Add vars and title file for imx93-frdm
antoine3818 Jun 23, 2025
887085f
slides: Add describe slide for imx93-frdm
antoine3818 Jun 23, 2025
844550c
slides: Add shopping slide for imx93-frdm
antoine3818 Jun 23, 2025
40be615
slides: Add imx93-frdm board also supported slide
antoine3818 Jul 2, 2025
237617f
labs: Add u-boot labs for imx93-frdm
antoine3818 Jun 23, 2025
56d17d6
labs: Add kernel cross compiling lab for imx93-frdm
antoine3818 Jun 23, 2025
3a38ac3
labs: Change tinysystem lab to support imx93-frdm
antoine3818 Jun 23, 2025
bd13a21
labs: Add accessing hardware labs for imx93-frdm
antoine3818 Jun 23, 2025
407ad87
labs:Add thirdparty lab for imx93-frdm
antoine3818 Jun 23, 2025
ab9c5a3
labs: Change buildroot lab to support imx93-frdm
antoine3818 Jun 23, 2025
07b8398
labs: Change system integration lab to support imx93-frdm
antoine3818 Jun 23, 2025
a57282f
labs: Add block filesystems lab for imx93-frdm
antoine3818 Jun 23, 2025
231604d
mk: Add mk file to build sysdev training for imx93-frdm
antoine3818 Jun 23, 2025
95f0f34
build: replace wildcard with shell find for recursive file search
antoine3818 Jul 2, 2025
ec3788d
slides: sysdev-hw: Add a sub folder dedicated to stm32mp1
antoine3818 Jul 2, 2025
be0089b
slides: sysdev-hw: Add subdirectory for imx93-frdm
antoine3818 Jul 2, 2025
3f28391
slides: support lab variables in build system
antoine3818 Jul 2, 2025
b30ca1a
slides: Add etoolbox package in the header
antoine3818 Jul 2, 2025
548c32c
slides: sysdev-hw: slide ending with board-specific input files
antoine3818 Jul 2, 2025
a38f90d
lab-data: sysdev: add lab-data for imx93-frdm
antoine3818 Jul 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ STYLESHEET = common/beamerthemeBootlin.sty
# in .pdf in the output directory. This is used to compute the list of
# .pdf files that need to be generated from .dia or .svg files.
PICTURES_WITH_TRANSFORMATION = \
$(patsubst %.$(2),$(OUTDIR)/%.pdf,$(foreach s,$(1),$(wildcard $(s)/*.$(2))))
$(patsubst %.$(2),$(OUTDIR)/%.pdf,$(foreach s,$(1),$(shell find -L $(s) -type f -name '*.$(2)')))

# Function that computes the list of pictures of the extension given
# in $(2) from the directories in $(1). This is used for pictures that
Expand Down Expand Up @@ -94,6 +94,7 @@ SLIDES_COMMON_BEFORE = common/slide-header.tex \
common/$(SLIDES_TRAINING)-title.tex
SLIDES_CHAPTERS = $($(call UPPERCASE, $(subst -,_, $(SLIDES_TRAINING)))_SLIDES)
SLIDES_COMMON_AFTER = common/slide-footer.tex
SLIDES_VARSFILE = common/$(SLIDES_TRAINING)-labs-vars.tex
else
SLIDES_TRAINING = $(firstword $(subst -, , $(SLIDES)))
ifeq ($(SLIDES_TRAINING),sysdev)
Expand Down Expand Up @@ -122,6 +123,7 @@ endif

# Compute the set of corresponding .tex files and pictures
SLIDES_TEX = \
$(SLIDES_VARSFILE) \
$(SLIDES_COMMON_BEFORE) \
$(foreach s,$(SLIDES_CHAPTERS),$(wildcard slides/$(s)/$(s).tex)) \
$(SLIDES_COMMON_AFTER)
Expand Down
15 changes: 15 additions & 0 deletions common/embedded-linux-imx93-frdm-labs-vars.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
\def\labbooktitle{Embedded Linux System Development}
\def\labbooksubtitle{imx93 frdm variant}
\def\labboard{imx93-frdm}
\def\workingkernel{6.15}
\def\labboarddescription{imx93 frdm Discovery kit}
\def\zimageboardaddr{0xc2000000}
\def\dtbboardaddr{0xc4f00000}
\def\dtname{imx93-11x11-frdm}
\def\hosttty{/dev/ttyACM0}
\def\ttyname{ttyLP0}
\def\console{\ttyname,115200}
\def\gpionum{533}
\def\gpioname{PF11}
\def\busname{I2C2}
\def\arch{ARM64}
2 changes: 2 additions & 0 deletions common/embedded-linux-imx93-frdm-title.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
\def \trainingurl{https://bootlin.com/training/embedded-linux}
\def \trainingtitle{Embedded Linux system development}
Binary file added common/imx93-frdm-connect-nunchuk.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions common/slide-header.tex
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
\usepackage{tabularx}
\usepackage{stmaryrd}
\usepackage{appendixnumberbeamer}
\usepackage{etoolbox}

\renewcommand{\thempfootnote}{\arabic{mpfootnote}}

Expand Down
170 changes: 170 additions & 0 deletions lab-data/embedded-linux-imx93-frdm/appdev/nunchuk-mpd-client.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
/* nunchuk-mpd-client
(c) 2022 Bootlin <[email protected]>

License: Public Domain
*/

#include <dirent.h>
#include <mpd/client.h>
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <linux/input.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>

static int handle_error(struct mpd_connection *c)
{
fprintf(stderr, "%s\n", mpd_connection_get_error_message(c));
mpd_connection_free(c);
return EXIT_FAILURE;
}

static void change_volume(struct mpd_connection *c, int delta)
{
int volume;
if (!mpd_run_change_volume(c, delta))
exit(handle_error(c));

volume = mpd_run_get_volume(c);

if (volume == -1)
exit(handle_error(c));

printf("%d\n", volume);
}

static void print_current_song(struct mpd_connection *c)
{
struct mpd_song *song;
song = mpd_run_current_song(c);

if (song) {
printf("%s (%u s)\n", mpd_song_get_uri(song), mpd_song_get_duration(song));
mpd_song_free(song);
}
}

static int is_event_device(const struct dirent *dir) {
return (strncmp("event", dir->d_name, 5) == 0);
}

int main(int argc, char ** argv)
{
struct mpd_connection *conn;
int i, ndev, ret, fd, quit = 0, num_events = 0;
struct input_event event;
struct dirent **namelist;

/* Find Nunchuk input device */

ndev = scandir("/dev/input", &namelist, is_event_device, alphasort);

if (ndev <= 0) {
fprintf(stderr, "ERROR: no input event device found\n");
exit(EXIT_FAILURE);
}

for (i = 0; i < ndev; i++)
{
char fname[256];
char name[256];

snprintf(fname, sizeof(fname), "/dev/%s", namelist[i]->d_name);
free(namelist[i]);

fd = open(fname, O_RDONLY);

if (fd < 0)
continue;

ioctl(fd, EVIOCGNAME(sizeof(name)), name);

if (strcmp("Wii Nunchuck", name) == 0)
break;
else
close(fd);

}

if (i == ndev) {
fprintf(stderr, "ERROR: didn't manage to find the Nunchuk device in /dev/input. Is the Nunchuk driver loaded?\n");
exit(EXIT_FAILURE);
}

/* Connection to MPD on localhost, default port */

conn = mpd_connection_new(0, 0, 30000);

if (mpd_connection_get_error(conn) != MPD_ERROR_SUCCESS)
return handle_error(conn);

printf("Connection successful\n");

/* Main loop */

while (!quit) {
ret = read(fd, &event, sizeof(struct input_event));
num_events++;

switch (event.type) {
case EV_KEY:
switch (event.code) {
case BTN_Z:
if (event.value == 1) {
printf("Play/Pause\n");
if (!mpd_run_toggle_pause(conn))
return handle_error(conn);
}
break;
case BTN_C:
if (event.value == 1) {
printf("Quit\n");
quit = 1;
free(conn);
}
break;
}
break;
case EV_ABS:
switch (event.code) {
case ABS_Y:
if (event.value > 250) {
printf("Volume up: ");
change_volume(conn, 5);
} else if (event.value < 5) {
printf("Volume down: ");
change_volume(conn, -5);
}
break;
case ABS_X:
if (event.value > 250) {
if (!mpd_run_next(conn)) {
printf("No next song. Aborting\n");
exit(handle_error(conn));
} else {
printf("Next song: ");
print_current_song(conn);
}
}
else if (event.value < 5) {
if (!mpd_run_previous(conn)) {
printf("No previous song. Aborting\n");
exit(handle_error(conn));
} else {
printf("Previous song: ");
print_current_song(conn);
}
}
break;
}
break;
}
}

/* Close connection */
mpd_connection_free(conn);
printf("Connection terminated\n");
return 0;
}
Binary file not shown.
Loading