cancel
Showing results for 
Search instead for 
Did you mean: 

Flashing a HEX file in STM32F4

SGasp.1
Senior

Hi forum..

I developed a bootloader for flashing a hex file present in usb key.

The text from the usb key is transferred via UART to another micro..

The bytes are then flashedin the flash area..

You can find the HEX file in the usb key here ..

When I flash the bytes witj HAL inside the flash memory region I start from the second file of the txt file...

When I finish to write all the file except first line and last line I compare with stm32cube programmer the hex file and the memory region and they are the same..

But when I reboot the application doesnt' start ..

Which is the issue ??

Thanks a lot

Simone

5 REPLIES 5
TDK
Guru

If you flash it with STM32CubeProgrammer instead, does it start?

If you feel a post has answered your question, please click "Accept as Solution".

>>Which is the issue ??

Stops in a debugger and looks..

It a guess, stuff like the BOOT0 pin was wrong, the SCB->VTOR was wrong, random interrupts, some hard fault, or disabled all interrupts in the processor.

Perhaps instrument things like HardFault_Handler() and Error_Handler() to output actionable information, use GPIO or USART to identify where in your code it did manage to get to, or get stuck in.

#HowManyWentToStIves

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Hi TDK...

Usually i flash a file which is made with bootloader + FE2040 HEX file..

If i flash this file it is working and from the bootloader I am able to jump in the application FE2040..

But now that I try only flashing the FE2040 file it is not working... it is strange because it is coming from the stm32cudeide enviroment..

I made a test... If I start the application FE2040 from the stm32cubeide it is starting running and working..

If I try to flash the hex file with the stm32cubeprogrammer it is not working.. very strange

I am not sure how to interpret that.

I am trying to determine if your flasher is working correctly. If STM32CubeProgrammer produces the same result as your flasher, you can be confident it is working correctly. And if the flash memory is the same in both cases, the program behavior will be the same in both cases, provided you are not running things differently.

> If I try to flash the hex file with the stm32cubeprogrammer it is not working

Then the program is with your program, not the flasher.

If you feel a post has answered your question, please click "Accept as Solution".