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

"The specified File could not be found" error during running Make cmd. #1

Open
Coolxer opened this issue Aug 12, 2021 · 6 comments
Open

Comments

@Coolxer
Copy link

Coolxer commented Aug 12, 2021

Hello,
Firsty, I have downloaded repository https://github.com/grblHAL/STM32F4xx with submodules, then I cloned this repository into the grbl directory of STM32F4xx.
Just like the manual says I modified Makefile (change platform to Windows and also changed paths to files: GRBL_BASE_OBJECTS are in the parent directory, other files are in the current).

Unfortunately I still receiving error, that specified file cannot be found. The error suggests there is problem with grbl_interface file, so i also updated paths here, but it didnt solve problem.

make

Poniżej fragment Makefile
`
PLATFORM = WINDOWS

GRBL_BASE_OBJECTS = ../grbllib.o ../protocol.o ../planner.o ../settings.o ../nuts_bolts.o ../stepper.o ../gcode.o ../stream.o ../spindle_control.o ../motion_control.o ../limits.o ../coolant_control.o ../system.o ../report.o ../state_machine.o ../override.o ../nvs_buffer.o ../sleep.o ../tool_change.o ../my_plugin.o

SIM_OBJECTS = main.o simulator.o driver.o eeprom.o grbl_eeprom_extensions.o mcu.o serial.o platform_$(PLATFORM).o

GRBL_SIM_OBJECTS = grbl_interface.o $(GRBL_BASE_OBJECTS) $(SIM_OBJECTS)
GRBL_VAL_OBJECTS = validator.o validator_driver.o $(GRBL_BASE_OBJECTS)

CLOCK = 16000000
SIM_EXE_NAME = grbl_sim.exe
VALIDATOR_NAME = gvalidate.exe
FLAGS = -g -O3
COMPILE = $(CC) -Wall $(FLAGS) -DF_CPU=$(CLOCK) -I. -DPLAT_$(PLATFORM)
LINUX_LIBRARIES = -lrt -pthread
OSX_LIBRARIES =
WINDOWS_LIBRARIES =

all: main gvalidate

new: clean main gvalidate

clean:
rm -f $(SIM_EXE_NAME) $(GRBL_SIM_OBJECTS) $(VALIDATOR_NAME) $(GRBL_VAL_OBJECTS)

main: $(GRBL_SIM_OBJECTS)
$(COMPILE) -o $(SIM_EXE_NAME) $(GRBL_SIM_OBJECTS) -lm $($(PLATFORM)_LIBRARIES)

gvalidate: $(GRBL_VAL_OBJECTS)
$(COMPILE) -o $(VALIDATOR_NAME) $(GRBL_VAL_OBJECTS) -lm $($(PLATFORM)_LIBRARIES)

%.o: %.c
$(COMPILE) -c $< -o $@

grbl/planner.o: grbl/planner.c
$(COMPILE) -include planner_inject_accessors.c -c $< -o $@
`

@terjeio
Copy link
Contributor

terjeio commented Aug 12, 2021

You cannot add microprocessor drivers to the simulator (or vice versa)...

If you want to run STM32F4xx grblHAL in a Windows or Linux machine you have to get hold of an emulator (I do not know if one even exists) and run the native binary in that.

@Coolxer
Copy link
Author

Coolxer commented Aug 12, 2021

Thanks for the answer.

This repository contains an experimental Grbl simulator that compiles the main Grbl source code into a wrapped executable for use on a computer. No microcontroller required. When the executable is run, the user should be able to interact with the Grbl simulator as if connected to a microcontroller board with Grbl

I wanted to use grbl simulator without microcontroller like READ.ME says, but it require microprocessor drivers, which are not available? How can i run and use it? I am new in cnc world and before using real microcontroller (i have already stm32f446re) just wanted to try out virtual version to learn some gcodes.

@terjeio
Copy link
Contributor

terjeio commented Aug 12, 2021

The simulator contains a virtual microcontroller and a corresponding grblHAL driver (in fact it contains two drivers) so the project is complete and can be compiled "as-is". Note that I have not tested compilation on a Windows machine.

@Coolxer
Copy link
Author

Coolxer commented Aug 12, 2021

Ok, so I understand I should clone this repository to fetch the grblhal/core repo too.
git clone --recurse-submodules https://github.com/grblHAL/Simulator.

This time i do not need to modify paths, just platform. It still not working, but as you say it must be problem with general Windows platform or just myself. I will try to go around. Thanks.

@terjeio
Copy link
Contributor

terjeio commented Aug 12, 2021

I just checked compilation and execution on my Linux box, and I can confirm it works.

On Windows you have to set up a compiler and what not. Some useful information can be be found on the site of the original? E.g. this issue may be helpful.

@calabr
Copy link

calabr commented Apr 15, 2022

Build Simulator for Windows:

  1. Install compiller
    Istall cygwin environment
    visit https://www.cygwin.com/install.html
    download and run https://www.cygwin.com/setup-x86_64.exe
    In the install wizard select
    • Install from Internet
    • set cygwin home directory C:\cygwin64 - is default
    • set local package directory - system temp is default
    • select internet access method - Use system settings is default
    • select distribution mirror you like
      Wizard will download package database and select default packages to install
      in View combo select "Full", add to installation next packages:
      gcc-core
      gcc-g++
      gcc-objc
      gcc-objc++
      make

Click Next to finish installation
2) Download Simulator source code
I prefer to visit https://github.com/grblHAL/Simulator and download zip archive
extract it to your working directory
extracted folder will contains empty grbl/ subforder. We need to download grblHAL core package and extract it there.
you can fillow the link in Simulator github page, or visit https://github.com/grblHAL/core.
Just extract all core sources into simulator's grbl/ folder.
! as for now 16.04.2022 - some changes in grbl core become incompatible with semulator !
But you can fetch older core part from repository, or use sources from archived repository
https://github.com/terjeio/grblHAL/tree/master/drivers/Simulator, which also include core sources
in https://github.com/terjeio/grblHAL/tree/master/drivers/Simulator/grbl

  1. compile project
    start cygwin terminal and go to your simulator sources directory
    cd /cygdrive/d/CNC/GRBL-CNC/Simulator - example of my pat. take into accoumt "/cygdrive/d" it's cygwin mapping for Windows disk D:/ path.
    run "make" command
    Project duild will start. It should finish without errors. Some warnings can occure.
    Please take into account, I didn't change PLATFORM option to Windows in Makefile. It's allow to compile Linux - stile sources and utilize cygwin cross-platform libraries. Try to build with Windows platform failed, because cygwin don't provide some Windows-specific libraries, like <conio.h>.

  2. run simulator
    After successfull build, you can find grbl_sim.exe and gvalidate.exe in Simulator directory. It's valid Windows binary and you can run it directly from cygwin terminal.
    If you want to run it from windows exlporer, most probable it will hang with error " Cannot find cygwin1.dll ", which is pagt of cygwin Linux environment.
    To solve it you can aither - add path to it's location in Windows system Patch variable, or copy cygwin1.dll to the same folder with grbl_sim.exe.
    it's located in %cygwin_home%/bin directory - C:/cygwin64/bin/cygwin1.dll in my case.

  3. use it.
    I'm used grbl_sim to play with IoSender over TCP port.
    Run
    grbl_sim.exe -p 2020
    than you can use connect to localhost:2020 on the same machine, or use IP address of LAN adapter from different computer.
    Connecting simulator to the virtual COM port is not so easy task in Windows and require additional virtual COM port software with bridge to TCP port.
    Compiled version to try

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

3 participants