cancel
Showing results for 
Search instead for 
Did you mean: 

Hal vs Cmsis drivers (firmware,bootloader,flashmemory)

pm_brk_pm
Associate II
Posted on August 31, 2016 at 09:29

Hello everyone,

First of all I would like to specify that I am working on a embedded project.Nowadays I am trying to write firmware operation for stm32 bit arm processor named as stm32f103c8t6.

I want to add a new feature to the project to be programmed remotely.For this process, I am using an external eeprom to store recieved data from gps module and Flash memory operation.

The idea is; 

The recieved main program data(firmware) from FTP server will be stored in external eeprom and then Microcontroller will overwrite this data in the flash memory .Thus, Bootloader will start new firmware after reset and identify it as a new software for the future applications.It is basically ''update'' operation for microcontroller.

So, In this case I already wrote flash memory(send and recieve data with initialization) and eeprom(send and recieve) codes.

In the last part,  Flash memory data should be loaded with bootloader.

I follow this tutorial to arrange specifications of microcontroller(remapping vector table,ram memory, bootloader data size...)

http://marcelojo.org/marcelojoeng/2015/09/bootloader-on-stm32f0.html

(I am using Keil for programming in C/C++)

My first problem is;

I hadn't create system program with hal drivers, Therefore I am not able to use these codes based on CMSIS drivers for Bootloader which is available in above tutorial.

Briefly, I can not use related Real time clock control(Rcc) codes with Cmsis drivers;

__HAL_RCC_AHB_FORCE_RESET

(

)

;

    

//  Enable SYSCFG peripheral clock

    

__HAL_RCC_SYSCFG_CLK_ENABLE

(

)

;

    

__HAL_RCC_AHB_RELEASE_RESET

(

)

;

    

// Remap RAM into 0x0000 0000

    

__HAL_SYSCFG_REMAPMEMORY_SRAM

(

)

;

Is there anyway to identify same operation codes with Cmsis Rcc library? and could you please inform me what are these codes in CMSIS based.

Second problem is;

I am using arm compiler mode instead of Gnu gcc compiler.Therefore I can not create any linker file to arrange memories for this project.It only supports scatter file.

But I have no idea how to construct it according to giving tutorial which is available above.

Could you please help me under these conditions(including scatter file).

Any help will be apreciated.

Thank you by now.

#flash-memory #bootloader #bootloader-firmware-upgrade
23 REPLIES 23
christoph2399
Associate II
Posted on September 05, 2016 at 08:22

you have to keep 2 importend things in mind:

1. you will always start in user-flash memory so in your personal bootloader

2. you can not store/save the application's start-address for the next boot. you always have to do the ''jump'' from your-bootloader into your applications-reset handler by hand  (see 1.)

Posted on August 23, 2017 at 09:24

Hi,

In your bootloader how to check the flash?

Thanks

K.Manikandan

Posted on August 23, 2017 at 09:30

Hi,

Pls explain how to check whether flash data is completed or not,

Posted on August 23, 2017 at 09:42

After DFU mode  ie., internal booloader how i jump out from bootloader and start main application program.