To start with, I know I can user ev3dev but as this is for my son, he want's to use code blocks and I'm struggling to get it all working as expected...
Initially there was an problem with ev3 not getting mounted at all, and I managed to get it solved by flashing newest firmware to the brick so it is now running on v1.10E
I've tried this on windows and works, device mounts and I'm able to upload file to it - it works... but my son do not have access to windows machine and I'm looking for a way to get it working on Linux...
My setup:
System:
Host: pop-os Kernel: 6.9.3-76060903-generic x86_64 bits: 64
Desktop: GNOME 42.9 Distro: Pop!_OS 22.04 LTS
Machine:
Type: Laptop System: HP product: HP Laptop 14s-dq1xxx v: N/A
serial: <superuser required>
Mobo: HP model: 86C8 v: 56.31 serial: <superuser required> UEFI: AMI
v: F.11 date: 05/22/2020
CPU:
Info: quad core model: Intel Core i5-1035G1 bits: 64 type: MT MCP cache:
L2: 2 MiB
Speed (MHz): avg: 475 min/max: 400/3600 cores: 1: 400 2: 400 3: 400
4: 400 5: 400 6: 400 7: 400 8: 1000
Drives:
Local Storage: total: 476.97 GiB used: 123.27 GiB (25.8%)
ID-1: /dev/nvme0n1 vendor: Western Digital
model: PC SN530 SDBPNPZ-512G-1006 size: 476.94 GiB
ID-2: /dev/sda type: USB model: Linux File-CD Gadget size: 31.7 MiB
Here is lsusb:
Bus 002 Device 002: ID 0bda:0411 Realtek Semiconductor Corp. Hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 005: ID 13d3:56c9 IMC Networks HP TrueVision HD Camera
Bus 001 Device 014: ID 0694:0005 Lego Group Mindstorms EV3
Bus 001 Device 006: ID 0bda:b00a Realtek Semiconductor Corp. Realtek Bluetooth 4.2 Adapter
Bus 001 Device 004: ID 046d:c52b Logitech, Inc. Unifying Receiver
Bus 001 Device 002: ID 0bda:5411 Realtek Semiconductor Corp. RTS5411 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Here is dmesg after plugging device in filtered for sda:
sudo dmesg -w | grep -i sda
[ 3648.858545] sd 1:0:0:0: [sda] 65000 512-byte logical blocks: (33.3 MB/31.7 MiB)
[ 3648.858937] sd 1:0:0:0: [sda] Write Protect is off
[ 3648.858940] sd 1:0:0:0: [sda] Mode Sense: 0f 00 00 00
[ 3648.859497] sd 1:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 3648.888413] sda:
[ 3648.888446] sd 1:0:0:0: [sda] Attached SCSI removable disk
[ 3653.876952] FAT-fs (sda): error, corrupted directory (invalid entries)
[ 3653.876964] FAT-fs (sda): Filesystem has been set read-only
[ 3653.933378] FAT-fs (sda): error, fat_get_cluster: invalid cluster chain (i_pos 0)
dmesg filtered for usb:
sudo dmesg -w | grep -i usb
[ 4339.097081] usb 1-2: new high-speed USB device number 15 using xhci_hcd
[ 4339.224169] usb 1-2: New USB device found, idVendor=0694, idProduct=0005, bcdDevice= 2.16
[ 4339.224182] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 4339.224186] usb 1-2: Product: EV3
[ 4339.224189] usb 1-2: Manufacturer: LEGO Group
[ 4339.224192] usb 1-2: SerialNumber: 001653548778
[ 4339.231695] hid-generic 0003:0694:0005.0010: hiddev0,hidraw1: USB HID v1.10 Device [LEGO Group EV3] on usb-0000:00:14.0-2/input0
[ 4339.232370] usb-storage 1-2:1.1: USB Mass Storage device detected
[ 4339.232722] scsi host1: usb-storage 1-2:1.1
When I run fsck.fat there is an error but I'm worried that is will brick the device when I allow this to do any changes... here is output of:
sudo fsck.fat -v /dev/sda
fsck.fat 4.2 (2021-01-31)
Checking we can access the last sector of the filesystem
Boot sector contents:
System ID "UF2 UF2 "
Media byte 0xf8 (hard disk)
512 bytes per logical sector
512 bytes per cluster
1 reserved sector
First FAT starts at byte 512 (sector 1)
2 FATs, 16 bit entries
130048 bytes per FAT (= 254 sectors)
Root directory starts at byte 260608 (sector 509)
64 root directory entries
Data area starts at byte 262656 (sector 513)
64485 data clusters (33016320 bytes)
1 sectors/track, 1 heads
0 hidden sectors
64998 sectors total
/EV3
Contains a free cluster (738). Assuming EOF.
/Projects
Contains a free cluster (737). Assuming EOF.
/dmesg.txt
File size is 131072 bytes, cluster chain length is > 131072 bytes.
Truncating file to 131072 bytes.
Volume label 'EV3' stored in root directory and label 'EV3' stored in boot sector and different.
1) Copy volume label from root directory to boot sector
2) Copy label from boot sector to root directory
And here is a output of:
sudo fsck.vfat -v /dev/sda
fsck.fat 4.2 (2021-01-31)
Checking we can access the last sector of the filesystem
Boot sector contents:
System ID "UF2 UF2 "
Media byte 0xf8 (hard disk)
512 bytes per logical sector
512 bytes per cluster
1 reserved sector
First FAT starts at byte 512 (sector 1)
2 FATs, 16 bit entries
130048 bytes per FAT (= 254 sectors)
Root directory starts at byte 260608 (sector 509)
64 root directory entries
Data area starts at byte 262656 (sector 513)
64485 data clusters (33016320 bytes)
1 sectors/track, 1 heads
0 hidden sectors
64998 sectors total
/EV3
Contains a free cluster (738). Assuming EOF.
/Projects
Contains a free cluster (737). Assuming EOF.
/dmesg.txt
File size is 131072 bytes, cluster chain length is > 131072 bytes.
Truncating file to 131072 bytes.
Volume label 'EV3' stored in root directory and label 'EV3' stored in boot sector and different.
1) Copy volume label from root directory to boot sector
2) Copy label from boot sector to root directory
[12?q]?
Any help will be appreciated.