I've compiled a tiny test program and tried to download it to flash.
It does not work because in LPC17xx SRAM starts at 0x10000000, not 0x40000000.
So, I think, it is necessary to change the code from
using LPC_RAMSTART and LPC_RAMBASE constants
to using the value, configurable in LPCtypes[] table,
or something equivalent.