Hello, I am using PCA10040 with nRF52832 SOC. On top of it, I installed pcl298336 shield board with DWM3000 module, that contains DW3110 chip.
I am using DW3XXX_API_rev9p3. I ported the example project (that was originally intended for nRF52840) to nRF52832, with the use of legacy nRF5 SDK 17.1.0_ddde560. The project is built and ran using SEGGER Embedded Studio v8.16b.
The project is liked with libdwt_uwb_driver-m4-hfp-6.0.7.a library.
I ran the project and it works fine, right until the precompiled library’s function “dwt_readdevid()” is called. I use non-modified ex_00a_reading_dev_id example.
The disassembly of readdevid() with runtime values are here:
<dwt_readdevid>
B510 push {r4, lr}
B082 sub sp, sp, #8
2100 movs r1, #0
AB02 add r3, sp, #8 ; after exec: r3 = 0x2000ffe0, sp = 0x2000ffd8
F8431D04 str r1, [r3, #-4]! ; after exec: r1 = 0x00000000, r3 = 0x2000ffdc
4A04 ldr r2, =0x20000C5C ; after exec: r2 = 0x20000c5c
6810 ldr r0, [r2]; after exec: r0 = 0x20000c60
6882 ldr r2, [r0, #8]; after exec: r2 = 0x00000000
6912 ldr r2, [r2, #16]; after exec: r2 = 0x00012015
6AD4 ldr r4, [r2, #0x2C]; after exec: r4 = 0xbf600101
460A mov r2, r1; after exec: r2 = 0x00000000
47A0 blx r4 ; EXCEPTION TRIGGERED
9801 ldr r0, [sp, #4]
B002 add sp, sp, #8
BD10 pop {r4, pc}
20000C5C .word 0x20000C5C
The instruction ‘BLX r4’ trips the processor, as the value inside R4 is invalid for branching. The problem is probably because the library loads static address 0x20000C5C into R2 and then accesses some subfields from that address. It should be probably a conf. data structure inside ram or something.
0x20000000 is the beginning of RAM region, but the data fetched by qorvo library is obviously not what should be fetched. Did I compile or layed the library wrongly in the memory? Or should I check if the library is initialized properly before calling this function? (the example project should do it though).
Thank you for any help.