Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manually Building SuperLongBoard STM32F412 #193

Open
siganberg opened this issue Oct 15, 2024 · 16 comments
Open

Manually Building SuperLongBoard STM32F412 #193

siganberg opened this issue Oct 15, 2024 · 16 comments

Comments

@siganberg
Copy link

Since the SuperLongBoard is not yet available in Web Builder, I'm trying to build firmware for the LongBoard32, but I can't seem to get it working, and I keep encountering errors.

So far, I have created an entry in the platformio.ini file:


[env:f412vg_SLB]
board = genericSTM32F412VG
custom_prog_version = SLB
board_build.ldscript = STM32F412VGTX_FLASH.ld
build_flags = ${common.build_flags} 
  -D BOARD_LONGBOARD32=1
  -D SLB_EEPROM_ENABLE=1
  -D SIENCI_LASER_PWM=1
  -D SDCARD_ENABLE=2 
  -D _VOLUMES=1  
lib_deps = ${common.lib_deps}
  FatFs
  eeprom
lib_extra_dirs = ${common.lib_extra_dirs}  
upload_protocol = stlink

I also added an entry in driver.json:

  {
      "name": "Longboard32",
      "symbol": "BOARD_LONGBOARD32",
      "URL": "https://github.com/Sienci-Labs/SuperLongBoard",
      "MAP": "boards/longboard32_map.h",
      "caps": {
        "axes": 5,
        "auto_square": 2,
        "digital_in": 3,
        "digital_out": 4,
        "eeprom": -2,
        "fram": 0,
        "i2c": 1,
        "sdcard": 1,
        "keypad": 1,
        "pio_board": "genericSTM32F412VG",
        "ldscript": "STM32F412VGTX_FLASH.ld"
      },
      "symbols": {
          "STM32F446xx": "",
          "HAS_BOOTLOADER": ""
      }

I copied the genericSTM32F412VG.json file to the root folder. This file can be found here: (https://github.com/Sienci-Labs/sienciHAL/blob/SLB_Bringup_Dev/genericSTM32F412VG.json).

Then, I executed the following command:

pio run -e f412vg_SLB

I started with fewer plugins to have a successful build, but I keep getting errors after fixing one issue. Before going down the rabbit hole of trying to fix all the errors, I figured I'd ask if anyone has already had a successful build.

The reason I am building this is that the core of the Sienci grblHAL firmware is not up to date.

@terjeio
Copy link
Contributor

terjeio commented Oct 15, 2024

Here is the platformio.ini I use to build the latest version with VSCode/PlatformIO:
Note that this build has not been verified yet!

platformio.zip

@siganberg
Copy link
Author

Do you have the extra scripts?

extra_scripts = 
    pre:extra_script.py
    post:extra_script.py

image

@siganberg
Copy link
Author

Not sure if the script is important but if I take it out, I'm getting this errors:

image

@terjeio
Copy link
Contributor

terjeio commented Oct 15, 2024

Do you have the extra scripts?

It is found here.

Not sure if the script is important but if I take it out, I'm getting this errors:

Do you have the latest grblHAL version?

@siganberg
Copy link
Author

siganberg commented Oct 15, 2024

The core? Yes

image

I manage to have successful compilation by disabling the the following. Will adding Sienci custom plugins and looking to fix those 2 flags.

 -D EVENTOUT_ENABLE=0
  -D RGB_LED_ENABLE=0

Thanks a lot for the help, really appreciate it.

@terjeio
Copy link
Contributor

terjeio commented Oct 15, 2024

Will adding Sienci custom plugins and looking to fix those 2 flags.

Do a recursive pull to get the latest submodules instead, recently a new one was added for the two you disabled.

@siganberg
Copy link
Author

siganberg commented Oct 15, 2024

Do a recursive pull to get the latest submodules instead, recently a new one was added for the two you disabled.

I already did a recursive pull but I'm still getting errors with those two flags turned ON. For now, I've kept them OFF. I'm also just adding the custom Sienci plugins they included, such as boot_entry, rgb, and probing. Anything that matches with the repo, I left as is and pulled the latest changes.

I loaded the firmware for the SLB. The issue is that the motors are not getting power after I performed a firmware reset. Restoring the SienciHal firmware brings the stepper motors back online. Before resetting, the motors had a slightly high-pitched sound when moving. I'm not sure if this is caused by the settings for the TMC2660. Setting number don't much, they are off by 1 whey I compare with SienciHal.

image

@terjeio
Copy link
Contributor

terjeio commented Oct 15, 2024

Boot entry is part of the base driver so not needed, basic RGB support is also, with a core defined API. I have not looked into the probing plugin yet. There should be a plugins folder with the eventout and rgb plugins:

image

If not download and add it manually - making it generally available is still work in progress.

I loaded the firmware for the SLB. The issue is that the motors are not getting power after I performed a firmware reset.

What is your $4 setting? And M122 output?

Setting number don't much, they are off by 1 whey I compare with SienciHal.

Some SienciHal setting numbers were added without requesting them from me and they were already assigned for other purposes. So those had to change. Reloading SienciHal settings into grblHAL is thus a bad idea.

@siganberg
Copy link
Author

Pulling the Plugins fixed the two issue with enabling EVENTOUT_ENABLE and RGB_LED_ENABLE. It's not currently added on this repo.

There is another flag STATUS_LIGHT_ENABLE which is on the rgb plugins of sienci so If take it off I also need to turn that off. Already remove the boot_entry as you suggested.

Some SienciHal setting numbers were added without requesting them from me and they were already assigned for other purposes. So those had to change. Reloading SienciHal settings into grblHAL is thus a bad idea.

I agree, that's why I'm trying to switch. :D

@siganberg
Copy link
Author

Here's my test result.

  • Homing doesn't work and freeze the board, need hard power cycle.
  • Jogging doesn't update the coordinates.
  • Hitting e-stop doesn't show any ALARM. Reconnecting the board then shows the ALARM 10. Resetting e-stop doesn't work or unlocking the machine ($X). Require hard reboot to continue.
  • typing in the console doesn't show any response like getting value of ${parameter} or $$.

What works so far:

  • Jog dial works.
  • Spindle (modbus)

I'm using gSender since I don't have any other grblHal sender to try on macos.

Attaching diagnostic file from gSender which has all the firmware paramenters.

diagnostics_10-15-2024_09-53-05.pdf

@terjeio
Copy link
Contributor

terjeio commented Oct 16, 2024

Homing doesn't work and freeze the board, need hard power cycle.

This has now been fixed.

The rest I am not so sure about, can you connect with a terminal and try some commands from that?
FYI I do not have a SLB with me where I am now so cannot test myself, other drivers I do have access to works as they should so you may have wait a bit for the rest to be resolved.

@siganberg
Copy link
Author

siganberg commented Oct 16, 2024

Great! I will test it tomorrow. Will provide feedback.

IMHO, Sienci should send you one for the great work you been doing. 👍

@terjeio
Copy link
Contributor

terjeio commented Oct 16, 2024

IMHO, Sienci should send you one for the great work you been doing.

I have one at home, but I am away for 3 more weeks...

@siganberg
Copy link
Author

siganberg commented Oct 16, 2024

Try the latest. I initially still got problem with the homing so decided to do RST and start from scratch the it works. So far everything is working except for the tool set routine with my RapidChangeATC.

When I touches the tool setter, it stop and freeze the board.
https://youtu.be/h3W3Max4_Ig?si=RnjEP9GS6LAyygQp&t=58

Macro used for tool change for reference: https://github.com/greilick-industries/rcatc-scripts-grblhal/blob/main/macros/TC.macro

This one is working with sienciHal but has some other minor issue.

@terjeio
Copy link
Contributor

terjeio commented Oct 17, 2024

If I run the the tool setter macro (g65p231) directly on a STM32F7xx dev board it completes correctly - so this might be an issue with the SLB. If you try to probe the toolsetter manually does it still crash?

@terjeio
Copy link
Contributor

terjeio commented Oct 24, 2024

FYI I have commited some fixes to expression handling that may help if it is a hang, not a crash.

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

No branches or pull requests

2 participants