Skip to main content
MBassi
Associate III
Feb 25, 2022 4:15 PM UTC
Solved

How can I made a script runs automatically immediatly after boot finished?

Hi,

I'm using OpenST-linux version 4.9 on a STM32MP157c-ev1 and I wrote a simple script to run my firmware for Core M4. I would like to know how I can make the script run automatically after system boot.

Here's my script if could of any help for answers, I wrote it following this guide, I tested it launching manually and it works, but now I would like to it runs automatically after system finishes booting. How can I do?

Regards

Marco

#! /bin/sh
 
################### CONFIGURATION VARIABLES ###################################################
 
FIRMAWARE_PATH="/lib/firmware/"
 
M4_FIRMWARE_NAME="xmi_ccu-test_CM4.elf"
 
REMOTE_PROCESSOR="remoteproc0"
 
########################### SCRIPT BODY ######################################################
 
# Add firmware path if different then /lib/firmware
if [ $FIRMAWARE_PATH != "/lib/firmware/" ]; then
 
	echo -n $FIRMAWARE_PATH$FIRMAWARE_PATH > "/sys/module/firmware_class/parameters/path"
fi
 
# Load firmware
echo -n $M4_FIRMWARE_NAME > "/sys/class/remoteproc/$REMOTE_PROCESSOR/firmware"
 
# Start firmware
echo start > "/sys/class/remoteproc/$REMOTE_PROCESSOR/state"

This topic has been closed for replies.
Erwan SZYMANSKI
Erwan SZYMANSKIBest answer
ST Technical Moderator
Feb 28, 2022 7:43 AM UTC

Hello @MBassi​ ,

Please can you check the answer on this topic.

It seems to be the same use case as yours.

Let me know if it helps you or if you need more support.

Regards.

Erwan.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

2 replies

Erwan SZYMANSKI
Erwan SZYMANSKIBest answer
ST Technical Moderator
Feb 28, 2022 7:43 AM UTC

Hello @MBassi​ ,

Please can you check the answer on this topic.

It seems to be the same use case as yours.

Let me know if it helps you or if you need more support.

Regards.

Erwan.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
MBassi
MBassiAuthor
Associate III
Feb 28, 2022 9:14 AM UTC

Hi @Erwan SZYMANSKI​ 

Thank you for the answer, the topic you linked resolved my question.

Regards

Marco.