Main Site Documentation

Clicker 2 - MikroElectronika - TinyCLR OS - CERB difference


i have some questions

why cerb have (STM32F405RTG6 - 168 Mhz - if i’m not wrong)

#define STM32F4_SYSTEM_CLOCK_HZ 168000000
#define STM32F4_AHB_CLOCK_HZ 168000000
#define STM32F4_APB1_CLOCK_HZ 42000000
#define STM32F4_APB2_CLOCK_HZ 84000000
#define STM32F4_EXT_CRYSTAL_CLOCK_HZ 12000000
#define STM32F4_SUPPLY_VOLTAGE_MV 3300

and clicker 2 board have this (STM32F407VGT6 - is 168 MHZ)

#define STM32F4_SYSTEM_CLOCK_HZ 84000000 /* (did this should be 168000000) /
#define STM32F4_AHB_CLOCK_HZ 84000000 /
(did this should be 168000000) */
#define STM32F4_APB1_CLOCK_HZ 42000000
#define STM32F4_APB2_CLOCK_HZ 84000000
#define STM32F4_EXT_CRYSTAL_CLOCK_HZ 25000000
#define STM32F4_SUPPLY_VOLTAGE_MV 3300


@valon_hoti_gmail_com, yes STM32F407 support 168Mhz internal clock with 25Mhz quartz. APB1 and APB2 need to be /4 and /2 accordingly.


same situation is also with board CLICKER (STM32F415 it is also 168 instead 84 system clock)

on the source so for that i asked why it used 84 instead 168 (or seems it was derived from G30 and never changed more)


I use MINI-M4 (stm32f415 and 16mhz quartz) at 168Mhz with no problem, setting correct params in device.h.


i own today two boards and


did you uploaded throught mikroebootloader
or just uploaded through ST-Link programmer


I have used both ST-Link and Mikroe bootloader without any issue. The bootloader is a bit tricky due to double reset of the USB port after few second of timeout.

PS: The guys at Mikroe doesn’t expose BOOT0 pin free & accessible in any of their boards… damned!


exact this is a reason because of missing Boot0 pin

please can you describe steps how you used Mikroe bootloader
(and did i need also to modify device.h or scater file for start of the hex file)


@valon_hoti_gmail_com, do you own a brand new board? If so, the bootloader is just flashed on board, download from mikroe site:
The zip file contains firmware and HID boot manager.

In case your board is completely erased then you need a ST-link like programmer and connect SWC/SWD/GND (PA14-PA13) pin to the MINI-M4
Note: The mikroe bootloader sits in the topmost sector of the F4. So don’t expose the sector to tinyclr via DEPLOYMENT sector. I need to check the address, now I’m out of office sorry.


yes i owned new ones today, thanx a lot for faster response ,

so i’m waiting for sector address ,when you have time so thanx a lot.


To your original question, you had the right idea. The third party boards we added ourselves were based off of the G30 or another device and only gotten to a point where they function. They were not optimized after the fact. As you discovered, clock rate is one of those areas and there’s certainly more that they can take advantage of. We’ll happily take a PR that further aligns a board’s Device.h with what it can fully support.


thanx a lot for answer

because i think you are dropped clock speed for any reason so that make me confused and open this question on the forum.


Anyway, is not difficult to update device.h for MINI-M4.
You need to set:

#define STM32F4_SYSTEM_CLOCK_HZ 168000000 // 84000000
#define STM32F4_AHB_CLOCK_HZ 168000000 //84000000
#define STM32F4_APB1_CLOCK_HZ 42000000
#define STM32F4_APB2_CLOCK_HZ 84000000
#define STM32F4_EXT_CRYSTAL_CLOCK_HZ 16000000
#define STM32F4_SUPPLY_VOLTAGE_MV 3300 

For the peripherals pins check on datasheet for STM32F415xx. I remember USART1 and USART3.

#define DEPLOYMENT_SECTORS { { 0x06, 0x08040000, 0x00020000 }, \
							 { 0x07, 0x08060000, 0x00020000 }, \
							 { 0x08, 0x08080000, 0x00020000 }, \
							 { 0x09, 0x080A0000, 0x00020000 }, \
							 { 0x0A, 0x080C0000, 0x00020000 }, \
							 { 0x0B, 0x080E0000, 0x00020000 } }

NOTE: Mikroe Bootloader is located in sector 0XB, at the very end of flash and it is very tiny. Eventually leave out sector 0XB



used MINI-M4 with CLICKER source

just copied/edited CLICKER source (as Mini M4) and did some modification on Device.h
only (since CLICKER is STM32F415) to meet requirements for MINI M4

compiled HEX uploaded with MikroElektronika bootloader

and worked well and perfekt with TinyCLR 0.12.0