Bluetooth Smart Firmware Over The Air (FOTA) Programming

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

cross mob
JuVo_286221
Level 2
Level 2

Hi y'all,

   

we're developing some consumer electronics and would like to enable firmware updates over the smartphone: A message would pop up and the user can then upload a new version of the device firmware via Bluetooth.

   

I know this is feasible as some of Cypress'es competitors provide this feature.

   

How can I achieve this using a Cypress PSoC 4 BLE (with CapSense, CY8C4247LQI-BL483)?
Are there example projects or do I have to write a bootloader on my own?

   

 

   

Thanks!

   

Julian

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

 zadek,

   

 

   

As @Undesh pointed out, please refer two the two sets of example projects that come as part of BLE Component (see attached imgae). These projects should help you in getting a FOTA feature using CY BLE part.

   

 

   

I would like to emphasize that SPP-over-BLE is a form of implementation, not a spec, unlike the Classic Bluetooth. At the end of the day, for FOTA, you need to transfer the new image file from the smartphone to the BLE Device over a custom service at high data rate. The example projects demonstrate these (with both external memory and direct flash).

   

 

   

-Rohit

View solution in original post

0 Likes
17 Replies
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

AFAIk there is no pre-made solution yet. Since Bluetooth LE doesn't provide a SPP profile emulating a serial stream, it also gets a little bit difficult (but there is an example here: http://www.cypress.com/?app=forum&id=5283&rID=104409). Sou you need to write your own boot loader for now.

   

Maybe there will be an example in the 100 BLE project list: http://www.cypress.com/?id=5509

0 Likes
JuVo_286221
Level 2
Level 2

Oh, what a bummer…

   

I understand that there's no Serial Port Profile, but the Nordic Semiconductor module linked above is also a BLE device, and they also manage to do this. As both chipsets have an ARM Cortex M0 core, the approach might be very similar.

   

In this article mbed includes a graph depicting the structure of a FOTA enabled firmware. Looks pretty difficult to implement. But it's also so awesome, look at this video.
It would speed up our development process and we could continue developing the firmware after our device is shipped.

   

I will contact Cypress just because I'm curious if they develop something in that direction.

0 Likes
Anonymous
Not applicable

I have seen two types of FOTA example projects (one using an external memory and another using the internal flash) that are shipped with BLE component in PSoC Creator.. take a look at them.

   

You can access the example projects by right clicking on BLE component in your PSoC Creator project schematic.

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored
        There is a good selection of AppNotes regarding developing boot loaders on the PSoC:   
       
Together with the SPP-over-BLE project you should be able to develop that, since the part of flashing, and handling the bootloadable project is already done.   
(Please excuse the crude formatting, I'm getting this small non-working edit window on my home computer all the time it seems. And I thought that bug has been fixed 😞   
0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

@hli

   

Which browser do you use?

   

 

   

Bob

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

If you are using explorer 9, 10, set its options checkoff to "compatibility mode",

   

that generally fixes problem. Explorer 11 fixed the issue automatically.

   

 

   

Regards, Dana.

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

 zadek,

   

 

   

As @Undesh pointed out, please refer two the two sets of example projects that come as part of BLE Component (see attached imgae). These projects should help you in getting a FOTA feature using CY BLE part.

   

 

   

I would like to emphasize that SPP-over-BLE is a form of implementation, not a spec, unlike the Classic Bluetooth. At the end of the day, for FOTA, you need to transfer the new image file from the smartphone to the BLE Device over a custom service at high data rate. The example projects demonstrate these (with both external memory and direct flash).

   

 

   

-Rohit

0 Likes
JuVo_286221
Level 2
Level 2

Thanks a lot for your answers! Now I know where I have to start.

   

Even famous Marlowe and Dana made an appearance to the thread hehe.

   

I will post a follow-up once I made some progress.

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

@Bob / Dana: I'm using the newest Firefox both at work and at home. At work its fine, at home I seem to get the small box all the time. Need to test today again...

0 Likes
lock attach
Attachments are accessible only for community members.
JuVo_286221
Level 2
Level 2

Hi! Just a little follow-up!

   

I spend some time trying to understand and implement the Bootloader-Bootloadable Example project "BLE OTA Shared Memory Bootloader and Bootloadable". The example project works amazing, but I can't get it to work in my own project.

   

So far I got the Bootloader compiling, but the Bootloadable is causing problems. After fighting a variety of error messages, I get the one attached and I can't wrap my head around it. After some googling I understood that my Bootloadable image might be too big for the specified memory map (the region I want to load the image to). True?

   

What can I do to make the size smaller? I already tried commenting (almost) every printf statement, without any effect.

   

What bugs me the most is that it says "region `rom' overflowed by 0 bytes"…?!

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

First approach: Set the build configuration from "Debug" to "Release".

   

Second: Post your complete workspace, Bootloader and bootloadable so that we all can have a look at all of your settings. To do so, use
Creator->File->Create Workspace Bundle
and attach the resulting file. You may do a "Clean" before to keep the archive smaller.



Bob
 

0 Likes
JuVo_286221
Level 2
Level 2

Thanks for your offer to look over the project settings. I attached the workspace bundle, but I took out a bunch of functions to make life harder for copycats.

   

I set the configuration to Release, but got the same errors. Do you think the problem exists because I should include all the TopDesign CSDs that are related with hardware in the Bootloader? I didn't reorganize everything yet, because I wanted to get it at least running beforehand.
I guess I'd have to move all the PrISM, CapSense and I2C CSDs to the Bootloader TopDesign and all all of the required APIs in the header file "SharedProjectAPI.h"?

   

 

   

** For some reason the file upload didn't work.

   

Here's the link to the archive : http://we.tl/6I1AKBvhyn

   

 PS: The project is now not compilable anymore, it's just to see the settings.

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

No, thanks. Viewing not compilable code with missing "{" will not even show up the *real* error and will hinder making improvements to your program structure.

   

You may create a "MyCase" and submit your original project to Cypress, they will keep it confidential.

   

 

   

Bob

0 Likes
JuVo_286221
Level 2
Level 2

Ok, sorry Bob. I can't openly publish the whole project, and apparently I can't just take parts out without breaking it. Guess I have to open a myCase.

   

Thanks for your time though.

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

Can you create a small project that just contains demo code to get the bootloader to run? (Maybe it just blinks a LED). That way you a) can test whether it works at all and b) post it here in case it doesn't.

   

(Its always a good idea to try to exclude potential sources for errors, e.g. unrelated parts of the project)

0 Likes
AnWa_1259496
Level 4
Level 4
Welcome! 50 replies posted 25 replies posted

 This is a supplementary question about the BLE Bootloader.

   

 

   

I have been playing with the example bootloader/bootloadable projects mentioned above.

   

To download the application image, the examples use the Cypress USB dongle. Does this mean if the bootloader is used in the "real world" the user would always need a Cypress USB dongle for firmware upgarde?

   

The bootloader host application does not appear to work using any other way such as virtual USB/BLE COM port which is implemented by third-party BLE dongles.

0 Likes
Anonymous
Not applicable

 The BlueTooth Low Energy does not support SPP profile. So we may not be able to enuemearte the BLE device as a COM Port just by using the BLE Component. Do you want the firmware to be upgraded over the Air itself? If so, you would require another BLE device like the Cypress Dongle which can sends the new firmware. If you do not want OTA based bootloading, then you can use exisiting protocols like I2C and UART for bootloading after the device enters the Bootloader Mode.

0 Likes