This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM263P4-Q1: SpinLock lock and unlock timing between two Cores

Part Number: AM263P4-Q1

Tool/software:

Hi,

I am running two applications on Core 0 and Core 2 under lockstep mode.

On Core 2, the program lock the spinlock 0 at the beginning and unlock it after finish initialisation work.

On Core 0, it is keep checking spinlock 0 from the start, when the spinlock 0 is free, it starts do initialisation.

The question is that I found after Core 2 free the spinlock, the Core 0 still wait for about 9ms, then start to run.

Is this normal? or can someone explain why it works like this?

See this picture

Green is Core 0 and Orange is Core 2

1: bootlaoder release Cores

2: Core 2 lock spinlock and start to run

3: Core 0 start to check spinlock

4: Core 2 free spinlock

5: Core 0 get spinlock and start to run

There are about 9ms between point 4 to point 5.

  • Hi Phoenix,

    What Code/API are you using to check/lock/free the spinlock from each core?

    I would expect there to be some delay for Core0 to check the spinlock status and if free, lock the spinlock, but I am unaware of any typical timing expectations for this at the moment. 9ms does seem to be quite slow.

    It may be faster to use direct register read/write functions then the API due to some software overheard, but I need to verify this with the SDK team.

    Best Regards,

    Zackary Fleenor

  • Hi Zackary,

    I am doing the read/write spinlock register directly. 

    The function is working but the time is very long when talking about reading/writing register.

    If you could find more information of the time, that's will be very helpful.

    Thanks