what's wrong with my register writing code on a RA4T1? The register content is not changed.

Hi,  I'm using a RA4T1.  I want to change GPT timer5 GTCNT value before starting it as 180 degrees off with timer0 in sync.  My single line C code in hal_entry.c is below.

g_timer5_ctrl.p_reg->GTCNT = (PWMPeriod >> 1); //count init to 180 degrees

I check the disassembly, it corresponds to below code segment

170 g_timer5_ctrl.p_reg->GTCNT = (PWMPeriod >> 1); //count init to 180 degrees
00000478: ldr r2, [pc, #264] ; (0x584 <hal_entry+684>)
0000047a: ldrh r3, [r7, #0]
0000047c: ldr r2, [r2, #8]
0000047e: lsrs r3, r3, #1
173 err = R_ELC_Open(&g_elc_ctrl, &g_elc_cfg);
00000480: ldr r1, [pc, #260] ; (0x588 <hal_entry+688>)
00000482: ldr r0, [pc, #264] ; (0x58c <hal_entry+692>)
170 g_timer5_ctrl.p_reg->GTCNT = (PWMPeriod >> 1); //count init to 180 degrees
00000484: str r3, [r2, #72] ; 0x48

I trace both in C and in disassembly in debugger, the content of GTCNT is not changed at all. Below is a picture linking C and disassembly.

In fact, all my single line c code attempting to change register value in hal_entry() seems not able to make the change. Can you help me understand why?

RA4T1_MicroInverter3.zipThis is the zip file of the entire project.