When accessing SFRs on MPC5xxx / SPC 5x devices problems occur.
1. Check if clock(s) for peripheral modules are switched on.
2. Use initialization sequence in the Hardware / CPU Options / Reset dialog to enable access to the peripheral modules.
3. Add this write also to the application startup code since the issue is not related to the debugging only.
After reset, peripheral modules are powered off to save power. If these peripheral registers are read by the application or the debugger, a bus error is generated and the CPU gets stuck.
For Bolero device with 512KB internal FLASH, write 0x80808000 to the CGM_SC_DC0 register (address 0xC3FE037C) before accessing any SFR. This switches on clocks for all peripheral modules.
Some devices have more CGM_SC_DCn registers controlling microcontroller peripheral modules. For instance on one ST device, additionally 0x000000FE needs to be written to the ME.RUNPC.R to make things work.
Sorry this article didn't answer your question, we'd love to hear how we can improve it.
Note: This form won't submit a case. We'll just use it to make this article better.