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

pinmapping is always generic_map.c #56

Closed
kokospalme opened this issue Oct 19, 2024 · 9 comments
Closed

pinmapping is always generic_map.c #56

kokospalme opened this issue Oct 19, 2024 · 9 comments

Comments

@kokospalme
Copy link

kokospalme commented Oct 19, 2024

Uploading STM32F1xx-master.zip…
I have a BTT SKR MINI E3 V2.0 board, which I want to use with grblHAL. Therefore I uncomment #define BOARD_BTT_SKR_MINI_E3_V20 in my_machine.h. The code compiles as expected and the board seems do boot, but with the default mapping from generic_map.h. So When I check the mapping, I get this:

>>> $pins
[PIN:PB6,Feed hold]
[PIN:PB7,Cycle start]
[PIN:PB5,Emergency stop]
[PIN:PA7,Probe]
[PIN:PB12,X limit min]
[PIN:PB13,Y limit min]
[PIN:PB14,Z limit min]
[PIN:PB15,A limit min]
[PIN:PB8,Aux in 0,P0]
[PIN:PA15,Aux in 1,P1]
[PIN:PA0,X step]
[PIN:PA1,Y step]
[PIN:PA2,Z step]
[PIN:PA3,A step]
[PIN:PA4,X dir]
[PIN:PA5,Y dir]
[PIN:PA6,Z dir]
[PIN:PA7,A dir]
[PIN:PA15,Steppers enable]
[PIN:PB1,Spindle on]
[PIN:PB0,Spindle direction]
[PIN:PA8,Spindle PWM]
[PIN:PB3,Mist]
[PIN:PB4,Flood]
[PIN:PA10,RX,Primary UART]
[PIN:PA9,TX,Primary UART]
ok

When no board is selected, the code compiles, and I get the same pinmapping:

// NOTE: Only one board may be enabled!
// If none is enabled pin mappings from generic_map.h will be used.
//#define BOARD_CNC3040
//#define BOARD_CNC_BOOSTERPACK
//#define BOARD_MACH3_BOB
// #define BOARD_BTT_SKR_MINI_E3_V20
//#define BOARD_BTT_SKR_MINI_E3_V20_ALT2
//#define BOARD_SVM
//#define BOARD_CREALITY_V2_2_2 // Not tested!
//#define BOARD_CREALITY_V2_2_7 // Not tested!
// #define BOARD_MY_MACHINE // Add my_machine_map.h before enabling this!

And no matter which line I uncomment, the values are always chosen from generic_map.h.

