You are here

vesc on stm32_discovery not saving motor/app configs in non volatile memory

2 posts / 0 new
Last post
Teslafly
Offline
Last seen: 1 year 5 days ago
Joined: 2017-09-21 08:55
Posts: 17
vesc on stm32_discovery not saving motor/app configs in non volatile memory

I have attached a generic powerstage to an stm32f407 discovery board, and have gotten it working on the motor drive part.

 

However, for some reason when I change and upload a non-default motor/app configuration, it will reset to default upon power cycling/resetting the board.

If I do not reset the board, vesc tool will read out the correct value I wrote. bit hte value resets to default as soon as a reset occurs.

I have tried in 2 discovery boards. one with the stlink removed.

The firmware and bootloader upload from vesc tool works fine. So the mcu can write to it's own flash.

I have tried the default vesc6_mk3 firmware from a completely cleared board and it still won't save the values.

The same firmware uploaded to a stm32f405 works fine.

 

Is there some difference between the stm32f405 and 407 I am missing for flash modification? The whole vesc project seems to be built for the 407 and just only uses the pins of the 405 so I don't see what the problem could be?

imbizo
Offline
Last seen: 3 years 5 months ago
Joined: 2020-10-14 17:29
Posts: 1

Got same problem with saving configs to eeprom on STM32F429 DIscovery board with firmware 5.1.

Fixed by disabling voltage checking into EE_WriteVariable function from eeprom.c file

Just remove this code:

    /* Return error if MCU VDD is below 2.9V */
    if (PWR->CSR & PWR_CSR_PVDO)
    {
        Status = FLASH_ERROR_PROGRAM;
    }
    else