STM32_HID_Bootloader icon indicating copy to clipboard operation
STM32_HID_Bootloader copied to clipboard

Hid-flash 64-bit binaries

Open fpistm opened this issue 1 year ago • 1 comments

Hi @Serasidis

Hope you are fine 🙂

Did you test 64-bit binaries ? I would like to switch on 64-bit version as the arm-none-eabi toolchain only support 64-bit since 1 year. I've built hid-flash for Windows ans Linux. On windows it works while on Linux a segmentation fault is raised. I will try to debug to understand why. It would be fine to also provides this version

fpistm avatar Mar 19 '24 19:03 fpistm

Digging into the code, I've found the issue. It is linked to #30. Since I've change my Laptop, the udev rule was not present causing the fail on Linux and so the seg fault. Applying the patch fix the issue (thanks @matthijskooijman)

I've just add a specific warning for Linux about the udev rule:

@@ -131,12 +131,15 @@ int main(int argc, char *argv[]) {
     goto exit;
   } 
   
   handle = hid_open(VID, PID, NULL);
   
-  if (i == 10 && handle != NULL) {
+  if (handle == NULL) {
     printf("\n> Unable to open the [%04X:%04X] device.\n",VID,PID);
+#if defined(__linux__)
+    printf("> Please, ensure to have installed udev rule.\n");
+#endif
     error = 1;
     goto exit;
   }
  
   printf("\n> [%04X:%04X] device is found !\n",VID,PID);

fpistm avatar Mar 20 '24 09:03 fpistm