0
votes

I'm trying to temporarily mask all interrupts of a Cortex-M3, with only having access to the debug port. I can read and write the memory freely, which so far has been sufficient for accessing processor registers.

My best bet so far was writing 1 to one of the core registers (either PRIMASK or FAULTMASK), and disabling all interrupts that way. The problem is, I can't seem to access them. According to the ARM infocenter, I can use the DCRSR to select core registers, and then read/write them via the DCRDR. However, the infocenter page seems to imply, that there is no way to access the interrupt mask registers (PRIMASK, FAULTMASK and BASEPRI).

I did find a different source, namely the Definitive Guide to the ARM Cortex-M3, which shows on page 244, that the DCRSR can indeed be used to access the special registers, by writing 0b10100 to it. I tried that too, and the value I read from the DCRDR afterwards seemed nothing like what you would expect from the special registers (reserved values were set to 1s or 0s randomly, the first bit of FAULTMASK was 1, yet interrupts seemed to work fine). I still tried setting the first bit of the supposed PRIMASK to 1, in hopes of disabling the interrupts, but to no avail. It seems that the infocenter was right, and the DCRSR can NOT be used to access all special registers.

My question is, what other way is there, to access the interrupt mask registers from the debug port? Is there a direct memory address at which they are stored, or some different register that provides access to them?

Any help is greatly appreciated.

1
define "debug port"...old_timer
The debug port is the part of the processor, through which debug devices can connect to it, and access various functionalities. Here, it is a CoreSight Debug port (in accordance with this specification: static.docs.arm.com/ihi0031/c/IHI0031C_debug_interface_as.pdf ) In my case, there is no specific debugger device, only an FTDI chip, which translates from USB to JTAG. I'm sending direct JTAG signals to the debug pins of the processor, so I can only perform operations through the debug port.Muller
You are talking about the SWD interface then? Obviously you can get to whatever the core can get to. You have to stop the core to do that though if that is okay, which at that point you can load and run a short burst of code as needed if that is required (to disable the interrupt enable bit for the core).old_timer
I'm accessing the debug port via JTAG, but I guess in this case, it doesn't make much of a difference. It could just as well be SWD. I only need to disable the interrupts for a short time, and what I'm currently doing, is exactly what you propose. I halt the core entirely, then perform the critical operation, and finally resume the core. I was looking for a way to do this without halting the core, as I only need the interrupts to be disabled for a short period.Muller

1 Answers

0
votes

May be to add a litte helper to the app code, wich polls a RAM cell and acesses the special register for you in dependence of the RAM cell contence?