Logically your code looks correct - what toolchain / version are you using?
View all questions in Arm Development Studio forum