I have just started working on the basic structure of a new project using the STM32 Cortex processor. For now I am using the Keil simulator because I don’t have working hardware yet.
I am having trouble modifying the PRIGROUP field, in fact any field, of the application interrupt and reset control register.
1) I have written 0xFA05 to the Vectkey register. 2) Done a system service call and tried writing to this register during handling. I am not entirely clear on what registers are privileged yet. It’s a very big manual and I have not read the entire thing.
The result is nothing happens on the simulators peripheral outputs.
I have written my own library files but have found the registers Vector Table Offset register and System Control register (registers before and after) work. I am confident my addressing of the Application Interrupt and Reset Control Register is correct.
Have I forgotten to do something, or is there perhaps something wrong with the simulator?
Have you tried
#define AIRCR (*((volatile unsigned long *)0xE000ED0C)) #define VECTKEY 0x05FA0000 int main (void) { AIRCR = VECTKEY | (1 << 8); while (1); }
which should set the PRIGROUP to value 1 ?
Yes this worked perfectly. You need to send the key at the same time as the "instruction", my library did not cater for this. I have sorted this out as well.
Thanks for the help.