You didn't say exactly what you did via ssh that "bricked the firmware".
Most routers have different parts for the firmware. The first stage is a comparatively simple, often uboot. This first-stage then loads the real firmware as second stage. Googling seems to confirm that UBNT EdgeRouter X uses uboot.
So if you didn't destroy uboot by whatever you were doing, you should be able to use the uboot recovery mode (google).
If you did destroy it, there's probably nothing you can do. The lessen to learn then is that when doing a firmware upgrade, you always upgrade the "proper" (second-stage) firmware only. And before you do it, you have a good look at what part of the flash ROM contains which kind of information.
Edit
As there seems to be some confusion about this, let's sort out serial/UART vs. JTAG.
Looking at the OpenWRT page for the router, one can see the UART/serial connection in the following picture:
![UART/serial port](../../I/static/images/3bd98bc81c993cf96590ae6e3a406f68f305a52dd4b1b5c643df7abdad0ca896.jpg)
This will provide a serial console to the device, which needs a working firmware, e.g. uboot. If uboot is already running anyway, there's no advantage in using the serial console over using the network console in recovery mode (unless this doesn't work for some reason). And the network console doesn't need additional hardware, like the wires one needs to connect to the serial port.
The chipset also seems to have a JTAG port, though I haven't found any indication where it is on the board. The standard JTAG header has 20 pins, in the picture one can see room for a header (not soldered) with 14 pins, which may contain some of the JTAG pins (or may be something completely different). There also may be no unsoldered JTAG header at all, and it would be necessary to get the JTAG signals directly from the main chipset.
With JTAG, it's possible to also flash the first-stage bootloader, but to do that, one needs special hardware that understand the JTAG protocol. A simple serial connection won't do.
When having the choice between buying JTAG-protocol hardware, and buying a new router, buying a new router usually is cheaper. Unless one plans to do a lot of hacking in the future using JTAG.
2Voted to close because there are lots of routers and lots of meaning of the word brick with respect of them. – davidgo – 2018-07-22T08:39:44.957
1"Bricked" can mean so many things... in many cases, it's unlikely you'll be able to fix it via a UART alone... Especially if a test point marked 3.3v is reading 0v - that could well be a hardware issue. – Attie – 2018-07-22T08:40:36.103
@KamilMaciorowski UBNT EdgeRouter X – user926368 – 2018-07-22T09:17:45.170
@Attie Bricked while changing the firmware using SSH. Then connected to router 3v3 got connected to UART 3v3 – user926368 – 2018-07-22T09:18:46.040
1You can (should) add relevant information by editing the question. This time I did it for you. You may write a comment to notify the user who asked for clarification (as you did), but the question itself should be standalone and not rely on comments that follow. – Kamil Maciorowski – 2018-07-22T09:32:48.593
Have you searched the Ubiquity forums, or been in contact with their tech support? They are usually very good!
– Attie – 2018-07-22T12:25:18.0931Usually cure of bricked devices is done via JTAG connector (not UART), but AFAIK Ubiquiti dosen't support it well. IMHO the best way is to bring it to service center – Alex – 2018-07-22T12:37:57.290
Do you have a link light when you plug into eth0? Have you tried plugging a usb-serial into the console? You should see some sort of uboot output. What version firmware were you running, and what version were you going to? – Tim_Stewart – 2018-07-23T04:19:27.257