-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Porting to ARM (Arduino Due, MK64F, PSOC 4200/M) #1030
Comments
I am also currently porting to ARM, Texas instruments Tiva C (TM4C123GH6PM). My HAL implementation is based on pointers to functions. I will change the code into a library as my intention is to integrate it into another project for a CO2 laser controller I have made. I am in no hurry since I already have Mach3 support for my controller - GRBL port to be completed by the end of this year? I understand the GRBL core team is also working on a HAL - but I do not know what their approach is, maybe it is restrained by the fact that 8-bit processors are still to be supported? |
What is the reason you make different port for tivaC ?
|
@cri-s Not sure what you mean by "different", anyway my main reason is that my laser controller is Tiva C based and the port is targeted for that. Another reason is that I want to do some hardware/firmware design just for the fun of it (and for learning) - even if I can buy existing controllers for less money. |
@terjeio : There not much of a "team" Grbl, as it's just been myself for a very long time. 8-bit support will be dropped soon after v1.0 is released. I will be moving on to investing all my time to continuing to develop the ARM version, which is a complete re-write of the Grbl base code. Grbl itself is designed specifically for the 8-bit AVR and has a lot of "unsavory" code that was written for the interest of maximizing performance and reducing compiled flash size. Mainly the latter. The ARM version has no such restriction, and there are a number of algorithmic improvements that will make it better on a fundamental level. I won't divulge what they are, but they will be awesome. |
Is there a way to collaborate on the ARM's port work ?
|
@rspievakc : No, not at this time, but I do regularly keep tabs on people port Grbl to different ARM chips. It always helps to see how other people attack the problem . |
@rspievakc : lasaurGrbl is a port that always targets to tivaC123, 2016-07-03 0:35 GMT, Sonny Jeon notifications@github.com:
|
@cri-s : Many thanks for the pointer to the existing Tiva port - I will look into it. I can see from a quick glance that the HAL is #define based - I am using a struct containing pointers to functions, this means that the HAL will be completely separated from the main Grbl codebase for different implementations - resulting in easier porting and maintenance (IMO). |
Nice to see that the "port" didn't go unnoticed .. :-) My goals were:
Up until now i've done a boosterpack/shield for the tiva, added basic
|
Search-fu fails again! But this time, with a slight twist... Figures this thread came along (and to my attention) long after my work was well in progress. |
This is my attempt to port GRBL 1.0d to STM32F103C8T6. https://www.youtube.com/watch?v=ehgXMa2spWM&feature=youtu.be. I only have 3020 CNC and no limit switch is tested. I will soon buy limit switch to install on my CNC to test the feature. Spindle or coolant features are not implented. It uses micro USB (serial port simulation). The EEPROM implementation uses 1K of flash to store the data. I use |
"usbcnc" How can I contact you? |
Here you are. There is also one WIndows simulation project (which helps to debug the code). You might need to modify the folders. The STM32 project files was under STM32GRBL. The grbl files are under grbl-masterwin. (Yes the Windows simulation files are in it). To enable EEPROM simulation for STM32 you need to uncomment NOEEPROMSUPPORT in grbl.h. There is really no need if you just run it on your machine or debug the code since it might eventually kill the life of the flash. But this feature works. What I did is use a flush function to write to flash instead using STM's EEPROM library. That one needs at least 2K flash and GRBL's EEPROM can be easily emulated. The same emulation was done for Windows too. (Check eeprom.c). To run Windows simulation, if you do not have any serial port then it accept keyboard. If you have TWO serial port and connect TX-RX each other, you start the win-grbl with the parameter of one serial port (say grbl COM3), you can run gcode-sender on another serial port and it works, you can put break point anywhere to debug the code. I first ported to Windows and since Windows does not like the some C style (declare variable in middle), I changed that quite a bit). |
@ericwazhung : Awesome! Thanks for sharing! |
Here is my approach towards HAL abstraction. Code is NOT tested with physical machine and is NOT complete, it is posted here only for sharing ideas. Stepper driver ISR executes in about 7uS on 80MHz Tiva C processor... |
Finally learned how to use github to push changes. |
I'm in the process to port the code to ARM micro controllers and GCC toolchain. My question is, if is there any project already doing this ? In this case I could contribute to it instead of starting from ground up.
I already have the latest source code adjusted and with hardware abstraction ready. I also created a setup which uses the Segger System View + JLink to trace execution points and verify if the logic + timings are all correct. The hardware abstraction is using inline statements to avoid calling branches.
I'm also testing it with the NXP's FRDM-64F and Cypress PSOC 4200 and PSOC 4200M.
My next question is should I create a new GitHub repository or if I should share the code inside the GRBL tree ?
Thank you for the help.
The text was updated successfully, but these errors were encountered: