Skip to content

Add NXT support for GNU/Linux#1696

Closed
zhitm wants to merge 4 commits intotrikset:masterfrom
zhitm:master
Closed

Add NXT support for GNU/Linux#1696
zhitm wants to merge 4 commits intotrikset:masterfrom
zhitm:master

Conversation

@zhitm
Copy link

@zhitm zhitm commented Dec 10, 2023

What?

I've added NXT support for GNU/Linux so this PR allows to compile and load programs via USB connection on Lego NXT.

Why?

There's no NXT support for GNU/Linux, but it exist for Windows.

How?

I've changed structure of nxt-tools. There is no more win and linux directories. I use gcc-arm-none-eabi to compile C code on GNU/Linux same way as on Windows. In order not to increase the volume of the installer, the user is given the opportunity to run the download-arm-none-eabi.sh script.
There are some changes in compile.sh and compile.bat to pass sysroot as argument and use sysroot as compile option. There are also added more setting to choose cross compiler path as shown on image below. I've added widget dirPicker to choose path.

Screenshots

image_2023-12-21_16-21-47
image_2023-12-21_16-22-17

Other info

The imagePicker widget exist, but it only allows you to select image path. To reduce code repetitions it would be a good idea to unify that widget and dirPicker.

Linked pull requests

PR to nxt-tools
PR to trik-help

@zhitm zhitm force-pushed the master branch 4 times, most recently from c4b5f98 to f828e2b Compare December 21, 2023 11:02
@zhitm zhitm changed the title Added NXT support for GNU/Linux Add NXT support for GNU/Linux Dec 21, 2023
Copy link
Member

@iakov iakov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very impressive! But small polishing is required.

setColorOnGeneratorLabel(QColor("red"));
}
else {
mUi->generatorLabel->setText("Current directory exist.");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the text is not intended to be shown to the user, please, state this clearly in the code. I recommend to use string literals like following

auto x = "*SOME TEMPORARY TEXT NOT FOR USER*"

case QOperatingSystemVersion::OSType::Windows: {
auto pathToNxtTools = path().replace("\\", "/");
auto line = path("compile.bat")
+ " " + fileInfo.completeBaseName()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably, file names with spaces are handled incorrectly here after the single line is combined.

@iakov
Copy link
Member

iakov commented Jan 29, 2025

Merged with #1900, thank you very much for your great effort.

@iakov iakov closed this Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants