Discussion in "ARM Development" started by    bikashh    Aug 6, 2012.
Mon Aug 06 2012, 06:56 pm
#1
I have written an custom bootloader to receive updated firmware from the server.I don't know where to write this firmware version.so that i can read the firmware version anytime i want.Does anybody has nice scheme for writing firmware version.

thanks in advance
Mon Aug 06 2012, 10:34 pm
#2
I'm sorry but I don't understand the question.

Can you explain a bit more about what you are doing.
Tue Aug 07 2012, 10:37 am
#3
I am not sure if I understand your problem correctly but do you want to store the firmware version of application running on your ARM right now so you can compare firmware version and program if necessary? You can make use of small EEPROM to store FW version. else you need to use some tricky assembly logic or complex compiler directives to store FW version on proper location so that your bootloader can read from same location during FW checking.
Tue Aug 07 2012, 12:33 pm
#4
Yes,you have understood it better.
Actually i have never used compiler directives in my code.can you please give me an example for my controller.
thanks for the reply
Wed Aug 08 2012, 11:00 am
#5
hello friends, yes i got what i was looking for but have one doubt...we can reserve flash address for a variable by using _attributes_(section(.xxx)). But what if i dump the hex code generated to my flash using some utilities at the respective address.will that too be able to store the variable at the decided address.I am using GCC compiler.


thanks
Wed Aug 08 2012, 01:21 pm
#6
Now I am finding it hard to understand this one can you explain a bit more with example?

what if i dump the hex code generated to my flash using some utilities at the respective address.will that too be able to store the variable at the decided address.I am using GCC compiler.

bikashh

Thu Aug 09 2012, 11:01 am
#7
I am using STM32f100xx.
and i am writing a custom bootloader to load my application from server using wifi.
my bootloader address is 0x08000000 and my application address is 0x08009000.
bootloader size is 15KB and application is of 60K

So, i wanted a variable to store the currrent firmware version. which will be common for both bootloader and application.For that i used compiler directives to store reserve a fixed location but it is written at 0x0800FC00 which comes between bootloader code area and application area.
I am able to write a value at fixed location in flash using compiler directive.but my doubt is if suppose instead of compiling all the time for each new hardware. if i dump only the hex image of the bootloader and application at their respective addresses using ST-link utility, will the variable be written in the flash in this way.

thanks.
Sun Aug 12 2012, 12:27 am
#8
0x800FC00 is after 0x8009000 so your fix address is actually inside the application area. You actually have to write at this address in your application code and bootloader will just use it. and it is recommended that application must have this variable as after updating the actual value of that variable will change depending on new version. And once the bootloader and app is compiled the generated hex code will surely have that variable filled with specified value. You can check it yourself in the disassembly of hex code.
Thu Aug 16 2012, 06:39 pm
#9
Is it like if i use any address from inside the application area will not affect the other instruction...or this particular address will be reserved?
And if i choose other address other than the application/boot loader area.this address will not present in the hex file ..am i right?

thanks for the clarification
Tue Aug 21 2012, 02:40 am
#10
when you define a string as a const inside your code it will be stored in the .text area of your binary. hence its a part of hex file. and when you give that const string a defined location then its always going to be stored in same location. in bootloader you will just need a pointer pointing to that location and in application you can define that const string variable. hope you are getting my point.

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

Richardedils
Wed Apr 24 2024, 04:07 am
ChrisLub
Tue Apr 23 2024, 05:21 pm
Davidbab
Tue Apr 23 2024, 10:41 am
Richardrit
Tue Apr 23 2024, 09:54 am
HenryLaf
Mon Apr 22 2024, 03:50 pm
bleradrar
Mon Apr 22 2024, 06:38 am
ppu-pro_ka
Sun Apr 21 2024, 07:39 pm
Infewow
Sun Apr 21 2024, 06:30 pm