cancel
Showing results for 
Search instead for 
Did you mean: 

strex calls DAbt interrupt

Roman Andronov
Associate II

Processor stm32mp157

it runs Opencv in baremetal mode

single-tasking environment.

when calling a method

void UMat::addref()

{

if( u )

CV_XADD(&(u->urefcount), 1);

}

we get DAbt.

The disassembler shows a set of instructions

 388 CV_XADD(&(u->urefcount), 1);
c013c5cc: ldr r3, [r11, #-8]
c013c5d0: ldr r3, [r3, #24]
c013c5d4: add r3, r3, #8
c013c5d8: dmb ish
c013c5dc: ldrex r1, [r3]
c013c5e0: add r1, r1, #1
c013c5e4: strex r2, r1, [r3]
c013c5e8: cmp r2, #0
c013c5ec: bne 0xc013c5dc <_ZN2cv4UMat6addrefEv+48>

The memory addresses being accessed are correct and located in the DDR RAM

When executing instruction c013c5e4: strex r2, r1, [r3], a DAbt interrupt occurs.

'GNU Tools for STM32 11.3.rel1.20230912-1600'

What is the reason for this behavior?

 

2 REPLIES 2
TDK
Guru

What is the memory address and is it word-aligned? Can it be accessed with a str/ldr instruction?

If you feel a post has answered your question, please click "Accept as Solution".

Yes the address is aligned

Memory is available in the debugger.

I haven't checked str/ldr. since this is part of the library and embedding assembly code into it is a problem

reading is in progress. there is a recording failure

PS  I changed the macro CV_XADD to a simple variable increment and it worked.