Given your description - especially that FlashMagic cannot erase the whole device - it suggests a power problem. So, make sure you have enough power being supplied to the board,
Hi, Akshay,
Unfortunately, I have not the LPC2138 board, which is very old. I attach two screenshot which tell you how to configure the J-link setting based on LPC54114 board.
After you success to compile/link, you can click Debug->Start/Stop Debug Session to download code as the second screenshot.
Hope it can help you
BR
Xiangjun rong