-
Notifications
You must be signed in to change notification settings - Fork 67
[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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Some typos are fixed and squashed today. The commands remains untouched. |
I wonder if this should not be fine to avoid duplicate it and put it in a single place. |
@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. |
I guess at the root. This would be fine. |
OK, I moved it to root :) Updated platform.txt as well. |
Thanks this will avoid misalignment across host OS if it is updated. |
@kbumsik Then it will be more easiest for end user. |
|
Right. Missed that. Good catch 😉 |
@fpistm I just tested it but |
@kbumsik unfortunately no. Using sed it could be removed, if also available in the busybox. |
@fpistm sed is included in busybox, but how run in-line script or something for sed in platform.txt? |
I think in the generate function |
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 new
run_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 from https://frippery.org/busybox/.The scripts for Windows, Mac, and Linux are identical.
This change is