2015-04-16 05:46 AM
Hi, I'm using an stm32f072 part, trying to toggle 8 GPIO pins with DMA from memory.
The DMA is plugged to a Timer (2) update event which has 48MHz using HSI48 (no crystal for now). I have two issues currently : - HSI48 seems to take a long time starting (well, registers say it starts quite fast but if I don't want a fault on GPIO setup I need to setup an empty loop (like for (volatile i=0;i<1000;i++); ) . Is this expected or is there an issue ? For space reasons I'm using CMSIS directly. But this one is not blocking. - I achieve to output around 8MHz toggle speed (not exact value), but if I reduce the ARR value of Timer2, the GPIO toggle speed don't seem to be less than that. Is it actually possible to toggle GPIOs with DMA faster than that ? Would 12MHz be possible (chip main clock is 48MHz) ? Is there something to be wary of (using HSI, HSE ; different DMA event ... ) ? I can post the init code (CMSIS) if needed. thanks a lot for your help, I tried to scout google and rereading the refman with no luck. Any ideas ? #gpio #dma #stm32f02015-04-17 06:16 AM
But as I recall the F1 series had the GPIO's attached to the APB, not the AHB. An the flash slows execution speed.
I'm not sure banging a GPIO up and down in a pipelined processor, with write buffers, and disparate bus speeds to be an effective test of processor performance. Putting patterns on a bus would at 10's of MHz would seem like a job better suited to programmable logic, or state machines wired to ROMs. At some point you're going to hit a bandwidth wall, half your cycles reading, half writing, and your processor stalled out.