You could move your ram and flash (internal and external) and IO's out of the bottom of the memory space and then assign an unused chip select to zero, with write protect (read-only). You could also do it with an unused ACRx (cache controller). Null-pointer assigment would result in an access error exception (interrupt vector 2) in both cases. If you also want to trap null pointer de-referencing, don't assign any chip select to the zero range.