Skip to main content
Explorer
January 29, 2024
Question

strex calls DAbt interrupt

  • January 29, 2024
  • 1 reply
  • 987 views

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?

 

    This topic has been closed for replies.

    1 reply

    Super User
    January 29, 2024

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

    Explorer
    January 29, 2024

    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.