You should have backed up the firmware before formatting the SD Micro. If you didn't, visit the flash cartridge's official website as listed on the cartridge's sticker/label.
umm, the website on the R4 is "www.r4ultra.com" however I have another identical R4 which doesn't have a website on it?
You seems to have 2 cartridges from 2 different producers; R4 SDHC amd R4 SDHC Ultra. Both are low end clones. If their official websites are down then try; http://www.linfoxdomain.com/nintendo/ds/.
Another place you could try looking for their respective primary firmware is this : http://filetrip.net/nds-downloads/flashcart-files/r4-series/. Be careful not to add wrong files, and follow their provided instructions to the dot.