Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[MP1] Add upload tools for MP1: run_arduino_gen.sh and busybox-w32#47

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fpistm merged 5 commits intostm32duino:masterfromkbumsik:master
Nov 15, 2019

Conversation

@kbumsik
Copy link
Contributor

@kbumsikkbumsik commentedOct 22, 2019
edited
Loading

In order to make the Arduino firmware works with the coprocessor (Cortex M4) of STM32MP1, I create a new upload tool for the board. There are some motivations to create a new tool:

  • There is no good way to deal with Engineering mode, the flashing mode that you can use ST-Link, since the firmware disappears in the next boot. A new tool is needed to deal with Production mode. See Engineering mode vs Production mode here:https://wiki.st.com/stm32mpu/wiki/STM32CubeMP1_development_guidelines

  • There is no way to directly flash the M4 coprocessor using Arduino IDE. The M4 core does not have a flash memory, we can use Engineering Mode to flash through ST-Link but the firmware will disappear right after rebooting to the Distribution mode (aka normal mode). So we need to transfer compiled Arduino firmware binary file to the board and log in to the shell session (either SSH or ST-Link serial) to the MP1 board.

  • We need to input the IP address, username, and password of the MP1 board to transfer the binary via SSH (SCP or SFTP), however, Arduino IDE does not provide an interactive interface to input the SSH information. So users must upload the binary file manually.

  • A script file is needed to manage the binary file in the shell session of the MP1 board.

The newrun_arduino_gen.sh is a shell script that produces a copy of the script calledrun_arduino.sh but with a Arduino binary self-contained. Sincerun_arduino.sh contains the binary, users doesn't need to transfer a script file and a binary file together but just onerun_arduino.sh file. After transferring the script, users can start/stop/install the Arduino firmware.

You can take a look at the README.md below to see how to use it:
https://github.com/kbumsik/Arduino_Core_STM32/tree/stm32mp1/variants/STM32MP157_DK

Also,run_arduino_gen.sh is a script that uses Busybox commands. In order to work it on Windows, we need an executable of busybox compiled for Windows. I copied busybox-w32 fromhttps://frippery.org/busybox/.

The scripts for Windows, Mac, and Linux are identical.


This change is Reviewable

@kbumsik
Copy link
ContributorAuthor

kbumsik commentedNov 8, 2019
edited
Loading

Some typos are fixed and squashed today. The commands remains untouched.

@fpistm
Copy link
Member

The scripts for Windows, Mac, and Linux are identical.

I wonder if this should not be fine to avoid duplicate it and put it in a single place.

@kbumsik
Copy link
ContributorAuthor

kbumsik commentedNov 10, 2019
edited
Loading

@fpistm There should be no problem. I just couldn't find the appropriate place in this directory organization. I should've asked you about this.

@fpistm
Copy link
Member

I guess at the root. This would be fine.
And update platform.txt to match new path.

@kbumsik
Copy link
ContributorAuthor

kbumsik commentedNov 11, 2019
edited
Loading

OK, I moved it to root :) Updated platform.txt as well.

@fpistm
Copy link
Member

OK, I moved it to root :) Updated platform.txt as well.

Thanks this will avoid misalignment across host OS if it is updated.

@fpistmfpistm self-requested a reviewNovember 12, 2019 08:05
@fpistmfpistm added this to the1.3.2 milestoneNov 12, 2019
@fpistm
Copy link
Member

@kbumsik
I think, it should be fine to add in the generated script the name of the built sketch:
Ex in platform.txt:
tools.remoteproc_gen.upload.pattern="{busybox}" sh "{path}/{script}" generate "{build.path}/{build.project_name}.elf" "{build.path}/run_arduino_{build.project_name}.sh"

Then it will be more easiest for end user.
For service name (systemd), kept the generic "run_arduino.sh" name (currently hardcoded so this seems does not need to be updated).

@kbumsik
Copy link
ContributorAuthor

run_arduino_{build.project_name}.sh sounds better to me too. Also change<Arduino build output path>/run_arduino.sh to<Arduino build output path>/run_arduino_<your project name>.sh accordingly inthe documentation?

@fpistm
Copy link
Member

run_arduino_{build.project_name}.sh sounds better to me too. Also change<Arduino build output path>/run_arduino.sh to<Arduino build output path>/run_arduino_<your project name>.sh accordingly inthe documentation?

Right. Missed that. Good catch 😉

@kbumsik
Copy link
ContributorAuthor

kbumsik commentedNov 15, 2019
edited
Loading

tools.remoteproc_gen.upload.pattern="{busybox}" sh "{path}/{script}" generate "{build.path}/{build.project_name}.elf" "{build.path}/run_arduino_{build.project_name}.sh"

@fpistm I just tested it butbuild.project_name includes.ino. So the output looks likerun_arduino_Blink.ino.sh. Do you know a variable without.ino?

@fpistm
Copy link
Member

tools.remoteproc_gen.upload.pattern="{busybox}" sh "{path}/{script}" generate "{build.path}/{build.project_name}.elf" "{build.path}/run_arduino_{build.project_name}.sh"

@fpistm I just tested it butbuild.project_name includes.ino. So the output looks likerun_arduino_Blink.ino.sh. Do you know a variable without.ino?

@kbumsik unfortunately no. Using sed it could be removed, if also available in the busybox.

@kbumsik
Copy link
ContributorAuthor

@fpistm sed is included in busybox, but how run in-line script or something for sed in platform.txt?

@fpistm
Copy link
Member

I think in the generate function

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fpistmfpistmfpistm approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

1.3.2

Development

Successfully merging this pull request may close these issues.

2 participants

@kbumsik@fpistm

[8]ページ先頭

©2009-2025 Movatter.jp