STM32 FLASH Programming || SECTOR TYPE || M4, M7

preview_player
Показать описание
________________________________________________________________________________________

The code is updated, and now you can Store the numbers and floats in the FLASH memory.

I have made a lot of changes in the code, so it will not look familiar to what's shown in the video. You just follow the process. Include the files, and program a memory location.

________________________________________________________________________________________

******* SUPPORT US BY DONATING******

*******Join the Membership*******

Рекомендации по теме
Комментарии
Автор

Thank you so much, most of my knowledge about embedded programming is learned from you

thinhnguyentan
Автор

you are the best. I find every problem from your channel thanks a lot .

elmir_rr
Автор

How do I determine where to write? When writing to the Flash, I need to provide a valid address. However, I noticed that many things already go into the flash memory, including the compiled code, the code as text (I think this is only in debug; please confirm), and many other things. How can I reliably define addresses to read and write into the flash memory that won't conflict with areas already in use?

eduardojreis
Автор

Sir how can I store a float number to flash and reuse it

thangnguyenduc
Автор

I like your layout. What Linux distro is that?

DudeABepper
Автор

Hi,
i am using stm32H753 it has 2 memory banks BANK1 & BANK2 with 7 sectors each, and its a cortex-m7 controller,
i tried to use our program.it is not working

manjunathks
Автор

after program.. error occured fail to execute mi command

ravigautam
Автор

Hi, I want to know about bad block management in stm32. Please give me any guidance. Actually i dont know how did i find which stm32-mcu supports badblock management.

greeniot
Автор

I'm using the dual-core STM32h7.. so to prevent the compiler / programmer from using or erasing the intended user data sector, I modified the M7's STM32H745XIHX_FLASH.ld linker script:

MEMORY
{
FLASH (rx) : ORIGIN = LENGTH = 1920K /* Fifteen 128KB Sectors */
USER_FLASH(rx) : ORIGIN = 0x081E0000, LENGTH = 128K /* Last sector */
RAM (xrw) : ORIGIN = LENGTH = 128K
RAM_D2 (xrw) : ORIGIN = LENGTH = 128K
RAM_D3 (xrw) : ORIGIN = LENGTH = 64K
ITCMRAM (xrw) : ORIGIN = LENGTH = 64K
}


Hopefully, the bootloader or st-link won't erase the USER_FLASH sector! But what should I do about the M7's OTHER lilnker script : STM32H745XIHX_RAM.ld ? Or that of the M4's Linker scripts?

// Erase
HAL_FLASH_Unlock();

uint32_t SECTORError = 0;
FLASH_EraseInitTypeDef EraseInitStruct = {0};

EraseInitStruct.TypeErase = FLASH_TYPEERASE_SECTORS;
EraseInitStruct.VoltageRange = FLASH_VOLTAGE_RANGE_3;
EraseInitStruct.Banks = FLASH_BANK_2;
EraseInitStruct.Sector = FLASH_SECTOR_7;
EraseInitStruct.NbSectors = 1;
HAL_FLASHEx_Erase(&EraseInitStruct, &SECTORError);
HAL_FLASH_Lock();

// The Stm32H7 has *ONLY* 32-byte flash words??

HAL_FLASH_Unlock();

HAL_FLASH_Program(FLASH_TYPEPROGRAM_FLASHWORD, 0x081E0000 + (32*flash_word), source_32byte_buffer);
HAL_FLASH_Lock();

bennguyen
Автор

Hello
I wanted to display flash and ram like build analyzer, How can i do? If you know anything, could you help me?

anirudhpattar
Автор

Would love if this had a proper voiceover.

James-iwpr
Автор

I am using several parameters in a row stored in flash memory. If I want to change only one parameter, should I read them first, then change a member of the structure-union, the next to erase the sector and write back?

nicolasedome
Автор

Out of curiosity, why are you using the external clock? Any particular reason beside a faster clock frequency than the HSI RC?

frandumont
Автор

Hi - thanks for your really helpful videos and tutorials. I've found a problem when using the ST-Link debugger with a Nucleo-F767ZI board. If I step through the Flash_Write_Data function, it all works OK. However, when I disconnect the debugger, then attempt to download and debug again, ST-Link reports that the target is still running, and the download failed. This is persistent, even if I power-cycle the Nucleo board. However, if I don't step through the code, but just set a breakpoint on the function return, it all works fine. Any ideas what may be causing this? Thanks!

peterhall
Автор

STM32F767ZI has two bank configuration mode of internal flash such as single bank mode and dual bank mode which cause changing sector numbers. Which one of these modes is it being used in the code? Should I be carefull with these modes while I programming the flash by using this source code?

burakagca
Автор

hello, how can I write a double variable to flash memory? Do you know a source about this? I am using the STM32F407VG DISC-1 development board.

ayhannkaraca
Автор

Hi, i need to use flash programming in my project but there is a problem. I have to save DHT sensor data in flash memory. The values are float, so i could not find a way to convert them to unint32_t. Is there a method you would like to help? Thank you...

emrebas
Автор

After trying out this code:

HAL_StatusTypeDef res;
res = HAL_FLASH_Unlock();

FLASH_EraseInitTypeDef EraseInitStruct;
EraseInitStruct.TypeErase = FLASH_TYPEERASE_SECTORS;
EraseInitStruct.VoltageRange = FLASH_VOLTAGE_RANGE_3;
EraseInitStruct.Sector = 7;
EraseInitStruct.NbSectors = 1;

uint32_t error;
uint32_t _res;
if (HAL_FLASHEx_Erase(&EraseInitStruct, &error) != HAL_OK)
{
_res = HAL_FLASH_GetError ();
}

res = HAL_FLASH_Lock();

I can not connect to the debugger anymore...
Can I recover the board or is it forever lost?

casualnoises
Автор

Hi, i have been doing a project on touchgfx and cubeide to save the data. Entered text on my screen, i want to keep it in flash memory. How can i do? If you know anything, could you help me? Thanks :)

betulguncaldi
Автор

thaere are 2 errors one is data with incorrect pointer type and the 2 is DATA_32 with same error

my_google_arifkhan