WICED Firmware Version

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hi,

We need the WICED Firmware version info so that the user can make the decision if he/she needs to upgrade the firmware. Where or how can I get or put the WICED Firmware version info? Is there version info in the firmware.elf?

Thanks

0 Likes
19 Replies
JaeyoungY_71
Employee
Employee
First comment on KBA 25 solutions authored 10 solutions authored

Hi Feng,

The WLAN firmware version is printed out on the terminal on reset. Future SDKs will have the latest firmware included.

Thanks,

Jaeyoung

firmware_version.PNG

0 Likes
Anonymous
Not applicable

Hi,

I am talking about the WICED firmware (like  snip_scan-ISM43362_M3G_L44.stripped.elf) version info  after make target  "snip.scan-BCM943362WCD4 download run"? Where or how can I get or put the  Firmware version info? Is there version info in the firmware.elf?

Thanks

0 Likes

Hi Tiger,

We have two firmware, a WLAN firmware and also a BLE firmware for the combo chips. Our example apps like snip are not tagged individual versions but follow the WICED SDK (3.1.2). I hope this answers your question.

Thanks,
Jaeyoung

0 Likes
Anonymous
Not applicable

Hi,

We are using SDK 3.1.2 and  want to put the version info to our Wiced application like the example apps so that we can read the version info from APP0 in the multiapp file system in external flash for the purpose of the OTA upgrade. How can we implement this?

Thanks

0 Likes
Anonymous
Not applicable

It's WICED_VERSION.

e.g. printf("%s", WICED_VERSION);

0 Likes
Anonymous
Not applicable

Hi,

I guess this is already answered, but just to clear up, there are two components:

- The WICED SDK version: this is usually obtained from constant WICED_VERSION as already mentioned above. Its printed as the first line in our console output

- The WLAN firmware version: this is embedded inside the firmware and is obtained from the WLAN chip itself once the firmware is downloaded in to it, have a look at:

WICED/wwd/internal/wwd_wifi.c @ function wwd_wifi_get_wifi_version

Hope this answers the question,

Regards,

Bassem

Anonymous
Not applicable

Hi Bassem,

Thanks for your info.

But I am not talking about both WICED SDK version and The WLAN firmware version.


We want to put the application version info to our application.elf after make target. So we can read the version info from APP0 in the multiapp file system in external flash to make a decision if needing to upgrade this application. Is there any version info in application.elf? What is the format of application.elf? How can we implement this?

Tiger

0 Likes
Anonymous
Not applicable

Hi,

The usual way to implement this is to put it as part of the DCT rather than inside the application.

Another way to do this, would be to append a binary blob to your elf file (at the end) with any binary data you want. Hence the boot loader can still read the elf file and  load it to internal flash, and you can still write your stuff add the end. The question would be how would you know where the elf ends and your binary blob starts, I guess you can start from the end of the file, i.e. read the file size, then read the last 4 bytes in the file , those can be the offset of where your data are.

A 3rd solution would be to have a simple elf file reader that can read symbol locations and extract them, store the version as string and read it from your elf file.

I'd still prefer the first solution as its cleaner and easier.

Regards,

Bassem

Anonymous
Not applicable

Hi Bassem,

The first solution(put it as part of the DCT) has an issue. If we download a new app0, we have also to upgrade the version info in the DCT in internal flash.  So we prefer  the second solution(append a binary blob to app0 elf file). How can we use the WICED build system to do this?

Thanks

0 Likes
Anonymous
Not applicable

Of fcousre WICED doesn't support this out of the box (as this is more a system specific problem), your starting point would be in tools/makefiles/wiced_elf.mk this is where the binary application is produced. for example

$(LINK_OUTPUT_FILE) target produces the main elf file and $(STRIPPED_LINK_OUTPUT_FILE) is producing the stripped elf file, within this target target do an append, something like $(QUIET) $(ECHO) WICED_VERSION_$(VERSION) >> $@

Anonymous
Not applicable

Hi Bassem,

Wiced build uses the GNU make? If not, any document for creating Wiced makefile?

Following your email above, there is STRIPPED_LINK_OUTPUT_FILE below  in tools/makefiles/wiced_elf.mk

If I want to append WICED_VERSION_$(VERSION) to STRIPPED_LINK_OUTPUT_FILE, can you show me how to modify this makefile rule/dependency and do this?

VERSION ?= 1.1.1


# Stripped elf file target - Strips the full elf file and outputs to a new .stripped.elf file

$(STRIPPED_LINK_OUTPUT_FILE): $(LINK_OUTPUT_FILE)

  $(QUIET)$(STRIP) -o  $@  $(STRIPFLAGS)  $<

In addition, is there a elf file viewer and editor I can use to append the version info to the app stripped elf file?

Thanks

0 Likes
Anonymous
Not applicable

Hi Bassem,

I add "$(QUIET)$(ECHO) Version_1.1.1>> $@" to following line in tools/makefiles/wiced_elf.mk

#  Stripped elf file target - Strips the full elf file and outputs to a new .stripped.elf file

$(STRIPPED_LINK_OUTPUT_FILE): $(LINK_OUTPUT_FILE)

  $(QUIET)$(STRIP) -o $@ $(STRIPFLAGS) $<

  $(QUIET)$(ECHO) Version_1.1.1>> $@

I can make a new build and generate a stripped.elf file.  From my windows 7  I am looking at the properties for the stripped.elf file and  I get two attributes below, "Size" and "Size on disk", and "Size on disk" is always larger.

Size:                  514 KB (527,199 bytes)

Size on disk:      516 KB (528,384 bytes)

wiced_framework_app_get_size() function can get the  "Size on disk" above, not the "Size" above we need to find the version info. I have already read the correct version info from the offset near the end of "Size:                  514 KB (527,199 bytes)". Can you look into the issue?

In addition, is there a elf file viewer and editor which can be used to append the version info to the app stripped elf file? In this way, no need to change the wiced_elf.mk.


Thanks

0 Likes
Anonymous
Not applicable

Try xvi32 http://www.chmaas.handshake.de/delphi/freeware/xvi32/xvi32.htm

its a hex editor (with ASCI), you should see your string (and hex) at the end of the file.

Anonymous
Not applicable

Hi Bassem,

Thanks for your info. I can use xvi32 to view and edit the app stripped elf file.

But there is still a issue. wiced_framework_app_get_size() function can only get the  "Size on disk(528,384 bytes) " of the app elf file above, not the "Size(527,199 bytes)"  of the elf file  we really need this Size(527,199 bytes) to locate the version info.

Regards,

0 Likes
Anonymous
Not applicable

Hi,

One way to do this is to make sure your file size is equal to your block size (i.e aligned to 4k), so for example

dd if=snip_scan-BCM943362WCD6.stripped.elf of=snip_scan-BCM943362WCD6.4k.elf bs=4096 conv=sync

will align your file size to 4k (filling with zeros), you can then cat the stuff that you want:

echo VERSION 2.2.4 >> snip_scan-BCM943362WCD6.4k.elf

you now know that your last section of the file (last 4 k) will have what ever data you want, you can also put any other data you want. offcourse you are here wasting a bit of space to align the application and then add the data. a more efficient solution would be writing your own tool (or script), to manually check the file size, align to 4k and insert the string in the last x bytes of the file. Again, you now know that the last

Looking at this further, another approach  (hopefully would be easier than all of this), is to put a string in  your application with the WIFI firmware version and put it in a seperate section  then write a function (I have something close) that looks for the section in the file and reads it.

In summary, If you want to attach a lot of information to each application then option 1 would fit more, however if its just this string, then may be option 2 would fit better.

Regards,

Bassem

Anonymous
Not applicable

Hi Bassem,

For the option 1 ,  do I need an unix/linux/cygwin operating system to issue those commands( like dd )?  Those commands can be added to the tools/makefiles/wiced_elf.mk?

For option 2, how to put a version string to a separate section? using commands in unix/linux/cygwin or makefile? how to write a function that looks for the section in the elf file and read it?

In addition, is it possible to write a function to get the actual size of the app elf file instead of getting the size on disk using wiced_framework_app_get_size()?

Thanks in advance

0 Likes
Anonymous
Not applicable

Hi,

A lot of those questions are system questions related to your system or more generic programming rather than WICED. I can only help with WICED stuff.

few answers though:

you do need a shell, ( can be unix, linux, cygwin or mingW) to run dd and other commands (its your system, you pick one)

use linker scripts to put variables (or functions) in sections, have a look at gnu linker scripts to see how to do this.

our linker scripts (for stm32f4xx MCUs) are in:

WICED/platform/MCU/stm32f4xx/GCC

for reading symbols from elf files:

ELF Tutorial - OSDev Wiki

up to my knowledge getting the size of an elf file is not possible from within the elf file.

Regards,

Bassem

Anonymous
Not applicable

Hi Bassem,

Thanks for your support.

I am thinking the simplest way for the software version info. Can I put the software version string(for example, fixed 8 bytes) to the beginning of the app stripped elf and skip the first 8 bytes when loading the app stripped elf file to the MCU internal flash memory? If yes, now the question is which loading functions  I need modify to skip the first fixed 8 bytes?


Regards,

0 Likes
Anonymous
Not applicable

Hi,

The main function that you wanna look at it: wiced_waf_app_load, in WICED/platform/MCU/wiced_waf_common.c. Note that once you do that your elf  is not standard compliant any more and that every time you do WICED version upgrade you have to change this code again.

before you do this, have a look at this post:

https://sourceware.org/ml/binutils/2008-06/msg00216.html

and see if this helps, looking up a section is a simple for loop.

Regards,

Bassem