Coder Social home page Coder Social logo

lpc176x's Introduction

LPC176x grblHAL driver

A GrblHAL driver for NXP LPC1768 and LPC1769 processors.

Loosely based on the official grbl-LPC port.

See the Wiki-page for compiling grblHAL for instructions for how to import the project, configure the driver and compile.

Available driver options can be found here.

Update 2020-12-11:

  • Added initial board map file for Bigtreetech SKR V1.3 Turbo board.

Update 2020-11-21:

  • Added initial board map file for BTT SKR V1.4 Turbo board.
  • Added polling of limit switches, enabling hard limits is now possible.

A build option for creating a Firmware.bin file that can be used for programming via the Smoothieboard DFU-bootloader has been added to build configurations.
Select the BL_0x4000 configuration from the build tool dropdown to build, and programming can then be done via SD card transfer:
Config
Firmware.bin is found in the BL_0x4000 project folder after a successful build.

Update 2020-01-01:

  • Added board map file for Ramps 1.6 on Re-ARM board hacked for programming via Segger J-Link. Improved pin assignment handling and fixed some bugs. USB comms and SD card seems to be working ok for this board, however only limited testing done.

Update 2019-08-08:


Board maps:

N_AXIS Ganged axes1 EEPROM2 SD card Modbus I2C Keypad Encoders Digital I/O Analog I/O
Generic max 5 no external external no no - - -
BOARD_RAMPS_16 max 5 no external external no no - - -
BOARD_BTT_SKR_13 max 5 no external onboard no no - - -
BOARD_BTT_SKR_14_TURBO max 5 no external onboard no no - - -
BOARD_MKS_SBASE_13 max 5 no external onboard no no - - -
SMOOTHIEBOARD max 5 no external onboard no no - - -

1 Each enabled reduces N_AXIS with one. Currently the board map file must be edited to enable ganged/auto squared axes.
2 I2C EEPROM (or FRAM) is optional and must be added externally. FRAM is recommended when the Odometer plugin is added to the build.


2021-04-28

lpc176x's People

Contributors

benkei avatar fires04 avatar slayerto avatar terjeio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

lpc176x's Issues

SKR V1.3 - Error 9 After compiling and flashing to board

I've successfully compiled and created a firmware.bin file, it flashes to my board, a BTT SKR V1.3 board with LPC 1768 chip. My computer sees and assigns a com port, however i cant connect to the board. I receive an error 9 and i cant connect. Ive tried pronterface and also the machine control panel in Simplify3D. Ive reviewed all the files in MCUXpresso and I dont see where I can verify the baud rate, however no baud rate that i choose in pronterface allows me to connect.

Invert A/B (ganged y) stepper enable pins?

When using a ganged Y config with an SKR 1.4 it is not possible that i've found to invert the A or B steppers enable pins which makes them inoperative,

Hopefully im missing something but thus far i have not found anything.

Currently my $4 is set to 7 if that helps

Probe Pin BTT SKR 1.3

btt_skr_1.3_map.h - default probe pin is 0.12, should this be 0.17?
(might just be me, but I cant find a 0.12 on the lpc1768)

Laser and spindle on MKS Sbase V1.3

Hey there,
Since two days I am trying to get a firmware ready based on grblHAL for the MKS Sbase v1.3 which is capable of using two different PWM pins for controlling laser and spindle. I think I am missing something or just being too stupid to put the pieces together.
I think I found the relevant parts in the respective *.h files but I was not able so far to get the things working.
From the mks_sbase_map.h the relevant part is to my mind the following:

_// Define driver spindle pins

#if DRIVER_SPINDLE_PWM_ENABLE
#ifdef SPINDLE_PWM_PIN_2_4
#define SPINDLE_PWM_CHANNEL PWM1_CH5 // MOSFET3 (P2.4)
#else
#define SPINDLE_PWM_CHANNEL PWM1_CH6 // BED MOSFET (P2.5)
#endif
#define SPINDLE_PWM_USE_PRIMARY_PIN false
#define SPINDLE_PWM_USE_SECONDARY_PIN true
#else
#define AUXOUTPUT0_PN 2
#define AUXOUTPUT0_PORT port(AUXOUTPUT0_PN)
#define AUXOUTPUT0_PIN 4
#endif_

I also found in the config.h the part for the definition of the number of spindles/PWM devices:

/*! \def N_SPINDLE
\brief Defines number of spindles supported - minimum 1, maximum 32.
*/
#if !defined N_SPINDLE || defined DOXYGEN
#define N_SPINDLE 2
#endif

Here, I suppose that I should increase the number to 2...

And then finally the part of my_machine.h:

#define SPINDLE0_ENABLE SPINDLE_PWM0
#define SPINDLE1_ENABLE SPINDLE_PWM1
//#define SPINDLE2_ENABLE SPINDLE_PWM0_CLONE
//#define SPINDLE3_ENABLE SPINDLE_NONE
// **********************

But now I don't understand how to tell the code that I want to use two different PWM pins for the devices and also were to remap the respective pins accordingly. Also the PWM-Channel thing form the mks_sbase_map.h is unclear for me. And the final question for me is how two switch between the two PWM devices in a respective controlling software?

I am really confused at this point and your help is more than aprreciated.

Thanks you and best regards

Florian

Cant change the microsteping value

Hi, i cant change microstepping value from 16.
Every time i change it, it get back to 16.
Board BTT SKR 1.4T
I tried it with TMC2209 and TMC2130

What im doing wrong ?

[VER:1.1f.20210928:]
[OPT:VNMZSL,49,1024,3,0]
Target buffer size found
[NEWOPT:ENUMS,RT+,HOME,TC,SED,SD]
[FIRMWARE:grblHAL]
[NVS STORAGE:*FLASH]
[DRIVER:LCP1769]
[DRIVER VERSION:210908]
[BOARD:BTT SKR V1.4 Turbo]
[PLUGIN:Trinamic v0.05]
[PLUGIN:SDCARD v1.02]

Latest build will not compile (5 Errors)

Thank you for your work, I was trying to update my grblhal to the latest branch and have the following errors when compiling. (usb, 5160,skr1.4turbo) any suggestions to fix this? Thank you

error

SKR 1.4 turbo Serial RX/TX Wifi

Hello, I am trying to use this to use the board with Wifi instead of USB. I've commented "#define USB_SERIAL_CDC" in my_machine.h, I've put these:

  • {4, 28, IOCON_MODE_INACT | IOCON_FUNC1}, /* TXD3 */
    
  • {4, 29, IOCON_MODE_INACT | IOCON_FUNC1}  /* RXD3 */
    
  • #define SERIAL_IRQHandler UART3_IRQHandler
    
  • #define SERIAL_MODULE     LPC_UART3
    
  • #define SERIAL_MODULE_INT UART3_IRQn
    

but I can't manage to connect through serial, the web page for esp works, I've set it to GRBL but can't manage to get data from it. Anyone knows how I can make this work?

LPC176x build fails with TMC2209 drivers

Hello everyone, I'm trying to make a firmware for skr 1.3 with TMC2209 drivers, but I'm have error
compiler MCUXpresso IDE v11.6.1_8255. does anyone know how to solve the problem?

