numworks / epsilon

Modern graphing calculator operating system.
https://www.numworks.com/resources/engineering/software/
1.75k stars 467 forks source link

Trouble while building userland for n0120 #2247

Open Spectralo opened 1 month ago

Spectralo commented 1 month ago

Hey ! I have a little problem. I followed instructions on this page but it doesnt work (its probably made for n0120) I use this code to compile and send it to my calculator:

# Clean previous build
make clean MODEL=N0120 TARGET=device.n0120

if python3 build/device/dfu.py -l | grep -q '0x90000000'; then
    make userland.A.dfu
    python3 build/device/dfu.py -s 0x90010000:leave -D output/release/device/n0110/userland/userland.A.dfu
else
    make userland.B.dfu
    python3 build/device/dfu.py -s 0x90410000:leave -D output/release/device/n0110/userland/userland.B.dfu
fi

But it doesnt work and after flashing says "Official upgrade required" I think its because it actually builds for N0110 ? (Builds are in /output/release/device/n0110 and not /n0120 :/ I also bumped the version in config.mak to 23.2.6 (My calculator is on 23.2.5) What am I doing wrong ? Thanks.

Spectralo commented 1 month ago

...

joe-the-xenon commented 1 week ago

I'm experiencing the same issue, when trying to upload it to the N0120 (running the if statement), I'm getting a FIleNotFoundError: [Errno 2] No such file or directory: 'output/release/device/n0110/userland/userland.B.dfu' I hope this gets resolved quickly.

HugoNumworks commented 1 week ago

Hi, N0110 is the default model in the build system, so you need to add MODEL=N0120 when making the userland A or B for N0120.

The output will indeed be in /output/release/device/n0120 so this has to be updated too.

I also bumped the version in config.mak to 23.2.6 (My calculator is on 23.2.5)

This is what's causing the Official upgrade required message, try using the same exact version instead (23.2.5 in your case).

Let me know if it solved your issue !

I followed instructions on this page

Sorry, this page is indeed a bit outdated and incomplete, we plan on fixing that in the future.

joe-the-xenon commented 1 week ago

Hey, @HugoNumworks , it seems to load now, however, I'm getting a usb.core.USBError: [Errno 13] Access denied (insufficient permissions) error now, is this a mistake on my side or not?

Spectralo commented 1 week ago
make clean MODEL=N0120
if [ "$(python3 build/device/dfu.py -l | grep '0x90000000')" ]; then make userland.A.dfu; python3 build/device/dfu.py -s 0x90010000:leave -D output/release/device/n0120/userland/userland.A.dfu; else make userland.B.dfu; python3 build/device/dfu.py -s 0x90410000:leave -D output/release/device/n0120/userland/userland.B.dfu; fi;

Im using this command but it stills output in output/release/device/n0110 ... and then fail ... I think I need smth more ...

HugoNumworks commented 1 week ago
make clean MODEL=N0120
if [ "$(python3 build/device/dfu.py -l | grep '0x90000000')" ]; then make userland.A.dfu; python3 build/device/dfu.py -s 0x90010000:leave -D output/release/device/n0120/userland/userland.A.dfu; else make userland.B.dfu; python3 build/device/dfu.py -s 0x90410000:leave -D output/release/device/n0120/userland/userland.B.dfu; fi;

Im using this command but it stills output in output/release/device/n0110 ... and then fail ... I think I need smth more ...

I think you need to add MODEL=N0120 at each make commands :

make clean MODEL=N0120
if [ "$(python3 build/device/dfu.py -l | grep '0x90000000')" ]; then make MODEL=N0120 userland.A.dfu; python3 build/device/dfu.py -s 0x90010000:leave -D output/release/device/n0120/userland/userland.A.dfu; else make MODEL=N0120 userland.B.dfu; python3 build/device/dfu.py -s 0x90410000:leave -D output/release/device/n0120/userland/userland.B.dfu; fi;

Hey, @HugoNumworks , it seems to load now, however, I'm getting a usb.core.USBError: [Errno 13] Access denied (insufficient permissions) error now, is this a mistake on my side or not?

Do you have more details about the state of your calculator when you get the error, and at which point the error arises ?

joe-the-xenon commented 1 week ago

@HugoNumworks Upon trying make clean MODEL=N0120 I'm receiving the following output:

build/targets.device.mak:14: build/targets.device.N0120.mak: No such file or directory
make: *** No rule to make target 'build/targets.device.N0120.mak'.  Stop.

and the command you provided (1) will result in: ValueError: The device has no langid (permission issue, no string descriptors supported or device error) and usb.core.USBError: [Errno 13] Access denied (insufficient permissions)

When trying the example provided by numworks (for the N0110, apparently), installing the SDK will result in the following errors:

before making: ValueError: The device has no langid (permission issue, no string descriptors supported or device error)

Then, it proceeds to make everything (for example CC python/src/py/warning.o), but you get the following error: usb.core.USBError: [Errno 13] Access denied (insufficient permissions), I believe when its trying to upload it. It happens after LD userland.B.elf and DFUSE userland.B.dfu.

The weird thing is, the first 2 errors appeared instantly (upon firing the command), but the last one only appears partly before and partly after it has made everything.. My calculator is in the "connected" state, not the "recover" state in case you were wondering.

(1):

make clean MODEL=N0120
if [ "$(python3 build/device/dfu.py -l | grep '0x90000000')" ]; then make MODEL=N0120 userland.A.dfu; python3 build/device/dfu.py -s 0x90010000:leave -D output/release/device/n0120/userland/userland.A.dfu; else make MODEL=N0120 userland.B.dfu; python3 build/device/dfu.py -s 0x90410000:leave -D output/release/device/n0120/userland/userland.B.dfu; fi;