Xenith/Unity enable unused internal UART port?

Hello there,
I’m new here and this is my first post so please go easy on me :slight_smile:

Has anyone been able to modify the Unity firmware to enable the third UART port (right below the BLE module)?

I looked into the code on github and saw that the BLE and normal UART ports are defined but not the 3rd, unused one.
I don’t have much experience in C programming but, would it work for the Unity/Xenith if we define the third UART pins like how it’s done on the Stormcore?
idek

2 Likes

i remember there was a thread quite some time ago about this as well, let me see if i can find it

edit: @esc_sequence i found it

2 Likes

This might also come in handy

2 Likes

I did some research a few days ago and saw this as well. I want to be able to use the BLE module where it is and enable the UART port right below it at baud rate of 115200. The post above set the baud rate for BLE port to 115200 instead of 250000 which I think would make the BLE module unusable.

If enabling the 3rd UART port not working out I will resort to this option and remove the BLE module. But I have hope in the geniuses in this forum.

3 Likes

VESC Discord might also be able to help maybe

Adding that code for the third UART from the Stormcore will work, just tested it. Will be nice to have another UART port on those.

Here is a compiled version of 5.3 with that change if you want

Unity_5.3_Firmware_3rd_UART_jaykup.bin (384.0 KB)

// Pins for Third UART
#define HW_UART_3_BAUD                          115200
#define HW_UART_3_DEV                           SD2
#define HW_UART_3_GPIO_AF                       GPIO_AF_USART2
#define HW_UART_3_TX_PORT                       GPIOD
#define HW_UART_3_TX_PIN                        6
#define HW_UART_3_RX_PORT                       GPIOD
#define HW_UART_3_RX_PIN                        5

14 Likes

Niceee! Thank you for testing this on your hardware. Is that a trampa wand receiver you’re plugging into the sketchy uart port? Did you get any problem with this setup?

I will carefully proceed to flash this onto my xenith once I receive the battery for my build. Hopefully I will be able to connect the davega to this port.

1 Like

the polling rate might mess with other uart device, especially if u planning to use uart remote, just don’t (use uart remote in this case)

1 Like

You’re a gem!

3 Likes

Dude you’re a fucking saint.

3 Likes

It is a wand receiver, but I just turned it on and tested the bluetooth connection using the Android app. I was able to see realtime data/change settings and could also connect to the built in bluetooth.

FWIW the old Enertion firmware created by the original hardware designer had this enabled (though the TX/RX pins were incorrectly swapped) so it should work fine.

3 Likes

An update on this. I have finished my build with 3 uart devices running on the Xenith v2.1 (Voyager remote, Davega X, BLE module). All 3 devices work simultaneously without losing connection.

5 Likes

R u able to configure via vesctool app and save setting while the davega is on?

Which fw u on?

yea I did motor detection and the rest of config with vesc tool app on iphone while davega is on. Binded the bkb voyager remote and was able to receive telemetry on the screen as well as throttle control. Fw is 5.3, same as the one @jaykup posted.

2 Likes

Hi, I’ve been trying this modded firmware on my xenith v2 and I cant get ppm telemetry working on the 3rd port. I’m using pins 7 and 9 (pic from other post)for TX2 and RX2 to feed the reciever for data only. Am I right or have I cocked it up?

I’ve tested the remote settings on the actual uart port and it’s working but I want to use my davega, BLE BT and have remote data also.

Try swapping tx/rx and make sure you are using the correct voltage

Pin 7 = TX2 (plug into RX on receiver)
Pin 9 = RX2 (plug into TX on receiver)
Pin 10 = GND
Pin 14 = 3.3v

Pin 13 = 5v

A pic of your wiring may help

2 Likes

Thanks, at least I’m using the correct pins. I only need the tx and rx as I’m using ppm and uart(for data). I’ve tried swapping them.

When I flash your edited firmware bin file I just load it in the custom file and flash it right? There’s no other changes other than setting up as normal? I’m just thinking if I havent enabled the port properly.

1 Like

You can flash the bootloader then try loading the firmware again using the custom tab. It won’t stick if there is no bootloader. Does it take a few min then reboot?

Do you have another uart device you could try in that port?

Ok that might be it, I only flashed the bin file.
It works with the main uart fine but I want the davega in there.

I’ll try again with the bootloader this time.

Ok I flashed the bootloader (generic) first then the bin file, reboot as normal and restored my config.
Still no go on the port, either orientation on those two pins maybe it’s just not meant to be for me.