b .+2 B is Branch instruction but I don not understant what is .+2 and how many cycle use this instruciton. I was looking for a book, but we can not tell anything nicely, you can recommend something
I think it's a compiler error ,Apple would say the property :-)
A compiler error is maybe not the best error message available, but if you choose not to give the compiler source code it understands, you really should expect problems.
I've given you not one, but two examples of how to enter your code. I see the branch appear perfectly well, but if you have problems with the branch you could simply replace it with multiple nop instructions.
test 0x000000d4: bf00 .. NOP 0x000000d6: bf00 .. NOP 0x000000d8: bf00 .. NOP 0x000000da: e7ff .. B
Before progressing, you should maybe think about what you're really trying to achieve. I would think working code and avoiding compiler errors would be quite a high priority, no?
Still sounds like some half-assed tuned loop for the output of GPIO "at some specific rate" where the model is to drive the processor into saturation. Something better addressed with a periodic timer and DMA, and a buffer large enough to decimate interrupt loading, so you can fill the buffer with new data while keeping it from being unduly massive.
Is this something that can be solved with a CPLD rather than grinding a 72 MHz Cortex-M3 ?
The compiler is not the place to write fine tuned assembler.
Agreed. Delays like this could (occasionally) be justified in the past on something like an 8051 with highly predictable instruction timing, but a Cortex, nah.