Problem in PIC24FJ128GA202 UART?
You need to unlock the PPS prior to making changes. Specifically, the 

__builtin_write_OSCCONL(OSCCON &amp; 0xbf);


must be moved above

RPINR18bits.U1RXR   = 7;


Also, you probably want to use MC macros to do this. Here is an example of working UART init for similar micro -> https://github.com/felis/cdb/blob/master/fw/minimal/bsp.c#L185