My Vcc-gnd.com STM32F407VET6 Mini issues

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

User avatar
russian
Posts: 368
Joined: Mon Oct 29, 2012 3:17 am
Has thanked: 16 times
Been thanked: 14 times

My Vcc-gnd.com STM32F407VET6 Mini issues

Post by russian »

I've got myself a couple of Vcc-gnd.com STM32F407VET6 Mini boards like https://wiki.stm32duino.com/index.php?t ... 7VET6_Mini and I have two problems with them - so far I am unable to get my code to start on these.

(Boards are happy to blink user LED with default firmware so they seem to be alive)

1) these boards use 25MHz osc, which *conf.h values should I change from my usual 8MHz settings? So far I've changed STM32_PLLM_VALUE and STM32_RTCPRE_VALUE from 8 to 25. Are there any more values I would need to change from my typical stm32f4discovery settings?

2) [not ChibioOS problem at all] ST-Link/SWD flashing/debug is not working unless I toggle BOOT0. So far on my other boards ST-Link/SWD is never asking for BOOT0, why does this board not work without BOOT0? I believe this stands in the way of me being able to debug my firmware.

I am able to flash with BOOT0=VCC via USB in DFU mode.
User avatar
russian
Posts: 368
Joined: Mon Oct 29, 2012 3:17 am
Has thanked: 16 times
Been thanked: 14 times

Re: My Vcc-gnd.com STM32F407VET6 Mini issues

Post by russian »

Board schematics is available at https://wiki.stm32duino.com/images/6/69 ... ematic.pdf - it shows R5 R6 BOOT* pull-downs
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: My Vcc-gnd.com STM32F407VET6 Mini issues

Post by Giovanni »

Hi,

Clock setting looks right, you should verify GPIO settings in board.h, especially those GPIOs used for JTAG/SWD.

Giovanni
User avatar
RoccoMarco
Posts: 655
Joined: Wed Apr 24, 2013 4:11 pm
Has thanked: 83 times
Been thanked: 67 times

Re: My Vcc-gnd.com STM32F407VET6 Mini issues

Post by RoccoMarco »

Configure properly boot pin to boot from flash. It should be boot 0 to gnd but to be sure make some comparisons with F407 DISCOVERY schematic
User avatar
alex31
Posts: 445
Joined: Fri May 25, 2012 10:23 am
Has thanked: 57 times
Been thanked: 88 times

Re: My Vcc-gnd.com STM32F407VET6 Mini issues

Post by alex31 »

Hi,

[1) these boards use 25MHz osc, which *conf.h values should I change from my usual 8MHz settings? So far I've changed STM32_PLLM_VALUE and STM32_RTCPRE_VALUE from 8 to 25. Are there any more values I would need to change from my typical stm32f4discovery settings?


You should probably define STM32_HSECLK to 25000000 in board.h

IMHO, it's a good habit to launch STM32Cubemx, you select the exact processor you use, and do the pin affactation, and clock configuration with this tool. It's easy after to match the values to the chibios *conf.h files.

Let us know if you succeed running chibios on theses boards.

Alexandre
User avatar
russian
Posts: 368
Joined: Mon Oct 29, 2012 3:17 am
Has thanked: 16 times
Been thanked: 14 times

Re: My Vcc-gnd.com STM32F407VET6 Mini issues

Post by russian »

alex31 wrote:You should probably define STM32_HSECLK to 25000000 in board.h


STM32_HSECLK=25000000U
STM32_PLLM_VALUE=25
STM32_RTCPRE_VALUE=25

Still no luck.

Another weird fact that I get readout protection warning only while programming my firmware into this board.

Another weird fact is that behavior is different between my master branch which is still ChibiOS17 and my ChibiOS18 migration branch - on ChibiOS18 at least I get the user LED half-on (expected to blink at 1Hz maybe time to plug in logic analyzer see if it blinks at a very different speed). Too many weird things about this board while discovery and black large 8MHz osc board just work as is.
Attachments
unexpected_read_out.png
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: My Vcc-gnd.com STM32F407VET6 Mini issues

Post by Giovanni »

Try to run from internal oscillator, this will tell you if it is clock related.

Giovanni
User avatar
russian
Posts: 368
Joined: Mon Oct 29, 2012 3:17 am
Has thanked: 16 times
Been thanked: 14 times

Re: My Vcc-gnd.com STM32F407VET6 Mini issues

Post by russian »

Minor update: we are trying to get trivial LED blinking code to work BEFORE halInit(); and this did NOT work until we've replaced crt0_v7m.S with a more plain https://raw.githubusercontent.com/progr ... tm32f4xx.s

Will solder the pin so that I can hook logic analyzer tomorrow.

See https://github.com/rusefi/rusefi/pull/686/files
User avatar
RoccoMarco
Posts: 655
Joined: Wed Apr 24, 2013 4:11 pm
Has thanked: 83 times
Been thanked: 67 times

Re: My Vcc-gnd.com STM32F407VET6 Mini issues

Post by RoccoMarco »

Can you share the whole mcuconf.h?
User avatar
russian
Posts: 368
Joined: Mon Oct 29, 2012 3:17 am
Has thanked: 16 times
Been thanked: 14 times

Re: My Vcc-gnd.com STM32F407VET6 Mini issues

Post by russian »

Something is weird with this board.

On the one hand I got it working couple of times with https://github.com/rusefi/rusefi
https://github.com/rusefi/rusefi/blob/m ... 6_Mini.bat parameters https://github.com/rusefi/rusefi/tree/m ... stm32f4ems configs

I definitely had both LED blinking and USB serial working at some point. Not I have a funny state: if I flash using 4 wires SWD I have my LED blink definitely at expected frequency. I also get USB working if I plug micro USB cable.

BUT the moment I hit "reset" button I get no blinking LED and no USB? WAT? How is my firmware only works once after SWD programming and never later?

This is unusual, very different from what I get on discovery or only own brain boards https://github.com/rusefi/rusefi/tree/m ... rain_board
Post Reply