-
Notifications
You must be signed in to change notification settings - Fork 67
Mass storage upload fails on linux64 when no 32-bit loader is installed #42
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
Comments
Hi @matthijskooijman |
While writing an issue for the Arduino IDE, I actually realized that this can (and IMHO should) be solved in the STM core after all. Looking more closely, it seems that e.g. the AVR tools on my system only ship 64-bit versions. Looking in
IOW, the linux32 and linux64 systems have different tarballs, so the installer can simply install the right binaries and Looking at package_stm_index.json, I see that both linux32 and linux64 use the same tarball:
So I think the proper solution would be to separate that tarball into a 32-bit and 64-bit version and use the correct one for each system, keeping the paths inside the tarball the same so It seems this is already done for the gcc tool, and the CMSIS tool is platform-independent, so can just use the same tarball for all platforms. |
Yes, this probably could be done like that. |
Thinking about that, there will be always an issue for those using the git repo which include all tools. |
But this repo contains no tools at all? So I think you mean the https://github.com/stm32duino/Arduino_Tools repository? If someone is using that, you already need to modify One alternative for using the platform from git with the default tools can be to install the platform through the boards manager as normal (also installing the tools), and then putting the platform git checkout (i.e. this repo) in your I haven't tried this for the STM32 platform yet, but if it works, that's probably something to document and recommend, since it is even more flexible than only installing the core from git. |
Yes I talk about https://github.com/stm32duino/Arduino_Tools And no you do not need to modify platform.txt to use this method. |
Ah, I see the method you proposed. It is really similar to what I suggested, except that you delete the files from ~/.arduino15 rather than rename the core from git in the sketchbook. However, with "your" method, having a split tools tarball also still works, since the tools are installed by the IDE as well. Previously, you said:
I think this refers to using a modified Arduino_Tools repository, not a modified Arduino_Core_STM32 repository. And for doing that, I think you need to modify |
Rigth
No, I delete the tools directory then clone the Arduino_Tools repo so no need to update platform.txt. |
Ah, I guess that could also work indeed. That probably does not work by cloning it into the sketchbook, only into the What you could then perhaps do:
This would still not require modifying Does that make sense? |
Arduino provide this feature and I do not want have manually create a symlink to use the git repo. This should work as it is. |
So that means always using the 32-bit binaries, also on 64-bit linux? That requires people to install additional libraries, which might not be so easy for everyone (e.g on Debian it is more than just installing an extra package). Also, that would not work if you ever want to support arm rather than x86 (which the Arduino IDE already does). |
No, I didn't tell that. |
Ok, then I misunderstood. I guess a script would work, but it doesn't seem too elegant to duplicate the arch detection again in a script. But it does make it easier to run with tools from git, I guess, so if that's what you prefer :-) Thanks! |
Well, this avoid to duplicate files in the repo and have it functional without have to add a platform.local.txt, or create a symlink. Only one arch detection have to be performed:
I guess this is not very disturbing |
This closes stm32duino#41 and stm32duino#42. Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
This closes stm32duino#41 and stm32duino#42. Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
This closes stm32duino#41 and stm32duino#42. Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
This closes stm32duino#41 and stm32duino#42. Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
This closes stm32duino#41 and stm32duino#42. Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
Closed by #43 |
On a 64-bit Ubuntu Disco system, mass-storage uploads fail. In the IDE window, I get:
Closer inspection shows that the file referenced actually does exist, but is a 32-bit binary. Executing it fails with a
ENOENT
, which is expected (according to https://unix.stackexchange.com/a/13409/233460) when no 32-bit loader is installed.Manually starting the binary also fails, and strace shows it is the actual
execve
systemcall that fails:A linux64 version is included, which does run and work as expected (tested by editing
platform.txt
).Looking at the
platform.txt
, at first glance it looks like there is a typo in the linux64 version: https://github.com/stm32duino/Arduino_Core_STM32/blob/6808f06a3c183f22784f0486a3034644535c5b2b/platform.txt#L160-L161As you can see, both refer to the 32-bit version. However, on closer inspection, it turns out that the Arduino IDE does not actually distinguish between linux32 and linux64 currently, so to really fix this, I guess the IDE needs to be changed (I'll file a bug report for that as well).
As a workaround, you can enable execution of 32-bit binaries on a 64-bit Linux Debian-derived (e.g. Ubuntu) system by enabling multiarch and installing a 32-bit libc:
With that, things work as expected again. But ideally, you would use the 64-bit version on a 64-bit system, if Arduino adds support for that.
To Reproduce
Desktop (please complete the following information):
Board (please complete the following information):
The text was updated successfully, but these errors were encountered: