When
using nrf_modem_shutdown of libmodem.a. It need to wait 48 seconds and
leave.
To fix it in assembly source.
///////////////////Trace
into nrf_modem_shutdown()///////////////////
<nrf_modem_shutdown>
4B
B510 push {r4, lr}
B
2400 movs r4, #0
4B
781B ldrb r3, [r3]
B12B cbz r3, 0x00031456
2B01 cmp r3, #1
D007 beq 0x0003145E
F7FFFFB1 bl 0x000313B4 <modem_off>
4620 mov r0, r4
BD10 pop {r4, pc}
F
4604 mov r4, r0
E
F7FBFC87 bl 0x0002CD70 <nrfx_ipc_uninit>
E
F
E
BF00 nop
///////////////////transfer
it to c///////////////////
void nrf_modem_shutdown(void)
{
if ( operation_mode ) {
if ( operation_mode == 1 )
nrfx_ipc_uninit();
} else {
v0 = nrf_modem_platform_shutdown();
}
modem_off();
}
/////////////////////<nrf_modem_platform_shutdown>/////////////////////
B
F7FFF9E7 bl 0x00030848 <gnss_interface_deinit>
2800 cmp r0, #0
BF14 ite ne
2416 movne r4, #22
2400 moveq r4, #
2800 cmp r0, #0
BF18 it ne
2416 movne r4, #
2800 cmp r0, #0
BF18 it ne
2416 movne r4, #
2800 cmp r0, #0
BF18 it ne
2416 movne r4, #
2800 cmp r0, #0
BF18 it ne
2416 movne r4, #
2800 cmp r0, #0
BF18 it ne
2416 movne r4, #
2664 movs r6, #0x
F012FAFA bl 0x00043ABA
<rpc_transport_shutdown_done>
B908 cbnz r0, 0x000314CC
2D00 cmp r5, #0
DC16 bgt 0x000314FA
F012FAF7 bl 0x00043ABE <rpc_transport_shutdown>
F64B3580 movw r5, #0xBB80 //48000(ms)
2764 movs r7, #0x64
4E0D ldr r6, =0x
2B01 cmp r3, #1 //if (
MEMORY[0x40005440] != 1 )
D109 bne 0x
2000 movs r0, #
9701 str r7, [sp, #4]
F00FFE87 bl 0x
9B01 ldr r3, [sp, #4]
3B64 subs r3, #0x64
441D add r5, r3
2D00 cmp r5, #0
DCF1 bgt 0x000314D8
//} while ( v0 > 0 );
4620 mov r0, r4
B003 add sp, sp, #12
BDF0 pop {r4-r7, pc}
A901 add r1, sp, #4
9601 str r6, [sp, #4]
F00FFE7B bl 0x
9B01 ldr r3, [sp, #4]
3B64 subs r3, #0x64
441D add r5, r3
E7DB b 0x
BF00 nop
///////////////////transfer
it to c///////////////////
v0 = 48000; //0xBB80
do {
if ( MEMORY[0x40005440] != 1 )
break;
v1 = 100;
nrf_modem_os_timedwait(0, &v9);
v0 += v1 - 0x64;
} while ( v0 > 0 );
///////////////////fix code///////////////////
4B F6 80 35 64 27 0D 4E - search this code on ultraedit
movw r5, #0xB B80
//////////////////////////////////////////////////
Patch file:
https://www.mediafire.com/file/6ffgv1sk7izj5rl/libmodem.zip
沒有留言:
張貼留言