2023-09-02 08:23 AM
Is there a way to split the XPSR register view up so you can see each status bit by its name rather than the 32-bit value?
The SFRs have this feature, why do the general registers not have it enabled by default?
Solved! Go to Solution.
2023-09-03 10:45 AM - edited 2023-09-04 05:35 PM
Hello again
Using CubeIDE this is the best result we can have.
I hope you can use it with your students.
Best regards.
II
2023-09-02 08:45 AM
2023-09-03 04:59 AM - edited 2023-09-03 04:59 AM
Hello @Issamos
Thank you for your reply.
I'm aware of how to decode the binary string using the Arm references and I saw the previous post that implies there is no way to have STM32CubeIDE do it for you. I was hoping that the IDE had been improved in the last 2 years since that post.
It's a hassle to manually decode the flags when a computer program should be able to parse the register and display it in a human-readable format, especially when it does so already for the memory-mapped peripherals.
Is this an ST problem or an Eclipse problem?
Glenn
2023-09-03 05:19 AM
As an example, here's what Keil shows:
2023-09-03 05:31 AM - edited 2023-09-04 05:35 PM
I think that you can use this commande.
But I'm not sure that we can use it with cortex's other than the cortex-M33. If you can get the xPSR value, it will be so easy to split it using the same programming manual.
Best regards.
II
2023-09-03 08:05 AM
I think you're not getting what I'm asking.
Other IDEs and debuggers can view the current xPSR values split up as a bitfield in the IDE registers window. STM32CubeIDE does not appear to be able to do so. I was asking if there was a way to do what seems like a very useful and programmatically trivial thing that is already available for the peripheral registers.
I know I can manually do the maths to work out which bits are set, and I know there are compiler intrinsics to read it programmatically, but that is no help when I want to debug the code and see real-time which flags change.
Context: I'm teaching a class on embedded systems at a low level, and I want the students to understand why when they add one to 0x7FFFFFFF the N flag and V flag get set even though an `unsigned int` is still a positive value. It's easy to do in some IDEs where they see the flags flip over, now I've got to tell them to decode the bitfield by hand.
2023-09-03 10:45 AM - edited 2023-09-04 05:35 PM
Hello again
Using CubeIDE this is the best result we can have.
I hope you can use it with your students.
Best regards.
II
2023-09-04 11:29 AM
I'm sad to see "You can't do this thing other IDEs do." Is the solution, but I guess that's it.
2023-09-04 11:40 AM
Maybe we can have a real time interface that recive the XPSR using a communication API and than split the values and give as the feedback we want.
I hope this happend soon.
Best regards.
II
2023-09-04 04:48 PM
@IssamosThe real-time interface already exists in the debugger. That's how you get the xPSR register value updated after every instruction step.
All that's needed is the representation in the registers window programmed to show the bitifield as well as the 32-bit number, based on processor type.
I'm amazed Eclipse doesn't already have this in the Registers window, since peripheral registers can split registers up through the SVD file, but it looks like there's no equivalent for CPU registers.