cancel
Showing results for 
Search instead for 
Did you mean: 

Wi-Fi Combo

Anonymous
Not applicable

Hi All,

If our app is in internal flash (ex. STM32F4xx ) instead of external flash does OTA still works ?

I have this question because OTA use wiced_framework_app_write_chunk() but under the API it seems only apply to sflash calls (external flash). So I don't know how it works to internal flash write.

If I'm wrong on this please correct me.

0 Likes
1 Solution
Anonymous
Not applicable

I think jone's reply is clear.

There are several platforms:

A. With external flash only, larger RAM (439x,4390x)

B. With internal flash and external flash, smaller RAM (some STM32 platform)

C. Internal flash only, no external flash.

For C, OTA is not supported.

For A. Bootloader load OTA App from external flash into RAM and run.

For B. Bootloader copy OTA App from external flash, overwrite internal flash App and boot from internal flash.

Need to highlight OTA on 3.5.2 for platform B is broken due to this issue:

Possible 3.5.2 bug in wiced_framework_set_boot()

So if you are on 3.5.2 and platform B. be aware of that.

BTW currently there is no OTA2 implementation for platform B on 3.5.2 as I know.

View solution in original post

25 Replies
Anonymous
Not applicable

OTA uses external flash.

Please see <WICED-SDK>/doc/WICED-OTA2.pdf.

0 Likes
MichaelF_56
Moderator
Moderator

There is also a document here which shows how memory is partitioned to support OTA.

WICED Application Framework Overview

Some of the material is dated now that there are newer chips like the 4390/4390X circulating which has far more onboard RAM, but for the most part, it is correct.

0 Likes
Anonymous
Not applicable

I don't get it.

My understanding is the OTA App will write new firmware over exisiting

production app. The production app (app0) on BCM4343W is located

in internal flash. Do you mean this is not supported?

MichaelF_56
Moderator
Moderator

The production app in Flash will be overwritten.

The OTA app is copied to and runs from MCU RAM during the OTA upgrade process.

Per the reference document linked to above:

  • OTA Upgrade initiated by an API call from the Production App
  • Device reboots, Bootloader copies OTA App into MCU RAM
  • OTA App runs from RAM, starts Wi-Fi AP and webserver
  • Wi-Fi Client connects and browses to the upgrade webpage
  • OTA App writes new firmware over existing Production App
  • Device reboots, Bootloader verifies New Production Firmware
    • If the image is corrupt, Factory Reset occurs as a failsafe
0 Likes
Anonymous
Not applicable

Hi mwf_mmfae,

My understanding is that Bootloader copies OTA App into MCU internal flash so that the old production App is overwritten at this time. And then OTA app runs from internal flash. Is my understanding incorrect?

PS: STM32F4xx RAM is quite small. Is OTA App code size able to fit into MCU RAM?

Sincerely,

Clark

0 Likes
MichaelF_56
Moderator
Moderator
  • OTA Upgrade initiated by an API call from the Production App
  • Device reboots, Bootloader copies OTA App into MCU RAM
  • OTA App runs from RAM, starts Wi-Fi AP and webserver
  • Wi-Fi Client connects and browses to the upgrade webpage
  • OTA App writes new firmware over existing Production App
  • Device reboots, Bootloader verifies New Production Firmware

Seems to imply exactly what you suspect.

0 Likes
JoYi_1844281
Contributor II

It's should be the OTA mechanism on SDK 2.4.1!

For SDK 3.x (STM platform).

OTA_FR burning on external flash! which could be triggered by push button detect on bootloader !

And bootloader load the OTA_FR from external flash and over write Production App!

OTA_FR run on internal flash, start Soft AP and webserver!

WiFi Client connects to AP and upgrade application via webpage !

OTA_FR over write APP0 of external flash by upgraded Application

OTA_FR reboot

bootloader load external flash APP0 to overwrite Production App on internal flash

For SDK 3.x (BCM4390x)

All same as above but BCM4390x did not have internal Flash like STM platform.

So all Applications image load from external flash.

hachc_2137126
Contributor II

Hi @mwf_mmfae,

I think that the question from clark would be the following 2 statement:

  • Device reboots, Bootloader copies OTA App into MCU RAM
  • OTA App runs from RAM, starts Wi-Fi AP and webserver

Since the RAM is not big enough (128Kbyte for STMF41xx) for the whole OTA application, will it be possible to execute it from RAM without coping OTA app from external flash to internal flash?

0 Likes
MichaelF_56
Moderator
Moderator

I will need to ask someone more knowledgeable that myself to respond.

nsankar

0 Likes
Anonymous
Not applicable

I think jone's reply is clear.

There are several platforms:

A. With external flash only, larger RAM (439x,4390x)

B. With internal flash and external flash, smaller RAM (some STM32 platform)