../src/tmc_uart.c:375:34: warning: passing argument 2 of 'hal.enumerate_pins' from incompatible pointer type [-Wincompatible-pointer-types]
375 | hal.enumerate_pins(true, add_uart_pin);
| ^~~~~~~~~~~~
| |
| void (*)(xbar_t )
../src/tmc_uart.c:375:34: note: expected 'pin_info_ptr' {aka 'void (
)(xbar_t *, void )'} but argument is of type 'void ()(xbar_t *)'
../src/tmc_uart.c:375:9: error: too few arguments to function 'hal.enumerate_pins'
375 | hal.enumerate_pins(true, add_uart_pin);
| ^~~
At top level:
../src/tmc_uart.c:83:24: warning: 'outputpin' defined but not used [-Wunused-variable]
83 | static output_signal_t outputpin[] = {
| ^~~~~~~~~
make[1]: *** [src/subdir.mk:66: src/tmc_uart.o] Error 1
make[1]: *** Waiting for unfinished jobs....
Finished building: ../src/serial.c

Finished building: ../src/usb_serial.c

Finished building: ../src/driver.c

make: *** [makefile:48: all] Error 2
"make -r -j12 all" terminated with exit code 2. Build might be incomplete.

15:17:31 Build Failed. 4 errors, 25 warnings. (took 3s.264ms)
error.txt

2209 and compile problem

Im sure this is just user error but im a bit stuck i have a skr1.4turbo with 2209s in the my machine config there is only options for 2130 oe 5160, i see there is a 2209 hal in the trimatic folder. i tried to just add "#define TRINAMIC_ENABLE 2209" but had a bunch of errors. so im not sure how to add the 2209

Unable to compile SKR 1.4 Turbo with TM2209

Hello I try to compile the firmware in MCUXpresso IDE. But I getting error in build. If I comment the #define TRINAMIC_ENABLE 2209 the build is ok.

Error:

../src/tmc_uart.c: In function 'if_init':
../src/tmc_uart.c:375:34: warning: passing argument 2 of 'hal.enumerate_pins' from incompatible pointer type [-Wincompatible-pointer-types]
  375 |         hal.enumerate_pins(true, add_uart_pin);
      |                                  ^~~~~~~~~~~~
      |                                  |
      |                                  void (*)(xbar_t *)
../src/tmc_uart.c:375:34: note: expected 'pin_info_ptr' {aka 'void (*)(xbar_t *, void *)'} but argument is of type 'void (*)(xbar_t *)'
../src/tmc_uart.c:375:9: error: too few arguments to function 'hal.enumerate_pins'
  375 |         hal.enumerate_pins(true, add_uart_pin);
      |         ^~~
At top level:
../src/tmc_uart.c:83:24: warning: 'outputpin' defined but not used [-Wunused-variable]
   83 | static output_signal_t outputpin[] = {
      |                        ^~~~~~~~~
make[1]: *** [src/subdir.mk:66: src/tmc_uart.o] Error 1
make[1]: *** Waiting for unfinished jobs....
Finished building: ../src/usb_serial.c
 
Finished building: ../src/serial.c
 
Finished building: ../src/driver.c
 
make: *** [makefile:46: all] Error 2
"make -r -j8 all" terminated with exit code 2. Build might be incomplete.

my_machine.h

// NOTE: Only one board may be enabled!
// If none is enabled pin mappings from generic_map.h will be used
//#define SMOOTHIEBOARD
//#define BOARD_RAMPS_16
//#define BOARD_BTT_SKR_13
#define BOARD_BTT_SKR_14_TURBO
//#define BOARD_BTT_SKR_E3_TURBO  // With onboard Trinamic TNMC2209 drivers. NOTE: not verified!
//#define BOARD_MKS_SBASE_13
//#define BOARD_MY_MACHINE // Add my_machine_map.h before enabling this!

// Configuration
// Uncomment to enable, for some a value > 1 may be assigned, if so the default value is shown.

#ifndef USB_SERIAL_CDC
//#define USB_SERIAL_CDC     1 // Comment out to use UART communication.
#endif
//#define SAFETY_DOOR_ENABLE 1 // Enable safety door input.
//#define SDCARD_ENABLE      1 // Run gcode programs from SD card, requires sdcard plugin.
//#define MPG_ENABLE         1 // Enable MPG interface. Requires serial port and one handshake pin.
//#define TRINAMIC_ENABLE 2130 // Uncomment to enable Trinamic TMC2130 driver support. NOTE: Experimental for now, currently for SKR 1.x boards only
#define TRINAMIC_ENABLE 2209 // Uncomment to enable Trinamic TMC5160 driver support. NOTE: Experimental for now, currently for SKR 1.x boards only
//#define TRINAMIC_ENABLE 5160 // Uncomment to enable Trinamic TMC5160 driver support. NOTE: Experimental for now, currently for SKR E3 Turbo board only
//#define LIMIT_MAX_ENABLE   1 // Uncomment to enable max limit input pins (when available)
//#define EEPROM_ENABLE      1 // I2C EEPROM support. Set to 1 for 24LC16(2K), 2 (64 byte pages) or 3 (32 byte pages) for larger sizes. Requires eeprom plugin.
//#define EEPROM_IS_FRAM     1 // Uncomment when EEPROM is enabled and chip is FRAM, this to remove write delay.

// If the selected board map supports more than three motors ganging and/or auto-squaring
// of axes can be enabled here.
//#define X_GANGED            1
//#define X_AUTO_SQUARE       1
#define Y_GANGED            1
#define Y_AUTO_SQUARE       1
//#define Z_GANGED            1
//#define Z_AUTO_SQUARE       1
// For ganged axes the limit switch input (if available) can be configured to act as a max travel limit switch.
// NOTE: If board map already has max limit inputs defined this configuration will be ignored.
//#define X_GANGED_LIM_MAX    1
//#define Y_GANGED_LIM_MAX    1
//#define Z_GANGED_LIM_MAX    1

Spindle enable and direction not changing state

Hello, the SKR 1.4 turbo has pins 1.23 and 1.24 defined as spindle enable and direction. I'm using I/O sender edge i can select turn on the spindle CW or CCW and pins 1.23 and 1.24 do not change state. Between the pins and +5V I get 5V and between pins and ground, i get 0V So the pin is Low/ground all the time. Flood and mist seam to work in the same EXP1 connector

ice_screenshot_20211218-104951

ice_screenshot_20211218-122830

Second serial interface

Hi, GRBLHAL runs very nice on the MKS BASE 1.3, thanks for this driver and all the help to get it starting.
I've got a last question. I would like to create an external jogger and need a second serial port for this. There is an expansion port on this board, that is used for the external TFT. It uses serial communication, so there must be a pair of RX/TX signals, but my attempts all failed until now. Is there a possibility to access the second serial port with GRBLHAL ? This would make it much easier to communicate with the board.

LPC1769 pins to SKR 1.4 Turbo

Hi @terjeio, thanks alot for your work here ๐Ÿ˜Š
I've spent a little time trying to get my head round how the pin mappings work. I've come to realise that it is the pins of the actual chip and not the board is on.

I've have searched high and low for a pinout diagram that has the chip number along side the board pin number. I'm not a wiz at programming, I do as much reading as I can first but this is quite in-depth.

If I choose to use the skr 1.4 turbo pin file, does that mean I can just use the step/direction/enable pins for the respective axis straight to my external drivers? I also wanted to control relays possibly off the spare pins. This is another reason I wanted a diagram of the pin to pins. I am also goin to have 2 x and 2 y motors and needed some help with those pin assignments too..

If you or anyone can help, or if there is an in-depth tutorial on setting up grbl on an lpc1769 chip I would be eternally grateful.

Thanks again for all you work here.
Cheer
pug1-xda

Autosquaring with Re-Arm and Ramps 1.6

Hello, I am trying to convert my cnc maschine (mpcnc) to grblHal but I am struggeling with ganged axis / auto squaring.
I want to use dual endstops for x and y axis and so my question is how to define that grbl uses the limit_pin_max as a second limit_pin.
Is it enough to just enable #define x_ganged and #define x_auto_square in the my_maschine.h file or do i have to change something else, because on the frontpage it says that the board map file has to be edited.

Thanks in advance!

QEI ON LPC1769

I'm curious if it is possible to get QEI or spindle sync working on LPC1769 board like the SKR turbo. I see that the chip itself does support QEI.

Error compiling for board SKR v1.4 turbo

I just downloaded and trying to compile grblHAL with LPCXpresso
I have my_machine.h
#define BOARD_BTT_SKR_14_TURBO
I have Build Configurations BL_0x4000

I'm getting "make: *** [src/flash.o] Error 1"

When I look at flash.c
I have an error here. It says "initializer element is not constant"
static const uint32_t flash_target = 0x1000UL * 16 + 0x8000UL * (flash_sector - 16);

Question/clarification - PWMs

Sorry if this is a bit of a rudimentary question, but I haven't been able to sort it out just yet.

Background: for lack of anything better to do, I have been working on integrating a BLTouch probe on SKR 1.4 Turbo. I have it sitting around so I thought I would give it a try. It needs a PWM, which are typically defined by servo angles for it to deploy/retract.

I have it defined for PWM1_CH1 and secondary_pin. I have an init statement in driver.c, but it is unclear to me how the period and width parameters are used. It looks like the spindle period pwm defaults to 5000Hz. Is the width value simply the duty cycle for this period (0-100), or is it defined by the pwm resolution value (32bit?)?

Can't seem to get SKR 1.3 + TMC 2209 to work, can anyone help?

Im trying to get this board to work with my 3018 style CNC but I can't get the motor to turn. It will stutter 3 times when i try to move the X axis and then just stop until unplug the power and replug it back in. I had a pretty hard time learning how to compile but manage to get a firmware.bin and uplaoded to the board but Im unsure if I did it correctly.
Here is what I changed
compile

Here is what I get in Universal GCode Sender

I had to change the following to get no alarms
$5=7
$14=3
$17=4

everything else I think is default.

[VER:1.1f.20230919:]
[OPT:VNMSL,35,1024,3,0]
[AXS:3:XYZ]
[NEWOPT:ENUMS,RT+,SED]
[FIRMWARE:grblHAL]
[NVS STORAGE:*FLASH]
[DRIVER:LCP1769]
[DRIVER VERSION:230919]
[BOARD:https://github.com/bigtreetech/BIGTREETECH-SKR-V1.3]
[PLUGIN:Trinamic v0.12]
ok

$$
$0 = 10.0 (Step pulse time, microseconds)
$1 = 25 (Step idle delay, milliseconds)
$2 = 0 (Step pulse invert, mask)
$3 = 0 (Step direction invert, mask)
$4 = 0 (Invert step enable pin, boolean)
$5 = 7 (Invert limit pins, boolean)
$6 = 0 (Invert probe pin, boolean)
$9 = 1
$10 = 511 (Status report options, mask)
$11 = 0.010 (Junction deviation, millimeters)
$12 = 0.002 (Arc tolerance, millimeters)
$13 = 0 (Report in inches, boolean)
$14 = 3
$15 = 0
$16 = 0
$17 = 4
$18 = 0
$19 = 0
$20 = 0 (Soft limits enable, boolean)
$21 = 0 (Hard limits enable, boolean)
$22 = 0 (Homing cycle enable, boolean)
$23 = 0 (Homing direction invert, mask)
$24 = 25.0 (Homing locate feed rate, mm/min)
$25 = 500.0 (Homing search seek rate, mm/min)
$26 = 250 (Homing switch debounce delay, milliseconds)
$27 = 1.000 (Homing switch pull-off distance, millimeters)
$28 = 0.100
$29 = 0.0
$30 = 1000.000 (Maximum spindle speed, RPM)
$31 = 0.000 (Minimum spindle speed, RPM)
$32 = 0 (Laser-mode enable, boolean)
$33 = 5000.0
$34 = 0.0
$35 = 0.0
$36 = 100.0
$37 = 0
$39 = 1
$40 = 0
$43 = 1
$44 = 4
$45 = 3
$46 = 0
$62 = 0
$63 = 3
$64 = 0
$65 = 0
$100 = 250.000 (X-axis travel resolution, step/mm)
$101 = 250.000 (Y-axis travel resolution, step/mm)
$102 = 250.000 (Z-axis travel resolution, step/mm)
$110 = 500.000 (X-axis maximum rate, mm/min)
$111 = 500.000 (Y-axis maximum rate, mm/min)
$112 = 500.000 (Z-axis maximum rate, mm/min)
$120 = 10.000 (X-axis acceleration, mm/sec^2)
$121 = 10.000 (Y-axis acceleration, mm/sec^2)
$122 = 10.000 (Z-axis acceleration, mm/sec^2)
$130 = 200.000 (X-axis maximum travel, millimeters)
$131 = 200.000 (Y-axis maximum travel, millimeters)
$132 = 200.000 (Z-axis maximum travel, millimeters)
$140 = 0
$141 = 0
$142 = 0
$150 = 16
$151 = 16
$152 = 16
$180 = 25.0
$181 = 25.0
$182 = 25.0
$190 = 500.0
$191 = 500.0
$192 = 500.0
$200 = 22.0
$201 = 22.0
$202 = 22.0
$210 = 50
$211 = 50
$212 = 50
$220 = 22.0
$221 = 22.0
$222 = 22.0
$338 = 0
$339 = 0
$341 = 0
$342 = 30.0
$343 = 25.0
$344 = 200.0
$345 = 200.0
$346 = 1
$384 = 0
$398 = 35
$481 = 0
$486 = 0

Device Descriptor Request Failed

Hi,
I'm having an issue with windows and BTT SKR 1.3.

Everything was working fine previously, the machine had been turned off for maybe a week.

Now when I plug the usb cable into the computer I get a popup saying the usb device malfunctioned.
In Device Manager it is labelled as "Unknown USB Device (Device Descriptor Request Failed)".

Is this a software issue?

I've tried 3 different cables, and the board is also currently sitting on the workbench completely disconnected, and now pwered from usb, I've also tried powering from the 24v PSU.

This was on a Windows 10 computer, I've also tried a windows 8 and got something similar.

Thanks,

Compability Request

Hi,

is this fork compatabile with the azteeg x5 gt it have a lpc 1769 mcu

tia

SKR V 1.3 - Set Digital Pin 2.0 Low on reset

Ive successfully set up a laser to run off of the servo pin 2.0 and compiled the firmware to work in that way, instead of the bed. My laser needed 5 volts instead of the 12 volts. However, the digital pins on the LPC1768 are by default, as Ive read in the datasheet, set to high. This results in a voltage of +- 2.36 volts on pin 2.0 on reset. I can turn the lasermode off and on using $32, or inside lightburn, which sets the pin 2.0 voltage to 0.00, to low.

Id like this pin to use the pulldown resistor internally to be set to low on reset. Can you point me in the direction so that i can accomplish this? Upon reset, with the 2.36volts on the 2.0 pin, it causes the laser to turn on. With a low voltage of 0, i could then just turn in on in low power mode with the button as intended. This way the laser wont just turn on when i plug in the board and i wont have to always have lightburn turn on and then turn on the lasermode to set the pin 2.0 voltage to low as is needed.

how to modify PINs ?

Hi again, just a dumb question, how can i modify pin outputs ?

According to PIN map for SKR 1.4T [https://github.com/bigtreetech/BIGTREETECH-SKR-V1.3/blob/master/BTT%20SKR%20V1.4/Hardware/BTT%20SKR%20V1.4PIN.pdf]
I suppose that it should be done in btt_skr_1.4_turbo_map.h ?
I want to use PIN 2.7 for PWM output to CO2 laser PSU.
Because i have one SKR 1.4T board where all other MOSFETs are fried :-)

And it is possible to control outputs thru G code ?

Estop support

Hi,
Is it difficult to add estop support to this driver? And what features does this add?

Thanks!

driver LPC176x i can't compile with mcuxpresso ide

Hello
I can't fill in and it gives me the following messages, am I doing something wrong?

11:19:24 **** Build of configuration Debug for project LPC176x ****
make -r -j4 all
Building file: ../src/trinamic/tmc2209.c
Building file: ../src/trinamic/tmc2130hal.c
Building file: ../src/trinamic/tmc2130.c
Building file: ../src/trinamic/common.c
Invoking: MCU C Compiler
Invoking: MCU C Compiler
Invoking: MCU C Compiler
arm-none-eabi-gcc -DDEBUG -D__CODE_RED -DCORE_M3 -D__LPC17XX__ -D__NEWLIB__ -D__USE_LPCOPEN -DNO_BOARD_LIB -O0 -fno-common -g3 -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -fmerge-constants -fmacro-prefix-map="../src/trinamic/"=. -mcpu=cortex-m3 -mthumb -D__NEWLIB__ -fstack-usage -MMD -MP -MF"src/trinamic/tmc2130hal.d" -MT"src/trinamic/tmc2130hal.o" -MT"src/trinamic/tmc2130hal.d" -o "src/trinamic/tmc2130hal.o" "../src/trinamic/tmc2130hal.c"
arm-none-eabi-gcc -DDEBUG -D__CODE_RED -DCORE_M3 -D__LPC17XX__ -D__NEWLIB__ -D__USE_LPCOPEN -DNO_BOARD_LIB -O0 -fno-common -g3 -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -fmerge-constants -fmacro-prefix-map="../src/trinamic/"=. -mcpu=cortex-m3 -mthumb -D__NEWLIB__ -fstack-usage -MMD -MP -MF"src/trinamic/tmc2130.d" -MT"src/trinamic/tmc2130.o" -MT"src/trinamic/tmc2130.d" -o "src/trinamic/tmc2130.o" "../src/trinamic/tmc2130.c"
Invoking: MCU C Compiler
arm-none-eabi-gcc -DDEBUG -D__CODE_RED -DCORE_M3 -D__LPC17XX__ -D__NEWLIB__ -D__USE_LPCOPEN -DNO_BOARD_LIB -O0 -fno-common -g3 -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -fmerge-constants -fmacro-prefix-map="../src/trinamic/"=. -mcpu=cortex-m3 -mthumb -D__NEWLIB__ -fstack-usage -MMD -MP -MF"src/trinamic/tmc2209.d" -MT"src/trinamic/tmc2209.o" -MT"src/trinamic/tmc2209.d" -o "src/trinamic/tmc2209.o" "../src/trinamic/tmc2209.c"
arm-none-eabi-gcc -DDEBUG -D__CODE_RED -DCORE_M3 -D__LPC17XX__ -D__NEWLIB__ -D__USE_LPCOPEN -DNO_BOARD_LIB -O0 -fno-common -g3 -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -fmerge-constants -fmacro-prefix-map="../src/trinamic/"=. -mcpu=cortex-m3 -mthumb -D__NEWLIB__ -fstack-usage -MMD -MP -MF"src/trinamic/common.d" -MT"src/trinamic/common.o" -MT"src/trinamic/common.d" -o "src/trinamic/common.o" "../src/trinamic/common.c"
Finished building: ../src/trinamic/tmc2130.c

Finished building: ../src/trinamic/tmc2130hal.c

Building file: ../src/trinamic/tmc2209hal.c
Invoking: MCU C Compiler
Building file: ../src/trinamic/tmc26x.c
arm-none-eabi-gcc -DDEBUG -D__CODE_RED -DCORE_M3 -D__LPC17XX__ -D__NEWLIB__ -D__USE_LPCOPEN -DNO_BOARD_LIB -O0 -fno-common -g3 -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -fmerge-constants -fmacro-prefix-map="../src/trinamic/"=. -mcpu=cortex-m3 -mthumb -D__NEWLIB__ -fstack-usage -MMD -MP -MF"src/trinamic/tmc2209hal.d" -MT"src/trinamic/tmc2209hal.o" -MT"src/trinamic/tmc2209hal.d" -o "src/trinamic/tmc2209hal.o" "../src/trinamic/tmc2209hal.c"
Finished building: ../src/trinamic/common.c
Invoking: MCU C Compiler

Finished building: ../src/trinamic/tmc2209.c
arm-none-eabi-gcc -DDEBUG -D__CODE_RED -DCORE_M3 -D__LPC17XX__ -D__NEWLIB__ -D__USE_LPCOPEN -DNO_BOARD_LIB -O0 -fno-common -g3 -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -fmerge-constants -fmacro-prefix-map="../src/trinamic/"=. -mcpu=cortex-m3 -mthumb -D__NEWLIB__ -fstack-usage -MMD -MP -MF"src/trinamic/tmc26x.d" -MT"src/trinamic/tmc26x.o" -MT"src/trinamic/tmc26x.d" -o "src/trinamic/tmc26x.o" "../src/trinamic/tmc26x.c"

Building file: ../src/trinamic/tmc5160.c
Invoking: MCU C Compiler
Building file: ../src/trinamic/tmc5160hal.c
arm-none-eabi-gcc -DDEBUG -D__CODE_RED -DCORE_M3 -D__LPC17XX__ -D__NEWLIB__ -D__USE_LPCOPEN -DNO_BOARD_LIB -O0 -fno-common -g3 -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -fmerge-constants -fmacro-prefix-map="../src/trinamic/"=. -mcpu=cortex-m3 -mthumb -D__NEWLIB__ -fstack-usage -MMD -MP -MF"src/trinamic/tmc5160.d" -MT"src/trinamic/tmc5160.o" -MT"src/trinamic/tmc5160.d" -o "src/trinamic/tmc5160.o" "../src/trinamic/tmc5160.c"
Invoking: MCU C Compiler
arm-none-eabi-gcc -DDEBUG -D__CODE_RED -DCORE_M3 -D__LPC17XX__ -D__NEWLIB__ -D__USE_LPCOPEN -DNO_BOARD_LIB -O0 -fno-common -g3 -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -fmerge-constants -fmacro-prefix-map="../src/trinamic/"=. -mcpu=cortex-m3 -mthumb -D__NEWLIB__ -fstack-usage -MMD -MP -MF"src/trinamic/tmc5160hal.d" -MT"src/trinamic/tmc5160hal.o" -MT"src/trinamic/tmc5160hal.d" -o "src/trinamic/tmc5160hal.o" "../src/trinamic/tmc5160hal.c"
Finished building: ../src/trinamic/tmc2209hal.c
Finished building: ../src/trinamic/tmc26x.c

Building file: ../src/trinamic/tmc_interface.c
Building file: ../src/sdcard/sdcard.c
Invoking: MCU C Compiler
Invoking: MCU C Compiler
arm-none-eabi-gcc -DDEBUG -D__CODE_RED -DCORE_M3 -D__LPC17XX__ -D__NEWLIB__ -D__USE_LPCOPEN -DNO_BOARD_LIB -O0 -fno-common -g3 -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -fmerge-constants -fmacro-prefix-map="../src/sdcard/"=. -mcpu=cortex-m3 -mthumb -D__NEWLIB__ -fstack-usage -MMD -MP -MF"src/sdcard/sdcard.d" -MT"src/sdcard/sdcard.o" -MT"src/sdcard/sdcard.d" -o "src/sdcard/sdcard.o" "../src/sdcard/sdcard.c"
arm-none-eabi-gcc -DDEBUG -D__CODE_RED -DCORE_M3 -D__LPC17XX__ -D__NEWLIB__ -D__USE_LPCOPEN -DNO_BOARD_LIB -O0 -fno-common -g3 -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -fmerge-constants -fmacro-prefix-map="../src/trinamic/"=. -mcpu=cortex-m3 -mthumb -D__NEWLIB__ -fstack-usage -MMD -MP -MF"src/trinamic/tmc_interface.d" -MT"src/trinamic/tmc_interface.o" -MT"src/trinamic/tmc_interface.d" -o "src/trinamic/tmc_interface.o" "../src/trinamic/tmc_interface.c"
Finished building: ../src/trinamic/tmc5160.c

Finished building: ../src/trinamic/tmc5160hal.c
Building file: ../src/sdcard/ymodem.c
In file included from ../src/sdcard/sdcard.c:22:
../src/sdcard/sdcard.h:30:10: fatal error: driver.h: No such file or directory
30 | #include "driver.h"
| ^~~~~~~~~~
compilation terminated.

Invoking: MCU C Compiler
Building file: ../src/motors/trinamic.c
arm-none-eabi-gcc -DDEBUG -D__CODE_RED -DCORE_M3 -D__LPC17XX__ -D__NEWLIB__ -D__USE_LPCOPEN -DNO_BOARD_LIB -O0 -fno-common -g3 -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -fmerge-constants -fmacro-prefix-map="../src/sdcard/"=. -mcpu=cortex-m3 -mthumb -D__NEWLIB__ -fstack-usage -MMD -MP -MF"src/sdcard/ymodem.d" -MT"src/sdcard/ymodem.o" -MT"src/sdcard/ymodem.d" -o "src/sdcard/ymodem.o" "../src/sdcard/ymodem.c"
Invoking: MCU C Compiler
make: *** [src/sdcard/subdir.mk:23: src/sdcard/sdcard.o] Error 1
arm-none-eabi-gcc -DDEBUG -D__CODE_RED -DCORE_M3 -D__LPC17XX__ -D__NEWLIB__ -D__USE_LPCOPEN -DNO_BOARD_LIB -O0 -fno-common -g3 -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -fmerge-constants -fmacro-prefix-map="../src/motors/"=. -mcpu=cortex-m3 -mthumb -D__NEWLIB__ -fstack-usage -MMD -MP -MF"src/motors/trinamic.d" -MT"src/motors/trinamic.o" -MT"src/motors/trinamic.d" -o "src/motors/trinamic.o" "../src/motors/trinamic.c"
make: *** Waiting for unfinished jobs....
In file included from ../src/sdcard/ymodem.c:28:
../src/sdcard/sdcard.h:30:10: fatal error: driver.h: No such file or directory
30 | #include "driver.h"
| ^~~~~~~~~~
compilation terminated.
../src/motors/trinamic.c:25:10: fatal error: driver.h: No such file or directory
25 | #include "driver.h"
| ^~~~~~~~~~
compilation terminated.
make: *** [src/sdcard/subdir.mk:23: src/sdcard/ymodem.o] Error 1
Finished building: ../src/trinamic/tmc_interface.c
make: *** [src/motors/subdir.mk:20: src/motors/trinamic.o] Error 1

"make -r -j4 all" terminated with exit code 2. Build might be incomplete.

11:19:28 Build Failed. 7 errors, 0 warnings. (took 3s.391ms)

Help needed with compiling please

Hi there,
I was wondering if someone could help me,
I have a k40 which Iโ€™ve installed a skr v1.4 turbo board into and have it running with smoothieware but I am looking to install grblhal because it looks like a better firmware .
The problem I am having is that I am falling at the first hurdle and canโ€™t for the life of me figure out how to compile it via platformio.
I have opened a new project with the relevant mcu selected which is LPC1769 and I have downloaded the grblhal core and the driver lpc176x files and then from there I donโ€™t really know where I should be going.
So if there is any could write ups that are easy to follow or YouTube videos that could help please point me to them,or maybe someone has the firmware already compiled and donโ€™t mind me trying it that would be great .
I have setup marlin before on 3d printers and smoothie as I said .
Thank you Dazz

No serial access

I'm not a developer and only used the Arduino IDE until now to compile and upload GRBL.
Compiled GRBLHAL with MCUXpresso IDE v11.3.1 [Build 5262] [2021-04-02] under Ubuntu 20.04. After changing the MCU to LPC1769 and the path in main.c to grbl/grbllib.h it compiled without error but a few warnings. Flashing the BTT SKR 1.4 TURBO worked but I'm not getting USB-Serial Connection to the board.
When flashing the binary provided in Issue #1, I'm getting USB-Serial connection.
What am I doing wrong?

Probing not reporting

SKR 1.4 Turbo. Probing operations work, but the "PRB" acknowledgement with position is not returned. I have verified that DEFAULT_NO_REPORT_PROBE_COORDINATES is commented out. The PRB line can be retrieved with $#.

SKR 1.4 turbo endstop pullup not working

Hello, I am unable to make the end stop working at SKR 1.4 turbo. The end stop looks like there is no pull-up on the pin the default voltage on the input pin is 0V. I tried changing the settings to $18 but still no voltage. If I invert the pin status and connect 3.3V to limit input it is detected as pressed endstop. Thanks a lot.

my_machine.h

// NOTE: Only one board may be enabled!
// If none is enabled pin mappings from generic_map.h will be used
//#define SMOOTHIEBOARD
//#define BOARD_RAMPS_16
//#define BOARD_BTT_SKR_13
#define BOARD_BTT_SKR_14_TURBO
//#define BOARD_BTT_SKR_E3_TURBO  // With onboard Trinamic TNMC2209 drivers. NOTE: not verified!
//#define BOARD_MKS_SBASE_13
//#define BOARD_MY_MACHINE // Add my_machine_map.h before enabling this!

// Configuration
// Uncomment to enable, for some a value > 1 may be assigned, if so the default value is shown.

#ifndef USB_SERIAL_CDC
//#define USB_SERIAL_CDC     1 // Comment out to use UART communication.
#endif
//#define SAFETY_DOOR_ENABLE 1 // Enable safety door input.
//#define SDCARD_ENABLE      1 // Run gcode programs from SD card, requires sdcard plugin.
//#define MPG_ENABLE         1 // Enable MPG interface. Requires serial port and one handshake pin.
//#define TRINAMIC_ENABLE 2130 // Uncomment to enable Trinamic TMC2130 driver support. NOTE: Experimental for now, currently for SKR 1.x boards only
#define TRINAMIC_ENABLE 2209 // Uncomment to enable Trinamic TMC5160 driver support. NOTE: Experimental for now, currently for SKR 1.x boards only
//#define TRINAMIC_ENABLE 5160 // Uncomment to enable Trinamic TMC5160 driver support. NOTE: Experimental for now, currently for SKR E3 Turbo board only
//#define LIMIT_MAX_ENABLE   1 // Uncomment to enable max limit input pins (when available)
//#define EEPROM_ENABLE      1 // I2C EEPROM support. Set to 1 for 24LC16(2K), 2 (64 byte pages) or 3 (32 byte pages) for larger sizes. Requires eeprom plugin.
//#define EEPROM_IS_FRAM     1 // Uncomment when EEPROM is enabled and chip is FRAM, this to remove write delay.

// If the selected board map supports more than three motors ganging and/or auto-squaring
// of axes can be enabled here.
//#define X_GANGED            1
//#define X_AUTO_SQUARE       1
#define Y_GANGED            1
#define Y_AUTO_SQUARE       1
//#define Z_GANGED            1
//#define Z_AUTO_SQUARE       1
// For ganged axes the limit switch input (if available) can be configured to act as a max travel limit switch.
// NOTE: If board map already has max limit inputs defined this configuration will be ignored.
//#define X_GANGED_LIM_MAX    1
//#define Y_GANGED_LIM_MAX    1
//#define Z_GANGED_LIM_MAX    1

skr 1.3 and 1.4 turbo problem axis Y Z

Hi
With the latest firmware I can't get Y and Z axis to move on skr 1.3 and 1.4 turbo while X axis works smoothly, I haven't changed anything in config.h, where am I wrong?

compilation issues, possible makefile export branch?

hi, very excited to find this project, especially as it looks like i will technically be able to build it for my skr 1.3, however i have not been able to get it to work, the arduino library method just says no libary found, and trying to load it into a fresh version of eclipse cdt embedded wasn't able to import the project properly at all. would it be possible to do an export of a makefile setup, which should be trivial from eclipse from what i have read.

PlatformIO/Makefile compilation

I've been trying to compile this project without installing a huge IDE that I need once-twice a year and Arduino reports "no libraries found".

Can you please give the full compiler flags, declarations and linker options that you have so I can write some kind of a nicer build method? Maybe even a GitHub Action template that people can fork and maintain their builds nicely.

I came up with this platformio.ini:

[platformio]
src_dir = src
lib_dir = src

[env:LPC176x]
platform          = https://github.com/p3p/pio-nxplpc-arduino-lpc176x/archive/0.1.3.zip
platform_packages = framework-arduino-lpc176x@^0.2.8
framework         = arduino
board             = nxp_lpc1769
; lib_ldf_mode      = chain+
lib_ldf_mode      = off
lib_compat_mode   = strict
lib_archive = yes

src_filter = +<./*/*>
;            =-<./src/eeprom>
build_flags =
    ; Include paths
    ; -Isrc/eeprom
    -Isrc
    -Isrc/FatFs
    -Isrc/grbl
    ; -Isrc/grbl-lpc
    ; -Isrc/lpc_chip_175x_6x
	-Isrc/lpc_chip_175x_6x/inc
	-Isrc/lpc_chip_175x_6x/inc/usbd
    ; -Isrc/lpc17xx

    ; Compiler options
    -D__CODE_RED
    -DCORE_M3
    -D __USE_CMSIS=CMSIS_CORE_LPC17xx
    -D__LPC17XX__
    -D__NEWLIB__
    -D__USE_LPCOPEN
    -DDEBUG

	; -fpermissive
    -c
    -fmessage-length=0
    ; -fno-builtin
    -ffunction-sections
    -fdata-sections
    -fno-common
    ; -nostdinc
    -lusbd_175x_6x_lib
    -Lsrc/lpc_chip_175x_6x/libs

    ; Machine Options
    -DNO_BOARD_LIB

The lines starting with ; are comments (due to rigorous testing)

The error I get is the following:

In file included from /home/dzervas/.platformio/packages/framework-arduino-lpc176x/system/CMSIS/include/debug_frmwrk.h:35,
                 from /home/dzervas/.platformio/packages/framework-arduino-lpc176x/system/CMSIS/lib/usb/cdcuser.h:22,
                 from /home/dzervas/.platformio/packages/framework-arduino-lpc176x/system/CMSIS/lib/usb/usbcore.cpp:39:
/home/dzervas/.platformio/packages/framework-arduino-lpc176x/system/CMSIS/include/lpc17xx_uart.h:598:20: error: 'TRANSFER_BLOCK_Type' has not been declared
  598 |   uint32_t buflen, TRANSFER_BLOCK_Type flag);
      |                    ^~~~~~~~~~~~~~~~~~~
/home/dzervas/.platformio/packages/framework-arduino-lpc176x/system/CMSIS/include/lpc17xx_uart.h:600:20: error: 'TRANSFER_BLOCK_Type' has not been declared
  600 |   uint32_t buflen, TRANSFER_BLOCK_Type flag);
      |                    ^~~~~~~~~~~~~~~~~~~
Compiling .pio/build/LPC176x/CMSIS/lib/usb/usbuser.cpp.o
*** [.pio/build/LPC176x/CMSIS/lib/usb/usbcore.cpp.o] Error 1
Compiling .pio/build/LPC176x/CMSIS/system/startup_LPC17xx.S.o
In file included from /home/dzervas/.platformio/packages/framework-arduino-lpc176x/system/CMSIS/include/debug_frmwrk.h:35,
                 from /home/dzervas/.platformio/packages/framework-arduino-lpc176x/system/CMSIS/lib/usb/usbuser.cpp:21:
/home/dzervas/.platformio/packages/framework-arduino-lpc176x/system/CMSIS/include/lpc17xx_uart.h:598:20: error: 'TRANSFER_BLOCK_Type' has not been declared
  598 |   uint32_t buflen, TRANSFER_BLOCK_Type flag);
      |                    ^~~~~~~~~~~~~~~~~~~
/home/dzervas/.platformio/packages/framework-arduino-lpc176x/system/CMSIS/include/lpc17xx_uart.h:600:20: error: 'TRANSFER_BLOCK_Type' has not been declared
  600 |   uint32_t buflen, TRANSFER_BLOCK_Type flag);
      |                    ^~~~~~~~~~~~~~~~~~~
*** [.pio/build/LPC176x/CMSIS/lib/usb/usbuser.cpp.o] Error 1

What toolchain and framework are you using? Any specific versions?

Digital I/O ?

Hello, do you plan to add support for some Digital I/O ? On the EXP1 and EXP2 (SKR 1.3 Turbo) should be some pins whats are unused.

LPC176x Build Fails with TMC2130's (listed as experimental)

I'm getting the seventeen build errors listed below. Trying to build for a BTT SKR 1.4 Turbo with four TMC2130's. If I comment out the #define TRINAMIC_ENABLE 2130 in my_machine.h it builds just fine. This is from a current (Aug 5, 21) git recurse-submodules pull.

Description Resource Path Location Type c:/nxp/mcuxpressoide_11.4.0_6224/ide/plugins/com.nxp.mcuxpresso.tools.win32_11.4.0.202103011116/tools/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/lib/thumb/v7-m/nofp\libc.a(lib_a-closer.o): in function_close_r': GRBL Driver LPC176x C/C++ Problem
c:/nxp/mcuxpressoide_11.4.0_6224/ide/plugins/com.nxp.mcuxpresso.tools.win32_11.4.0.202103011116/tools/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/lib/thumb/v7-m/nofp\libc.a(lib_a-fstatr.o): in function _fstat_r': GRBL Driver LPC176x C/C++ Problem c:/nxp/mcuxpressoide_11.4.0_6224/ide/plugins/com.nxp.mcuxpresso.tools.win32_11.4.0.202103011116/tools/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/lib/thumb/v7-m/nofp\libc.a(lib_a-isattyr.o): in function _isatty_r': GRBL Driver LPC176x C/C++ Problem
c:/nxp/mcuxpressoide_11.4.0_6224/ide/plugins/com.nxp.mcuxpresso.tools.win32_11.4.0.202103011116/tools/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/lib/thumb/v7-m/nofp\libc.a(lib_a-lseekr.o): in function _lseek_r': GRBL Driver LPC176x C/C++ Problem c:/nxp/mcuxpressoide_11.4.0_6224/ide/plugins/com.nxp.mcuxpresso.tools.win32_11.4.0.202103011116/tools/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/lib/thumb/v7-m/nofp\libc.a(lib_a-readr.o): in function _read_r': GRBL Driver LPC176x C/C++ Problem
c:/nxp/mcuxpressoide_11.4.0_6224/ide/plugins/com.nxp.mcuxpresso.tools.win32_11.4.0.202103011116/tools/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/lib/thumb/v7-m/nofp\libc.a(lib_a-signalr.o): in function _getpid_r': GRBL Driver LPC176x C/C++ Problem c:/nxp/mcuxpressoide_11.4.0_6224/ide/plugins/com.nxp.mcuxpresso.tools.win32_11.4.0.202103011116/tools/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/lib/thumb/v7-m/nofp\libc.a(lib_a-signalr.o): in function _kill_r': GRBL Driver LPC176x C/C++ Problem
c:/nxp/mcuxpressoide_11.4.0_6224/ide/plugins/com.nxp.mcuxpresso.tools.win32_11.4.0.202103011116/tools/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/lib/thumb/v7-m/nofp\libc.a(lib_a-writer.o): in function _write_r': GRBL Driver LPC176x C/C++ Problem make: *** [makefile:40: Firmware.axf] Error 1 GRBL Driver LPC176x C/C++ Problem undefined reference to _close' GRBL Driver LPC176x line 0 C/C++ Problem
undefined reference to _fstat' GRBL Driver LPC176x line 0 C/C++ Problem undefined reference to _getpid' GRBL Driver LPC176x line 0 C/C++ Problem
undefined reference to _isatty' GRBL Driver LPC176x line 0 C/C++ Problem undefined reference to _kill' GRBL Driver LPC176x line 0 C/C++ Problem
undefined reference to _lseek' GRBL Driver LPC176x line 0 C/C++ Problem undefined reference to _read' GRBL Driver LPC176x line 0 C/C++ Problem
undefined reference to _write' GRBL Driver LPC176x line 0 C/C++ Problem

image
image

TMC2209 on SKR E3 Turbo report incompatible driver

I'm trying to get E3 Turbo to work, which has soldered TMC2209s but after writing a map and setting TRINAMIC_ENABLE 2209 I get via serial:

error:7
grblHAL: incompatible driver

The weird thing is that for a moment it worked but somehow didn't compile the trinamic code (no $338 setting available).

src/my_machine.h

/*
  my_machine.h - configuration for NXP LPC176x ARM processors

  Part of grblHAL

  Copyright (c) 2020-2021 Terje Io

  Grbl is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  Grbl is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with Grbl.  If not, see <http://www.gnu.org/licenses/>.
*/

// NOTE: Only one board may be enabled!
// If none is enabled pin mappings from generic_map.h will be used
//#define SMOOTHIEBOARD
//#define BOARD_RAMPS_16
//#define BOARD_BTT_SKR_13
//#define BOARD_BTT_SKR_14_TURBO
#define BOARD_BTT_SKR_E3_TURBO
//#define BOARD_MKS_SBASE_13
//#define BOARD_MY_MACHINE // Add my_machine_map.h before enabling this!

// Configuration
// Uncomment to enable, for some a value > 1 may be assigned, if so the default value is shown.

#define USB_SERIAL_CDC     1 // Comment out to use UART communication.
#define SDCARD_ENABLE      1 // Run gcode programs from SD card, requires sdcard plugin.
//#define TRINAMIC_ENABLE 2209 // Uncomment to enable Trinamic TMC2130 driver support. NOTE: Experimental for now, currently for SKR 1.x boards only
//#define TRINAMIC_ENABLE 2130 // Uncomment to enable Trinamic TMC2130 driver support. NOTE: Experimental for now, currently for SKR 1.x boards only
//#define TRINAMIC_ENABLE 5160 // Uncomment to enable Trinamic TMC5160 driver support. NOTE: Experimental for now, currently for SKR 1.x boards only
//#define LIMIT_MAX_ENABLE   1 // Uncomment to enable max limit input pins (when available)
#define EEPROM_ENABLE      1 // I2C EEPROM support. Set to 1 for 24LC16(2K), 2 (64 byte pages) or 3 (32 byte pages) for larger sizes. Requires eeprom plugin.
//#define EEPROM_IS_FRAM     1 // Uncomment when EEPROM is enabled and chip is FRAM, this to remove write delay.

// If the selected board map supports more than three motors ganging and/or auto-squaring
// of axes can be enabled here.
#define X_GANGED            1
#define X_AUTO_SQUARE       1
#define Y_GANGED            1
#define Y_AUTO_SQUARE       1
//#define Z_GANGED            1
//#define Z_AUTO_SQUARE       1
// For ganged axes the limit switch input (if available) can be configured to act as a max travel limit switch.
// NOTE: If board map already has max limit inputs defined this configuration will be ignored.
//#define X_GANGED_LIM_MAX    1
//#define Y_GANGED_LIM_MAX    1
//#define Z_GANGED_LIM_MAX    1

/*EOF*/
/*
  btt_skr_1.4_turbo_map.h - driver code for LPC176x processor, pin mappings compatible with BTT SKR v1.4 Turbo board

  Part of grblHAL

  Copyright (c) 2020-2021 Terje Io

  Grbl is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  Grbl is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with Grbl.  If not, see <http://www.gnu.org/licenses/>.
*/

// NOTE:
// P0.27, P0.28 are dedicated I2C pins without pull up/down.
// P0.29, P0.30 must have same direction as used for USB operation.

#if N_ABC_MOTORS > 2
#error "Axis configuration is not supported!"
#endif

#define BOARD_NAME "BTT SKR E3 Turbo"

#if TRINAMIC_ENABLE == 2130 || TRINAMIC_ENABLE == 5160 //|| TRINAMIC_ENABLE == 2209
#define HAS_BOARD_INIT
void board_init (void);
#endif

//#if EEPROM_ENABLE
//#error "This board cannot be used with current EEPROM code!"
//#endif

// Define step pulse output pins.
#define X_STEP_PN               1
#define X_STEP_PORT             port(X_STEP_PN)
#define X_STEP_PIN              4
#define Y_STEP_PN               1
#define Y_STEP_PORT             port(Y_STEP_PN)
#define Y_STEP_PIN              14
#define Z_STEP_PN               4
#define Z_STEP_PORT             port(Z_STEP_PN)
#define Z_STEP_PIN              29
#define STEP_OUTMODE            GPIO_BITBAND

// Define step direction output pins.
#define X_DIRECTION_PN          1
#define X_DIRECTION_PORT        port(X_DIRECTION_PN)
#define X_DIRECTION_PIN         8
#define Y_DIRECTION_PN          1
#define Y_DIRECTION_PORT        port(Y_DIRECTION_PN)
#define Y_DIRECTION_PIN         15
#define Z_DIRECTION_PN          4
#define Z_DIRECTION_PORT        port(Z_DIRECTION_PN)
#define Z_DIRECTION_PIN         28
#define DIRECTION_OUTMODE       GPIO_BITBAND

// Define stepper driver enable/disable output pin(s).
#define X_ENABLE_PN             1
#define X_ENABLE_PORT           port(X_ENABLE_PN)
#define X_ENABLE_PIN            0
#define Y_ENABLE_PN             1
#define Y_ENABLE_PORT           port(Y_ENABLE_PN)
#define Y_ENABLE_PIN            9
#define Z_ENABLE_PN             1
#define Z_ENABLE_PORT           port(Z_ENABLE_PN)
#define Z_ENABLE_PIN            16

// Define homing/hard limit switch input pins.
// NOTE: All limit bits (needs to be on same port)
#define LIMIT_PN                1
#define LIMIT_PORT              port(LIMIT_PN)
#define X_LIMIT_PIN             29
#define Y_LIMIT_PIN             28
#define Z_LIMIT_PIN             27
#define LIMITS_POLL_PORT        port(1) // NOTE: Port 1 is not interrupt capable, use polling instead!
#define LIMIT_INMODE            GPIO_BITBAND

// Define ganged axis or A axis step pulse and step direction output pins.
#if N_ABC_MOTORS > 0
#define M3_AVAILABLE
#define M3_STEP_PN              2
#define M3_STEP_PORT            port(M3_STEP_PN)
#define M3_STEP_PIN             6
#define M3_DIRECTION_PN         2
#define M3_DIRECTION_PORT       port(M3_DIRECTION_PN)
#define M3_DIRECTION_PIN        7
#define M3_LIMIT_PORT           port(LIMIT_PN)
#define M3_LIMIT_PIN            26
#define M3_ENABLE_PN            0
#define M3_ENABLE_PORT          port(M3_ENABLE_PN)
#define M3_ENABLE_PIN           4
#endif

// Define ganged axis or B axis step pulse and step direction output pins.
#if N_ABC_MOTORS == 2
#define M4_AVAILABLE
#define M4_STEP_PN              2
#define M4_STEP_PORT            port(M4_STEP_PN)
#define M4_STEP_PIN             1
#define M4_DIRECTION_PN         0
#define M4_DIRECTION_PORT       port(M4_DIRECTION_PN)
#define M4_DIRECTION_PIN        21
#define M4_LIMIT_PORT           port(LIMIT_PN)
#define M4_LIMIT_PIN            25
#define M4_ENABLE_PN            0
#define M4_ENABLE_PORT          port(M4_ENABLE_PN)
#define M4_ENABLE_PIN           21
#endif

// Define probe switch input pin.
#define PROBE_PN                1
#define PROBE_PORT              port(PROBE_PN)
#define PROBE_PIN               22

// Define spindle enable and spindle direction output pins.
#define SPINDLE_ENABLE_PN       1
#define SPINDLE_ENABLE_PORT     port(SPINDLE_ENABLE_PN)
#define SPINDLE_ENABLE_PIN      20
#define SPINDLE_DIRECTION_PN    1
#define SPINDLE_DIRECTION_PORT  port(SPINDLE_DIRECTION_PN)
#define SPINDLE_DIRECTION_PIN   21

// Start of PWM & Stepper Enabled Spindle

// Define flood and mist coolant enable output pins.
#define COOLANT_FLOOD_PN        1
#define COOLANT_FLOOD_PORT      port(COOLANT_FLOOD_PN)
#define COOLANT_FLOOD_PIN       19

#define COOLANT_MIST_PN         1
#define COOLANT_MIST_PORT       port(COOLANT_MIST_PN)
#define COOLANT_MIST_PIN        30

// Define user-control CONTROLs (reset, feed hold, cycle start) input pins.
#define RESET_PORT_PN           0
#define RESET_PORT              port(RESET_PORT_PN)
#define RESET_PIN               18

#define FEED_HOLD_PN            0
#define FEED_HOLD_PORT          port(FEED_HOLD_PN)
#define FEED_HOLD_PIN           16

#define CYCLE_START_PN          0
#define CYCLE_START_PORT        port(CYCLE_START_PN)
#define CYCLE_START_PIN         15

#define CONTROL_INMODE          GPIO_BITBAND

#ifdef SPINDLE_PWM_PIN_2_4
#define SPINDLE_PWM_CHANNEL     PWM1_CH5    // MOSFET3 (P2.4)
#else
#define SPINDLE_PWM_CHANNEL     PWM1_CH6    // BED MOSFET (P2.5)
#endif
#define SPINDLE_PWM_USE_PRIMARY_PIN   false
#define SPINDLE_PWM_USE_SECONDARY_PIN true

#if SDCARD_ENABLE
#define SD_SPI_PORT             0
#define SD_CS_PN                0
#define SD_CS_PORT              port(SD_CS_PN)
#define SD_CS_PIN               6
#endif

#if TRINAMIC_ENABLE == 2130 || TRINAMIC_ENABLE == 5160

#define TRINAMIC_MOSI_PN        1
#define TRINAMIC_MOSI_PORT      port(TRINAMIC_MOSI_PN)
#define TRINAMIC_MOSI_PIN       17
#define TRINAMIC_MISO_PN        0
#define TRINAMIC_MISO_PORT      port(TRINAMIC_MISO_PN)
#define TRINAMIC_MISO_PIN       5
#define TRINAMIC_SCK_PN         0
#define TRINAMIC_SCK_PORT       port(TRINAMIC_SCK_PN)
#define TRINAMIC_SCK_PIN        4
#endif

#if TRINAMIC_ENABLE == 2130 || TRINAMIC_ENABLE == 5160 || TRINAMIC_ENABLE == 2209
#define MOTOR_CS_PN             1
#define MOTOR_CS_PORT           port(MOTOR_CS_PN)
#define MOTOR_CSX_PIN           1
#define MOTOR_CSY_PIN           10
#define MOTOR_CSZ_PIN           17
#ifdef M3_AVAILABLE
#define MOTOR_CSM3_PIN          5
#endif
#ifdef M4_AVAILABLE
#define MOTOR_CSM4_PIN          22
#endif

#endif


/**/

src/driver.h change to include my config

diff --git a/src/driver.h b/src/driver.h
index 20551f5..084cdce 100644
--- a/src/driver.h
+++ b/src/driver.h
@@ -81,6 +81,8 @@
   #include "btt_skr_1.3_map.h"
 #elif defined(BOARD_BTT_SKR_14_TURBO)
   #include "btt_skr_1.4_turbo_map.h"
+#elif defined(BOARD_BTT_SKR_E3_TURBO)
+  #include "btt_skr_e3_turbo_map.h"
 #elif defined(BOARD_MKS_SBASE_13)
   #include "mks_sbase_map.h"
 #elif defined(BOARD_MY_MACHINE)

Ideas? Maybe the EEPROM is corrupted? Can I reset it via an SD card file for example?

Contextual notes: I have both X & Y ganged (MPCNC)

Compile Error

hi,
I am currently trying to compile a new version and am getting some errors.
Can you fix them?

Thanks

My Config:

#define BOARD_BTT_SKR_13
#define TRINAMIC_ENABLE       2209

Compile Error:

../src/tmc_uart.c:324:36: error: 'xbar_t' {aka 'struct xbar'} has no member named 'bit'
  324 |             uart[X_AXIS].bit = gpio->bit;
      |                                    ^~
../src/tmc_uart.c:329:36: error: 'xbar_t' {aka 'struct xbar'} has no member named 'bit'
  329 |             uart[Y_AXIS].bit = gpio->bit;
      |                                    ^~
../src/tmc_uart.c:334:36: error: 'xbar_t' {aka 'struct xbar'} has no member named 'bit'
  334 |             uart[Z_AXIS].bit = gpio->bit;
      |                                    ^~
../src/tmc_uart.c:339:31: error: 'xbar_t' {aka 'struct xbar'} has no member named 'bit'
  339 |             uart[3].bit = gpio->bit;
      |                               ^~
../src/tmc_uart.c:344:31: error: 'xbar_t' {aka 'struct xbar'} has no member named 'bit'
  344 |             uart[4].bit = gpio->bit;
      |                               ^~

S32 alternatives ?

Hi,
I'm a MAC user and there is no S32 Studio available for my OS. Is there any possibility to compile this outside S32 ? I need to compile the sources for my MKS Base 1.3 and cant find any possibility on a Mac. Installing Windows in a VM is no Option, since i would need to buy Windows first and being a student, thats no option.
What can i do ? If there is no possibility, could someone please compile it and upload the image file ? Hope you can help me.

TMC5160 on SKR 1.4?

Out of curiosity, what is the limitation to enabling TMC5160 drivers on the SKR1.4(turbo) boards?

where is the upload.ino

For the ones like me that wants to use Arduino ide, where is the upload.ino file? i all repos that i downloaded there is no "example" folder containing this file....

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.