Hi everyone,
I’m working on implementing simpleFOC in my project. I designed some custom BLDC motor controller PCBs featuring an ESP32-C6, in hopes of utilizing simpleFOC for controlling BLDC motors for a CNC machine.
Thus far I’ve been to integrate Espresiffs port of simpleFOC successfully, and can take string inputs from a CAN bus, using sprintf and some logic to append various float values, to changing commander prefix (such as MLC, MLU, MLV, T, etc…
This is all great, but I’m now at a point of having to address the issue i’ve been having all along: No serial comms from simpleFOC. and as such - no motor info or debugging.
As I am using the ESP32-C6 I’ve had the joy of having to try and make sense of how the USB JTAG, and the serial communication through this interface.
On my custom board, I specifically chose to not have a dedicated UART bridge, and run the USB diff pair directly into the ESP, utilizing it’s usb jtag for flashing and monitoring.
Unfortunately, it seems to me, simpleFOC only supports UART (depite being named serial) communication for it’s commander interface?
I noticed that changing the sdkconfig to:
CONFIG_ESP_CONSOLE_UART_DEFAULT=y
CONFIG_ESP_CONSOLE_SECONDARY_USB_SERIAL_JTAG=y
CONFIG_ESP_CONSOLE_UART_NUM=0
CONFIG_ESP_CONSOLE_ROM_SERIAL_PORT_NUM=0
Would get rid of my error message;
uart: uart_write_bytes(1454): uart_num error
Where as having the sdkconfig set as:
# CONFIG_ESP_CONSOLE_UART_DEFAULT is not set
CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG=y
CONFIG_ESP_CONSOLE_SECONDARY_NONE=y
CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG_ENABLED=y
CONFIG_ESP_CONSOLE_UART_NUM=-1
CONFIG_ESP_CONSOLE_ROM_SERIAL_PORT_NUM=3
Which makes sense.
But! I suppose the question then is; Is it possible to reconfigure simpleFOC to use the USB JTAG communication?
I would suspect that this also influences S3 and C3 users? (if native usb is used)
Any input is appreciated, cheers!
\n