0

I am trying to check if a function is called every 2 miliseconds by way of a script. For this I need to read the value of a timer but I get the error 'memory access not allowed' when I try to read it(Data.Long(D:0xF00001010)). This is may code:

GLOBAL &calledFunction &result &difftime &start &end 
    
    &calledFunction = "func1"
    
    Go
    BREAK.SET &calledFunction /Program
    
    
    WAIT !STATE.RUN() 5.0s
    IF (STATE.RUN())
    (
        
        &result = "failed"
        
    )
    ELSE
    (
        &start = Data.Long(D:0xF00001010)
        
        Go
        
        WAIT !STATE.RUN() 5.0s
        IF (STATE.RUN())
        (
            &result = "failed"
        )
        ELSE
        (
            
            &end = Data.Long(D:0xF00001010)
            &difftime = &start - &end
            
            IF (&difftime == 2ms)
            (
                
                    &result = "passed"
            
            )
            
            ELSE
            (
                &result = "failed"  
            )
        )   
    )
    
    
    break.Delete
    break
    
ENDDO

Is there any way I can access the timer's value or maybe another solution to check if the function is called periodically? I tried using the runtime functions but the accuracy is not so good.

sandra
  • 65
  • 4
  • Does it work if you read the memory manually, meaning not inside of a script? You can test this by executing `PRINT Data.Long(D:0xF00001010)` in the command line. – dev15 Feb 25 '21 at 10:15
  • no, I get the same error – sandra Feb 25 '21 at 10:26
  • One reason for the error could be that you used `MAP` commands to deny or limit the access to this memory. – dev15 Feb 25 '21 at 10:30
  • If that's not the case it could also be architecture specific limitation. Are you sure about the address `D:0xF00001010`? In this case it might make sense to send an E-Mail to support@lauterbach.com with the information provided here, the target architecture/chip and your used TRACE32 version. – dev15 Feb 25 '21 at 11:03
  • I'm sure about the address. Thank you for the advice, I will probably do that. – sandra Feb 25 '21 at 11:46

0 Answers0