SUOTA tutorial error

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at https://www.dialog-semiconductor.com/support . We’ll be fixing bugs / optimising the searching and tagging over the coming days.
20 posts / 0 new
Last post
TMiranda
Offline
Last seen: 3 years 11 months ago
Joined: 2017-11-16 18:00
SUOTA tutorial error

Hi guys.

I'm using the DA14585 Basic Dev-Kit with the 6.0.6 SDK, trying to run the SUOTA Tutorial (number 6). I've faced a few problems that I would like to question.

1. There's no DA1458x_SUOTA_Multipart_Binary_Generator_0.rar on the DA14585 Software & Tools page. I've had to download it from the DA14583. Is there a reason for this?

2. The SUOTA tutorial ask you to use a ble_585_sw_version.h file to generate the .img files. This file doesn't exist on the SDK 6.0.6 (or I have been unable to find it).

3. After burning the multi_part.bin on the SmartSnippets Tool, using the JTAG, and resetting my board, nothing happens on the SmartSnippets Tool (there's no Reset confirmation). Besides that, I can't find the device in the SUOTA App in my iPhone. (I can find it if I debug again the code, but I think there's something wrong on doing this).

4. When I try to upload the fw_image_2.img to my device, using the SUOTA App, I get an "Error: Invalid product header". So, I'm unable to finish the tutorial.

Any tips?
Thanks in advance.

Keywords: 
Device: 
MT_dialog
Offline
Last seen: 1 year 7 months ago
Staff
Joined: 2015-06-08 11:34
Hi TMiranda,

Hi TMiranda,

  1. The reason for that is because the versions of the 581/583 and 585/586 are almost identical regarding the SUOTA procedure, that means that you can use the same file in order to generate the multipart.
  2. The file that is referenced in the tutorial as a ble_585_sw_version.h file is the sdk_version.h file in the SDK6.0.6, that should be corrected, thanks for indicating.
  3. After burning the file in the flash, there is no reset confirmation from the Smart Snippets tool, you will just have to see the device advertising through the Power Profiler (which is available only for the pro kit using the UART interface). If you are not able to see this then something went wrong during the generation of the multipart binary.
  4. Since from the previous question you are not able to see the device advertising after you have burned the multipart in your flash, how is that you can update the image ? If you are trying with just a bare download from the JTAG of uart, without the secondary bootloader than this is not going to work, since the SUOTA expects to find some extra info in the flash in order to perform the SUOTA.

What might be the reason for what you are experiencing is most probably the offsets that the images reside, since the 585 supports larger images that means that you will have to increase the size of the offsets in the flash. So open the project_multipart_binary_v2.py and alter the values in the following variables just like below:

MEM_LOC_FOR_FW_1_IMG = "0x8000"
MEM_LOC_FOR_FW_2_IMG = "0x1F000"
MEM_LOC_FOR_PRODUCT_HEADER = "0x38000" 
This will give more space between your images.
 
Thanks MT_dialog
TMiranda
Offline
Last seen: 3 years 11 months ago
Joined: 2017-11-16 18:00
Thanks for the quick answer.

Thanks for the quick answer.

1 - As an opinion, I would advice you to add the file to the 14585 downloadable content. It would not harm anyone and probably avoid a few questions here.
3 - As I've said, I only have the DA14585 Basic Dev-Kit, so how can I be sure that it's working, since there's no way to see the device advertising?
4 - I think that's the problem. after burning the SPI flash, I cannot see the device advertising on the SUOTA app. I've already tried with the new variables you've shown, but no changes. I've also tried it with both options on the SPI Flash memory bootable part.

Thanks in advance.

MT_dialog
Offline
Last seen: 1 year 7 months ago
Staff
Joined: 2015-06-08 11:34
Hi TMiranda,

Hi TMiranda,

  1. Thanks for the indication, later the tutorial will be updated properly.
  2. If you dont have a pro kit, thus you cannot use the power profiler then your only option is to use either the SUOTA application or a generic BLE application, be aware that in order for the SUOTA android/ios application to show the device as an available SUOTA device you will have to place the SUOTA UUID in the advertising string. That poses another question, which fw do you use in order to build the multipart.bin file ? Are you using a SUOTA enabled fw, like the ble_app_ota ?
  3. Please use the ble_app_ota demo in order to perform the SUOTA procedure and if this doesn't work for you with the python script, try to follow the instructions in the AN-B-010 DA14580 using SUOTA.pdf, its a 580 document but as i ve mentioned the procedure is identical. Also have in mind that you will have to use different offsets for the images and the headers 0x8000 for image 1 0x1f000 for image 2 and 0x38000 for the header.

Thanks MT_dialog

TMiranda
Offline
Last seen: 3 years 11 months ago
Joined: 2017-11-16 18:00
2. In fact, I can find the

2. In fact, I can find the SUOTA device using LightBlue and SUOTA for iOS, but only when I'm running in debug mode on Keil. Nothing happens when I burn it in the SPI memory and restart the board. To build the multipart.bin file I'm using only the input files shown on the tutorial, being fw_1.hex, fw_2.hex, fw_1_version and fw_2_version, which are generated running the ble_examples/prox_reporter.uvprojx. The secondary_bootloader.hex file I'm using already came on the SUOTA_Multipart_Binary_Generator/input file.

3. I'll give this a run and post here.

In fact, I just put my hands on a Pro Kit and I'm having the same issues related before. I'll try to run it with the ble_app_ota and update here.

EDIT:
I'm having the same problem. Generating the fw_multi_part_spi.bin file using ble_app_ota doesn't change anything. I cannot find my device after burning into SPI flash and reseting the board. I'm using the Power Profile and I'm able to see that the board should be up and running (and I've reseted it a few times).

TMiranda
Offline
Last seen: 3 years 11 months ago
Joined: 2017-11-16 18:00
So, now I'm running the

So, now I'm running the example with a DA14585 Pro-Kit in a DA14580DEVKIT. I've found the source of my last error by following the DA1458x using SUOTA
AN-B-10. The problem was that values used in the PRODUCT_HEADER_POSITION on files bootloader.h and app_spotar.h were wrong. I've changed it to 0x1f000 and the error disappeared.

Now, I can burn the Spi Flash memory, reset my device and I'm able to see it advertising on SUOTA app and connect to it. Whenever I try to update my new firmware version to it, using the app, a new error appears, the "Same Image Error". I've read the note related to this error in the DA1458x using SUOTA AN-B-10 but I'm still confused. I've tried to upload the images more than once via app, and to different image banks but nothing worked so far. Again, a few questions.

1 - Shouldn't the banks have different images? (I've changed the firmware version and timestamp)
2 - Where can I find more information about the two memory banks implementation?
3 - How can I do a SUOTA via software? I don't want to use the app in my future applications, neither the USB dongle as it's shown in the tutorial.

MT_dialog
Offline
Last seen: 1 year 7 months ago
Staff
Joined: 2015-06-08 11:34
Hi TMIranda,

Hi TMIranda,

  1. I dont get the question, the fw will check the image, when first burning the multipart in the flash you can use the same image in order to avoid the same image error.
  2. The two memory banks are the different addresses that you have declared, there is no document that will explain the inner working of SUOTA, you can have a look at the SUOTA implementation and in the secondary_bootloader project.
  3. You mean write your own host that will connect to the peripheral and update the image ? The source code of the android and iOS is available on the support site and also there is an example in eclipse of a windows application that performs SUOTA update, communicating with a 585 BLE module over UART. You will be able to find the source code in DA14585_SDK\6.0.6.427\projects\host_apps\windows\suota in the SDK 6.0.6.

Thanks MT_dialog

TMiranda
Offline
Last seen: 3 years 11 months ago
Joined: 2017-11-16 18:00
1 - As it's said in the AN-B

1 - As it's said in the AN-B-010 DA14580 using SUOTA_0 file in page 18-19, the fw_multi_part_spi.bin file is created using both fw_1.img and fw_2.img. This will be programmed in the SPI memory, which will contain the secondary bootloader (0x00000), fw_1.img(0x80000), fw_2.img(0x13000) and Product header (0x1F000). My fw_1.img and fw_2.img should be different, since I've changed the code (i've changed the name of the device on the user_config.h), the firmware version(sdk_version.h) and the timestamp(sdk_version.h). As you've said, I now used the same image (fw_1.img and a fw_1_copy.img [named as fw_2.img]) to create the multi_part_spi.bin. I'm still having a Same Image error when I try to upload a different image.

2/3 - Thanks, I'll check them later on.

MT_dialog
Offline
Last seen: 1 year 7 months ago
Staff
Joined: 2015-06-08 11:34
Hi TMiranda,

Hi TMiranda,

Tested this with ble_app_ota same versions in both banks on the SPI mutlipart.bin, i am not able to replicate what you are reporting, are you certain that you dont mix up the the header files and that the image that you download has a different image header version than the one located in the specific bank or its different from at least one of the two banks ?

Thanks MT_dialog

TMiranda
Offline
Last seen: 3 years 11 months ago
Joined: 2017-11-16 18:00
I was trying with the prox

I was trying with the prox_reporter. I've changed to the ble_app_ota now.

Here are the output generated for the first two images (same image) and fw_multi_part_spi.bin that I've burned in the SPI memory.

############# FREE SCRIPT FOR CREATING DA1458x MULTI PART IMAGE ###################
################### version :: sw_v_0000.00003 ##################################
##################### Developed in 2017 Janua #######################################
hex2bin v1.0.10, Copyright (C) 2012 Jacques Pelletier & contributors
Lowest address = 003C0000
Highest address = 003C6927
Pad Byte = FF
8-bit Checksum = A8
hex2bin v1.0.10, Copyright (C) 2012 Jacques Pelletier & contributors

Lowest address = 003C0000
Highest address = 003C6927
Pad Byte = FF
8-bit Checksum = A8
hex2bin v1.0.10, Copyright (C) 2012 Jacques Pelletier & contributors

Lowest address = 003C0000
Highest address = 003C18A7
Pad Byte = FF
8-bit Checksum = 98

INFO:: fw_image_1.img is successfully created with no data encryption.
INFO:: fw_image_2.img is successfully created with no data encryption. Creating image 'output\fw_multi_part_spi.bin'...
[00000000] AN-B-001 SPI header
[00000008] Bootloader
[000018b0] Padding (FF's)
[00008000] 'output\fw_image_1.img'
[0000e968] Padding (FF's)
[00013000] 'output\fw_image_2.img'
[00019968] Padding (FF's)
[0001f000] Product header

fw_multi_part_spi.bin is created successfully. #####################################################################################

As you can see, the checksum for both images (fw_1 and fw_2, I suppose) are the same, so it should be the same image.

To create the second image, I've changed the name of the device and the sdk_version information, and generated as it's told on the tutorial. I've sent two copies of the second image to my phone using iTunes. Below is the output of the python script of the second image.

############# FREE SCRIPT FOR CREATING DA1458x MULTI PART IMAGE ###################
################### version :: sw_v_0000.00003 ##################################
##################### Developed in 2017 Janua #######################################
hex2bin v1.0.10, Copyright (C) 2012 Jacques Pelletier & contributors

Lowest address = 003C0000
Highest address = 003C692F
Pad Byte = FF
8-bit Checksum = 8F
hex2bin v1.0.10, Copyright (C) 2012 Jacques Pelletier & contributors

Lowest address = 003C0000
Highest address = 003C692F
Pad Byte = FF
8-bit Checksum = 8F
hex2bin v1.0.10, Copyright (C) 2012 Jacques Pelletier & contributors

Lowest address = 003C0000
Highest address = 003C18A7
Pad Byte = FF
8-bit Checksum = 98

INFO:: fw_image_1.img is successfully created with no data encryption.
INFO:: fw_image_2.img is successfully created with no data encryption.

Creating image 'output\fw_multi_part_spi.bin'...
[00000000] AN-B-001 SPI header
[00000008] Bootloader
[000018b0] Padding (FF's)
[00008000] 'output\fw_image_1.img'
[0000e970] Padding (FF's)
[00013000] 'output\fw_image_2.img'
[00019970] Padding (FF's)
[0001f000] Product header
fw_multi_part_spi.bin is created successfully.
#####################################################################################

Again, the same checksum because I'm creating two images with the same .hex file, which is different from the ones stored on my memory. When I try to upload them using the SUOTA app on my phone, I still get the Same Error message. I have no idea what I'm doing wrong here.

MT_dialog
Offline
Last seen: 1 year 7 months ago
Staff
Joined: 2015-06-08 11:34
Hi TMiranda,

Hi TMiranda,

I have the impression that you 've have misunderstood how the SUOTA works and which of the images you should upload to the phone in order to perform the SUOTA, use the same images in order to create the multipart.bin file (just rename the fw_1.bin into fw_2.bin and execute the python script). After that create the second image (dont run again the python script), just take the updated binary with the updated header and pass it through the mkimage.exe file with the following command mkimage.exe single your_binary.bin your_fw_version.h new_image.img that will create the image that you should upload to your phone and make the change using that fw. If you still get that error you can debug the code in order to see what actually the device reads and promts you with that message, make sure that you use O0 optimization in order to be able to read the variables, burn the spi with the multipart.bin and run the same project from keil, the function you should check is the app_read_image_header(), that way you can check what the code reads and promts you with that message.

Thanks MT_dialog

TMiranda
Offline
Last seen: 3 years 11 months ago
Joined: 2017-11-16 18:00
Hi,

Hi,

I've done the mentioned steps, changing a bit - I need to run the hex2bin.exe program in order to create a binary, since the building process returns me only a hex file and then run the mkimage.exe file. I'm still getting the same error. Could you point me where I can find more information about debugging? I've only saw the tutorial example regards it, and I don't know how to perform it. I've made a video that shows what I'm doing step by step. The links are below.

https://www.youtube.com/watch?v=xkdkw0cdwKo
https://www.youtube.com/watch?v=22lIO55nfvU

Thanks in advance.

MT_dialog
Offline
Last seen: 1 year 7 months ago
Staff
Joined: 2015-06-08 11:34
Hi TMiranda,

Hi TMiranda,

There is no documentation that would describe step by step by step debugging methods, what you can do is have the multipart image in the flash and run the image that should boot from keil in order to debug it, just like i have describe it in my previous post and i ve also indicates the function that you should check. Also the videos that you have attached it seems to be not available.

Thanks MT_dialog 

TMiranda
Offline
Last seen: 3 years 11 months ago
Joined: 2017-11-16 18:00
The videos where on

The videos where on particular mode, I've just changed it and you probably can see them now.

MT_dialog
Offline
Last seen: 1 year 7 months ago
Staff
Joined: 2015-06-08 11:34
I dont see anything wrong on

I dont see anything wrong on the videos that you have uploaded, i have attached a .zip file with the OTA project including the binaries of the two different OTA supporting projects fw_1.bin and fw_2.bin along with their header files and the corresponding images fw_1.img and fw_2.img as well as the multi_part.bin file (contains two images of the fw_1.img). Now if you burn the multi_part.bin file in the flash and then copy only the fw_2.img on your phone you will be able to upload the fw_2.img to the device. So please try to do that and then if this is succesfull, you can try to generate the images by the binaries provided, perhaps this will help you to track the issue.

Thanks MT_dialog 

Attachment: 
hm
Offline
Last seen: 2 years 1 month ago
Joined: 2018-04-19 13:53
Hi Dialog, are you sure the

Hi Dialog, are you sure the suota is ok? i have changed the img and sw version so many times and the result always is "Same Image Error", i think maybe the bootloader always check the same image but not what i have upload ?
the problem is not just occured at Mr TMiranda ,and i don't known if he or she resolved the problem.

hm
Offline
Last seen: 2 years 1 month ago
Joined: 2018-04-19 13:53
i use the following command

i use the following command 'mkimage.exe single ncl_1.bin ncl_1_version.h ncl_1.img ' to create the img file, and then use next command 'mkimage.exe multi spi secondary_bootloader_585.bin ncl_1.img 0x4000 ncl_1.img 0x1B000 0x38000 ncl_1_ota.bin' to create bin file with bootloader ,and then burn it into flash, then i can find the device now .
Next i changed the sdk_version into a new version( change SDK_VERSION,SDK_VERSION_DATE,SDK_VERSION_STATUS)and renamed ncl_2_version.h ,rebuild a new bin file ,and exec comand 'mkimage.exe single ncl_2.bin ncl_2_version.h ncl_2.img' to create second img file.
Now i have to img file ncl_1.img and ncl_2.img, i copy the file info my ipad by itunes,and when i upload the ncl_2.img by SUOTA i always get the msg 'Same Image Error'.

PM_Dialog
Offline
Last seen: 7 months 1 week ago
Staff
Joined: 2018-02-08 11:03
Hi hm,

Hi hm,

We are trying to replicate your problem in order to give you instruction to solve your issue. We will let you know as soon as possible.

Thanks, PM_Dialog

mrlambchop
Offline
Last seen: 3 years 1 month ago
Joined: 2017-02-01 07:35
I am running into the "same

I am running into the "same image" error as well with the rcu_585 application.

I can use the instructions from Appendix C of the software guide to run "mk_suota_img.bat" and generate "rcu_585_suota.bin". I can flash that bin with SmartSnippets and see it in the SUOTA app with my software version. 

Then I clean my project, modify "user_config_sw_ver.h" with a new version and build date, rebuild, then use "mk_suota_img.bat" again to generate a new .img file. I load the new version .img file onto my android phone but get the "same image" error when using the SUOTA app. 

IM_Dialog
Offline
Last seen: 1 year 6 months ago
Joined: 2016-12-06 22:25
Hi, 

Hi, 

I just tried this myself and got it to work (using the SUOTA App to upgrade the firmware in a Voice RCU development kit). A couple of things to check:

- You need to update both the version number and the build date in the user_config_sw_ver.h file. 
- If you comment out the original version and date when you update these values ensure that the latest information appears at the top of the file. The following works:

#define SW_VERSION "v_v_7.141.3.18"
#define SW_VERSION_DATE "2018-11-08 17:04"

//#define SW_VERSION "v_v_6.140.2.17"
//#define SW_VERSION_DATE "2017-10-07 16:03"

but this does not as the script that generates the images ignores the comments and just uses the first version and date it finds, leaving you with an image containing the old information (and the possibility of a same image error):

//#define SW_VERSION "v_v_6.140.2.17"
//#define SW_VERSION_DATE "2017-10-07 16:03"

#define SW_VERSION "v_v_7.141.3.18"
#define SW_VERSION_DATE "2018-11-08 17:04"

Hope this helps

IM_Dialog