Open Coolxer opened 3 years ago
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.
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.
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.
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.
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.
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
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
3) 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
5) 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
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.
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_eepromextensions.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) -DFCPU=$(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 $@ `