Mikro2 Clicker 2 (F407 based) - UART clock issue #6827
Unanswered
espruino-discuss
asked this question in
Porting to new Devices
Replies: 1 comment
-
Posted at 2018-10-22 by @gfwilliams I'd have said changing You could have a play with http://www.espruino.com/Reference#l_E_setClock - it'll allow you to play with prescalers on the fly so at least you can test and see if it's doing the right thing |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2018-10-22 by benoit
Hi,
I have a strange bug when I compile Espruino for the Mikro2 clicker 2 (see here for more information about this board). It is based on the STM32F407VGT6, the same MCU that is on the F4discovery board. Thus I started with the STM32F4DISCOVERY.py file to modify the pin names, and I change the prescalers in the system_stm32f4xx.c file located in targetlibs/stm32f4/lib, because the quartz on the mikro2 board is a 25 MHz quartz (it's a 8MHz quartz on the F4DISCO board).
Everything compiles well and I'm indeed able to run Espruino on the clicker2 board through the USB port. My problem appears when I try to connect a UART module: the effective baud rate I get is not the one I set, it is multipled by a factor 3.125 ?!? So I have to set the baudrate to 18432 to have it at 57600.
Knowing that 3.125 = 25/8, I guess this issue is related to the fact that there is an "8" MHz lost somewhere in the Espruino files to compile.
My question is then: is there another file where I have to change the quartz frequency, in addition to the system_stm32f4xx.c file ?
Thanks for your help :)
Beta Was this translation helpful? Give feedback.
All reactions