I already tried to copy and paste everything from btt_skr_mini_e3_2.0_map.hto ```generic_map.h``, but this caused a whole bunch of errors...

Did I miss something here?
Thank you in advance

*edit:
When I replace generic_map.hwith the few lines from here, I get this error:

In file included from USB_DEVICE/App/usbd_cdc_if.c:26:0:
Inc/driver.h:255:2: error: #error Trinamic plugin not supported!

Why is the trinamic plugin not supported? Don't i need this to get acces to this specific drivers?
And did I install it correct?

  • put trinamic.c and .h into the motorsfolder
  • put a folder called trinamic with all the files from the plugin into the project folder
@terjeio
Copy link
Contributor

terjeio commented Oct 19, 2024

Can see anything immieadtely wrong, and I do not have access to a board to test with.
Can you try by moving the contents of line 110 to line 124?

And did I install it correct?

Did you fetch the project recursively so that the submodules was included?

@kokospalme
Copy link
Author

kokospalme commented Oct 19, 2024

thanks for the quick reply. suprisingly the define BOARD_BTT_SKR_MINI_E3_V20 is not found in driver.h.
When I swap line 110 to line 124, to force including btt_skr_mini_e3_2.0_map.h I get the following error:

In file included from Inc/i2c.h:25:0,
                 from Src/i2c.c:24:
Inc/driver.h:255:2: error: #error Trinamic plugin not supported!
 #error Trinamic plugin not supported!
  ^~~~~
In file included from Src/diskio.c:15:0:
Inc/driver.h:255:2: error: #error Trinamic plugin not supported!
 #error Trinamic plugin not supported!
  ^~~~~
In file included from Src/driver.c:31:0:
Inc/driver.h:255:2: error: #error Trinamic plugin not supported!
 #error Trinamic plugin not supported!
  ^~~~~
In file included from Src/btt_skr_mini_e3_2.0.c:24:0:
Inc/driver.h:255:2: error: #error Trinamic plugin not supported!
 #error Trinamic plugin not supported!
  ^~~~~
In file included from motors/trinamic.c:25:0:
Inc/driver.h:255:2: error: #error Trinamic plugin not supported!
 #error Trinamic plugin not supported!
  ^~~~~
*** [.pio/build/BTT_SKR_MINI_E3_V20/src/i2c.o] Error 1
*** [.pio/build/BTT_SKR_MINI_E3_V20/src/diskio.o] Error 1
*** [.pio/build/BTT_SKR_MINI_E3_V20/src/btt_skr_mini_e3_2.0.o] Error 1
In file included from USB_DEVICE/App/usbd_cdc_if.c:26:0:
Inc/driver.h:255:2: error: #error Trinamic plugin not supported!
 #error Trinamic plugin not supported!
  ^~~~~
Src/driver.c:66:10: fatal error: eeprom/eeprom.h: No such file or directory
 #include "eeprom/eeprom.h"
          ^~~~~~~~~~~~~~~~~
compilation terminated.
*** [.pio/build/BTT_SKR_MINI_E3_V20/src/driver.o] Error 1
*** [.pio/build/BTT_SKR_MINI_E3_V20/lib04c/App/usbd_cdc_if.o] Error 1
*** [.pio/build/BTT_SKR_MINI_E3_V20/lib788/motors/trinamic.o] Error 1

What do you mean with recursively? I already read the grblHAL wiki, the readmes and other stuff from the grblHAL plugin repository, but I don't really understand, how these plugins are properly installed.

@kokospalme
Copy link
Author

kokospalme commented Oct 19, 2024

Okay, I just found out that I can clone the repository with git clone --recursive <repository-url> to get all the submodules. But I get the same compiling error as mentioned above...
What I don't understand is why the trinamic plugin shouldn't be supported (see here)
When I comment this out, I get another error:

trinamic/tmc2660.c: In function 'TMC2660_GetCurrent':
trinamic/tmc2660.c:199:12: warning: 'cs' may be used uninitialized in this function [-Wmaybe-uninitialized]
     return cs2rms_2660(driver, cs);
            ^~~~~~~~~~~~~~~~~~~~~~~
Compiling .pio/build/BTT_SKR_MINI_E3_V20/src/stm32f1xx_hal_msp.o
Compiling .pio/build/BTT_SKR_MINI_E3_V20/src/stm32f1xx_it.o
Compiling .pio/build/BTT_SKR_MINI_E3_V20/src/usb_serial.o
Linking .pio/build/BTT_SKR_MINI_E3_V20/firmware.elf
.pio/build/BTT_SKR_MINI_E3_V20/src/driver.o: In function `driver_init':
driver.c:(.text.driver_init+0x390): undefined reference to `board_init'
collect2: error: ld returned 1 exit status
*** [.pio/build/BTT_SKR_MINI_E3_V20/firmware.elf] Error 1

So I don't understand where the problem could be. Could someone maybe post his/her project folder in a zip file, so I can compare it to my own? this would be really helpful!

*edit:

As soon as I define TRINAMIC_ENABLE I get the error Trinamic plugin not supported!, even when no board is selected. Now I'm completely confused.
Btw, I'm using PlatformIO. Could this has something todo with this weird behavior?

@kokospalme
Copy link
Author

Can see anything immieadtely wrong, and I do not have access to a board to test with. Can you try by moving the contents of line 110 to line 124?

And did I install it correct?

Did you fetch the project recursively so that the submodules was included?

But can you compile the code? If yes, would you like to put the project folder in a .zip and put it in conversation? I would really like to compare it to my own to find the error.
Many thanks

@terjeio
Copy link
Contributor

terjeio commented Oct 25, 2024

Are you compiling with the STM32CubeIDE or PlatformIO?
If the latter then the platformio.ini file is not correct, -D BTT_SKR_MINI_E3_V20= should be -D BOARD_BTT_SKR_MINI_E3_V20=
Somebody with PlatformIO installed should check/update platformio.ini and submit a PR for it.

@terjeio
Copy link
Contributor

terjeio commented Oct 25, 2024

FYI I just added this to the Wiki.

@kokospalme
Copy link
Author

Many thanks! That helped.

@kokospalme
Copy link
Author

Are you compiling with the STM32CubeIDE or PlatformIO?

sorry I overlooked your question. I'm compiling with PlatformIO.

@terjeio
Copy link
Contributor

terjeio commented Nov 21, 2024

I'm compiling with PlatformIO.

Then my_machine.h is not used, options has to be specified in the platformio.ini file. Or remove/comment out -D OVERRIDE_MY_MACHINE to use my_machine.h anyway

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