My first adventure with CMSIS on an $11@1ea ARM Cortex M4 chip is...
The printf() in the code says 960,000 calls per HALF-second.
EDIT: Optimized clock dividers. The above changed to 1.5M calls per half-second (153MHz core clock now).
First cut. I haven't checked if the clock dividers, etc., are optimally fast. I think I'm getting 96MHz core clock (of 168MHz max spec).
I like how clean and well documented (A++) CMSIS and the HAL are.
I'm more focused on assessing the M4 and CMSIS/HAL than on ARM vendor names, at the moment. E.g., UART, SPI, ADCs all have DMA options in the HAL drivers.
EDIT: enclosed: Screen grab from logic analyzer showing UART output.
Code:
// called by main()
void myTest1(void) {
static uint32_t calls;
++calls;
HAL_GPIO_TogglePin(GPIOC, GPIO_PIN_13); // toggle LED fast (MHz)
if ((HAL_GetTick() & 511) == 511) { // every half second
HAL_GPIO_TogglePin(GPIOC, GPIO_PIN_12); // toggle LED twice a second
printf("%d ticks. Hello World. pass:%d\n", HAL_GetTick(), calls);
calls = 0;
while ((HAL_GetTick() & 511) == 511)
; //waste part of a mSec until next tick
}
}
The printf() in the code says 960,000 calls per HALF-second.
EDIT: Optimized clock dividers. The above changed to 1.5M calls per half-second (153MHz core clock now).
First cut. I haven't checked if the clock dividers, etc., are optimally fast. I think I'm getting 96MHz core clock (of 168MHz max spec).
I like how clean and well documented (A++) CMSIS and the HAL are.
I'm more focused on assessing the M4 and CMSIS/HAL than on ARM vendor names, at the moment. E.g., UART, SPI, ADCs all have DMA options in the HAL drivers.
EDIT: enclosed: Screen grab from logic analyzer showing UART output.
Last edited: