Menu

Focuser Pro2 DIY Teensy 4.0

DGEDGEDGE
2025-04-12
2025-04-24
  • DGEDGEDGE

    DGEDGEDGE - 2025-04-12

    Hi,
    I have for some reason a board made with a teensy4.0 and some stepper.
    I wanted to compile the "// myFOCUSERPRO2 OFFICIAL FIRMWARE RELEASE 338 (11-Oct-2024)" on this architecture, but I did had some issues :

    In file included from /home/denis/Téléchargements/myFocusseurPro2/myFP2_Firmware_338/myFP2_A4998_338/myFP2_A4998_338.ino:80:
    /home/denis/Téléchargements/myFocusseurPro2/myFP2_Firmware_338/myFP2_A4998_338/serialcomms.h: In function 'void ser_comms()':
    /home/denis/Téléchargements/myFocusseurPro2/myFP2_Firmware_338/myFP2_A4998_338/serialcomms.h:241:42: error: 'class String' has no member named 'toDouble'
      241 |         double tempstepsize = WorkString.toDouble();
    

    Before beginning to modify the sources code, I was wondering if someone did the job at some point, and who to contact to have support for pushing some modifications to the main stream, and do them the right way.

    Regards;

     
  • DGEDGEDGE

    DGEDGEDGE - 2025-04-12

    After correction that issue I ended to the following which seems much more complicated....

    In file included from /home/denis/Téléchargements/myFocusseurPro2/myFP2_Firmware_338/myFP2_A4998_338/config.h:9,
                     from /home/denis/Téléchargements/myFocusseurPro2/myFP2_Firmware_338/myFP2_A4998_338/myFP2_A4998_338.ino:59:
    /home/denis/Téléchargements/myFocusseurPro2/myFP2_Firmware_338/myFP2_A4998_338/myBoardDefs.h:72:37: warning: multi-line comment [-Wcomment]
       72 | #define DRV8825HW203_KEYPAD4x4 116  // DRV8825HW203_M_MT_F_BT PCB + DRV8825HW203_KEYPAD4x4 sub-board \
          |                                     ^
    /home/denis/Téléchargements/myFocusseurPro2/myFP2_Firmware_338/myFP2_A4998_338/myFP2_A4998_338.ino: In function 'void loop()':
    /home/denis/Téléchargements/myFocusseurPro2/myFP2_Firmware_338/myFP2_A4998_338/myFP2_A4998_338.ino:413:24: warning: unused variable 'DisplayUpdate' [-Wunused-variable]
      413 |   static unsigned long DisplayUpdate = millis();
          |                        ^~~~~~~~~~~~~
    /home/denis/Téléchargements/myFocusseurPro2/myFP2_Firmware_338/myFP2_A4998_338/myFP2_A4998_338.ino:414:24: warning: unused variable 'TempUpdate' [-Wunused-variable]
      414 |   static unsigned long TempUpdate = millis();
          |                        ^~~~~~~~~~
    /home/denis/Téléchargements/myFocusseurPro2/myFP2_Firmware_338/myFP2_A4998_338/myFP2_A4998_338.ino:417:15: warning: unused variable 'updatecount' [-Wunused-variable]
      417 |   static byte updatecount = 0;
          |               ^~~~~~~~~~~
    /home/denis/Téléchargements/myFocusseurPro2/myFP2_Firmware_338/myFP2_A4998_338/myFP2_A4998_338.ino: At global scope:
    /home/denis/Téléchargements/myFocusseurPro2/myFP2_Firmware_338/myFP2_A4998_338/myFP2_A4998_338.ino:417:15: warning: 'updatecount' defined but not used [-Wunused-variable]
    In file included from /home/denis/Téléchargements/myFocusseurPro2/myFP2_Firmware_338/myFP2_A4998_338/myFP2_A4998_338.ino:80:
    /home/denis/Téléchargements/myFocusseurPro2/myFP2_Firmware_338/myFP2_A4998_338/serialcomms.h: In function 'void ser_comms()':
    /home/denis/Téléchargements/myFocusseurPro2/myFP2_Firmware_338/myFP2_A4998_338/serialcomms.h:75:32: warning: '%c' directive output may be truncated writing 1 byte into a region of size between 0 and 31 [-Wformat-truncation=]
       75 |   snprintf(buff, sizeof(buff), "%c%s%c", token, str, EOC);
          |                                ^~~~~~~~
    /home/denis/Téléchargements/myFocusseurPro2/myFP2_Firmware_338/myFP2_A4998_338/serialcomms.h:75:11: note: 'snprintf' output between 3 and 34 bytes into a destination of size 32
       75 |   snprintf(buff, sizeof(buff), "%c%s%c", token, str, EOC);
          |   ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /home/denis/.var/app/cc.arduino.IDE2/cache/cc13fb6p.s: Assembler messages:
    /home/denis/.var/app/cc.arduino.IDE2/cache/cc13fb6p.s:1886: Error: bad instruction `jmp 0'
    /home/denis/.var/app/cc.arduino.IDE2/cache/cc13fb6p.s:4540: Error: bad instruction `jmp 0'
    Multiple libraries were found for "TimerOne.h"
      Used: /home/denis/Arduino/libraries/TimerOne
      Not used: /home/denis/.arduino15/packages/teensy/hardware/avr/1.59.0/libraries/TimerOne
    exit status 1
    
    Compilation error: exit status 1
    
     
  • DGEDGEDGE

    DGEDGEDGE - 2025-04-13

    I found the issue.
    This is due to the way the reboot is requested and done on the arduino.
    So I changes the following :

    void software_Reboot() {
    // begin DGEDGEDGE
    // asm volatile("jmp 0"); // jump to the start of the program

    Serial.println("Redémarrage du Teensy...");
    SCB_AIRCR = 0x05FA0004; // Forcer un redémarrage
    // End DGEDGEDGE
    }

    In summary save the hardware, the pin allocation, I made 2 modifications to have the software compile on the teensy :

    1- The reboot instruction in the current port..
    2- Change to the string to 'double' in previous post.

     
  • DGEDGEDGE

    DGEDGEDGE - 2025-04-13

    Next Step: change the serial which is the USB serial to a real serila to cennect to a raspberry. via the serial.

     
  • DGEDGEDGE

    DGEDGEDGE - 2025-04-13

    If I succeed I will have an implementation of the code compatible with teensy vi CPP def variables.
    How to propose this modification ?

     
  • DGEDGEDGE

    DGEDGEDGE - 2025-04-14

    After some errors in modifications I now have a code which works, and integration with Indi Driver is OK.
    Where to post the main modifications ?

    As a return of experience, the modifications are very low and are mainly :
    1- Change Serial in Serial1 and serialEvent in serialEvent1
    2- Change in rebot code.
    3- change in float/double access.

    I did not include any screen and temperature sensor.

     
  • brownrb

    brownrb - 2025-04-24

    Its okay to attach the files to a reply.
    If you can make a zip file, add a text explanation detailing the hardwarem where to purchase, arduino IDE settings (screenshot is ok) and a picture of finished focuser (I mean the board etc so people can see what it looks like, then I can add that into the Firmware folder and reference it in the next PDF userguide for the is project,

    many thanks
    Robert

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.