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.

MSPM0G3507-Q1: ldr instruction failed

Part Number: MSPM0G3507-Q1

Tool/software:

The issue was firstly found that here the variable PI_para.Ki  was not valued right.

We found, in picture 1, it's because the ldr did not read the value to R0, but if we set a breakpoint at line 0x8772 and step through it, it can load value to R0 as expected. 

To locate the problem, we tried:

- disable all interrupt

- disable all cache

- Use 32MHz OSC instead of 80MHz PLL

These attempts cannot help on it.

Besides, in picture 2, after we placed a nop before the ldr, it works.

picture 1:

picture 2:

How can we process such an issue?

It's not a single case, I found 3 other failures like this and my colleague also see such a case when he debug his module.

  • Hello Zhenxing,

    1). Which IDE do you use and which compiler do you use?

    2). Please check whether the value you want to write into the variable needs some time to obtain (maybe need some complex calculation, or maybe generated / output by one peripheral) because the breakpoint and NOP are equivalent to a delay before executing the assignment operation.

    3). You can try to do a simple assignment operation such as A = 0x01, and check whether the ldr can operate normally.

    Best Regards,

    Janz Bai

  • Hello Janz,

    Thanks for your reply.

    The value is read from an array, starting from address 0x2020011c, which had been initialized at the very beginning. And the routine here is to read a value from the array and write to Stack area.

    Not every ldr would be failed. In the picture 1, the ldr at 0x8770 works well.

    Best Regards!

  • Hi Zhenxing,

    I will get in touch with you in the email.

    B.R.

    Sal