Bug in IfxSmu_lock() and IfxSmu_unlock()?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
User21797
Level 2
Level 2
10 likes given First comment on blog First solution authored

Hi there,

Think I have found a bug in the iLLD for IfxSmu_lock() and IfxSmu_unlock()

I found that whenever the program calling these two function and try to write to smu->KEYS.B.CFGLCK, it jump to memory trap

More digging around found that the write access mode for the register SMU_KEYS have wording '32' (user manual table 10-30), I am guessing it means 32 bit access?

So e.g. for IfxSmu_unlock() I try to change 'smu->KEYS.B.CFGLCK = 0xBC;' to 'smu->KEYS.U = 0x000000BC;' and it work!!!

Wanta confirm is it really a bug? Or I am just using the function wrong?

I am using KIT_AURIX_TC234_TFT and iLLD_TC2xx_V1_0_1_13_0

Thanks for reading, any reply is appreciated.

0 Likes
1 Solution
MoD
Employee
Employee
50 likes received 500 replies posted 100 solutions authored

I guess the compiler is here the problem. Please check the resulting assembler code which access width is used for access the SMU_KEYS register. The write access must be always 32 bit. If there is a byte access then the compiler ignores the Ifx_Strict_32Bit definition which informs the compiler that only 32 bit access allowed is for bitfield CFGLCK. From code point of view there is no error.

View solution in original post

4 Replies
FD_aurix
Level 5
Level 5
100 sign-ins 100 replies posted 5 solutions authored

I don't know your particoular target but smu->KEYS.B.CFGLCK = 0xBC;'  and 'smu->KEYS.U = 0x000000BC;' do two different things. The second one set also the other part of the register (PERLCK) to 0!  Maybe is here the difference

MoD
Employee
Employee
50 likes received 500 replies posted 100 solutions authored

I guess the compiler is here the problem. Please check the resulting assembler code which access width is used for access the SMU_KEYS register. The write access must be always 32 bit. If there is a byte access then the compiler ignores the Ifx_Strict_32Bit definition which informs the compiler that only 32 bit access allowed is for bitfield CFGLCK. From code point of view there is no error.

User21797
Level 2
Level 2
10 likes given First comment on blog First solution authored

Thanks for all of your reply. I will check with the compiler side then. Btw @MoD what compiler u are using?

0 Likes
MoD
Employee
Employee
50 likes received 500 replies posted 100 solutions authored

I am using Tasking, HighTec, Greenhills and Windriver.