-
Notifications
You must be signed in to change notification settings - Fork 6
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
Is there a way for me to switch between USB and MPG UART without having to reflash the microcontroller (STM32F407)? #7
Comments
Which board map are you using? Asking since it could be due to pin assignment clashes. I do not lose USB connection when testing with my dev board.
Yes.
Yes, but you cannot send gcode or Grbl style jog commands - only single character commands as listed here. |
My board is DevEBox V3.0 which uses the microcontroller stm32f407vgt6. The USB OTG peripheral uses pins PA11 and PA12, while UART1 uses pins PA9 and PA10, UART2 uses pins PA2 and PA3, UART3 uses pins PD8 and PD9, and UART6 uses pins PC6 and PC7. I looked in the code a couple of days ago and in the file driver.c at line 2486 there is this piece of code:
|
Odd. If you introduce a bug in the code by changing
Note that in MPG mode some of the output to the USB port is replicated to the MPG port to allow the MPG to display data without requesting it. E.g. the init message and the real-time report is. |
Since i didn't find a function noInit() i put a NULL as a parameter to stream_connect() (I also defined MPG_ENABLE with a value of 2). The firmware compiles. I flashed it into the MCU and when i opened my app for streaming g-code through USB (it's called LaserGRBL) from my PC, but it could not detect an available COM port. Which means that the problem is not that the USB connection cannot be made, but somehow the communication between the app on my PC and the MCU is not right. Maybe the app does not connect to the MCU because it awaits some kind of acknowledge... |
I tried UGS (Universal G-code Sender) and the app connected... |
The idea was to introduce a bug, if it compiles then the USB port is not initialized as it should and the next step is to figure out why.
ioSender is made to support most of grblHALs new features. |
I tried different configurations of the firmware by changing the values of KEYPAD_ENABLE and MPG_ENABLE while trying to keep the USB as the main serial communication method, but I found out that if MPG_ENABLE is not defined and KEYPAD_ENABLE is - the USB works and the app on my computer (LaserGRBL) can connect to my microcontroller, but if MPG_ENABLE is defined, a connection through USB cannot be made with a PC. Why is that? Is it even possible to have a a machine, which receives g-code from USB, but can also be manually controlled with jogging commands from a "pendant"/control panel, without changing the code of the firmware? Can this problem be solved if MPG_ENABLE is not defined and only KEYPAD_ENABLE is and the jogging commands can be sent to the dedicated keypad plugin UART/I2C peripheral?
Originally posted by @AvatarBg111 in #3 (comment)
The text was updated successfully, but these errors were encountered: