I started porting grbl (link) to HiFive1.
For those of you unfamiliar with grbl, it’s an Arduino-based real-time G-code interpreter capable of driving CNC machines like engravers and laser cutters.
My porting is still work in progress, but so far I managed to get the UART working with interrupts and I managed to get the PWM output working properly.
You may find some info about this on my github:
Grbl for HiFive1
I’m trying to use PWM interrupts for periodic interrupts. The decision was to use PWM interrupts to get a periodic interrupt at fixed intervals, independent on the IRQ service time.
I encountered this weird behaviour where interrupts get disabled for no apparent reason. Trying to debug this with openocd, I see that mstatus has the MIE bit turned off without the software explicitly turning it off. This means everything gets stuck: no UART, no motor control.
As I said, it’s still work in progress, but if anyone wants to help or get more information, feel free to contact me or reply to this thread.