C. Internal flash only, no external flash.

For C, OTA is not supported.

For A. Bootloader load OTA App from external flash into RAM and run.

For B. Bootloader copy OTA App from external flash, overwrite internal flash App and boot from internal flash.

Need to highlight OTA on 3.5.2 for platform B is broken due to this issue:

Possible 3.5.2 bug in wiced_framework_set_boot()

So if you are on 3.5.2 and platform B. be aware of that.

BTW currently there is no OTA2 implementation for platform B on 3.5.2 as I know.

View solution in original post

MichaelF_56
Moderator
Moderator

Thanks Sam.

0 Likes
Anonymous
Not applicable

OTA is deprecated and should NOT be used for any new development/design

OTA2 will be the preferred way and the only way supported going forward


There are a lot of limitations on OTA regarding reliable upgrades

And it is not possible to upgrade from OTA to OTA2 in the field

hachc_2137126
Contributor II

Thanks, Broadcom team.

Well noted.

0 Likes
Anonymous
Not applicable

But there is no OTA2 implementation for non-439x,4390x platform (ex. STM32) so no options.

How about the schedule for STM32 platforms OTA2 ?

0 Likes
Anonymous
Not applicable

Within the few weeks from now

Anonymous
Not applicable

I would like to know if 3.5.2 supports using the 3.1.x version of OTA "ota_fr" with the STM32F411 with 128KB RAM and an external SPI flash and also if ota_fr is supported on BCM943362WCD4. My app is small and I can probably fit ota_fr within my app.

Also, the same questions for OTA2.

0 Likes
Anonymous
Not applicable

Currently I don't believe this would work without some changes in the code in 3.5.2

Anonymous
Not applicable

Ok, let me ask the question another way:

What is the best release to use to get ota_fr and snip.scan working with an STM32F411 with 128KB RAM, an external SPI FLASH with a BCM943362 (and using BCM943362WCD4 as an example)?

Also, when will those code changes be available (is a 3.5.2+ release imminent)?

0 Likes
Anonymous
Not applicable

If you are not updating from a previous version, then 3.5.2 will work to begin with

But suggest you wait a couple of weeks for the 3.6.x series update and leverage the OTA2 which is much more robust update mechanism

Anonymous
Not applicable

If I develop on 3.5.2 and test the OTA 3.1.x within that release (again platforms mentioned above), you believe it will work? (Problems are only when doing OTA from a 3.1.x or 3.3.x release to an OTA built on 3.5.2; correct?)

So, for those platforms I mention above, how many hours am I likely to spend porting from OTA to OTA2 and the general time I will need to port from 3.5.2 to 3.6.x?

Will the first release of 3.6.x in a couple of weeks support my platforms 32F411 / 943362 or do they come later?

0 Likes
AxLi_1746341
Honored Contributor

davidep wrote:

If I develop on 3.5.2 and test the OTA 3.1.x within that release (again platforms mentioned above), you believe it will work? (Problems are only when doing OTA from a 3.1.x or 3.3.x release to an OTA built on 3.5.2; correct?)

Hi davidep

At this timing, I won't suggest you to develop your application with 3.1.x serial SDK.

You need to pick a couple of patches for 3.1.x serial from the forum and apply yourself.

In additional, not all the fixes are available on the forum. Some fixes just silently

merged in new SDK without changelog.

Try poring your application to latest SDK would be a better option.

PS. We use 3.1.2 in our product but that is because we developed our product in very

early stage. At that moment, 3.1.2 was the best choice. We collected some fixes from

the forum and also backport some fixes by ourselves from new SDK.

AxLi_1746341
Honored Contributor

davidep wrote:

Will the first release of 3.6.x in a couple of weeks support my platforms 32F411 / 943362 or do they come later?

Good question.

People needs to know if OTA2 applies to *all* platforms or just some platforms.

In additional, is OTA2 works for *all* OS/network combinations in next release.

Anonymous
Not applicable

OTA2 will apply to all platforms with external serial flash in the initial release. Future releases will address the need to have support for platforms with only internal flash.

So the combination you requested it would work.

Also the initial release would be focused on ThreadX from a qualification standpoitn but we would appreciate folks in the community testing our the FreeRTOS builds as well

AxLi_1746341
Honored Contributor

nsankar wrote:

Also the initial release would be focused on ThreadX from a qualification standpoitn but we would appreciate folks in the community testing our the FreeRTOS builds as well

OK, I can help testing FreeRTOS build and feedback on the forum once we got official 3.6.x release.

BTW, Just FYI, currently OTA2 cannot be built with FreeRTOS.

0 Likes
Anonymous
Not applicable

Any update on when we will see SDK 3.6.x?

Also, how soon afterwards support for FreeRTOS & internal flash only ie Particle Photon?