Odd dependency between GPIO and DMTIMER

I’ve been doing some bare-metal assembly programming, and have been bashing my head for a few days trying to figure out why this happens.

Writing to one device seems to prevent me from writing to another for some time. I noticed while trying to use the timer and gpio in the same program.

Attached is some example code (as simplified as I could make it) that fails to turn on USR0 when there shouldn’t be a problem.

However, if you put the instruction that turns on USR0 before the instruction that stores the counter, the light works (and the counter does not).

This is not a huge deal as the problem only exits with Timers 0 and 1, but it bothers me that I can’t figure out why. I’ve spent hours looking at
the manuals for the processor and architecture, but I don’t know what could be causing this.

Has anyone seen this before or have suggestions what it could be?

timer.s (380 Bytes)

After spending a few more days on the issue, the problem is not what I thought.

The problem was my misunderstanding of the manual about how timers need to be enabled.

I was thrown off track because Timer 2 worked, but this was because U-Boot enables it before I launch my own program.