This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2340R5:SDK7.2 OAD on-chip fails with SimpleLinkConnect.

Part Number: CC2340R5
Other Parts Discussed in Thread: UNIFLASH,

Hello.

I am trying OAD with Uniflash in the following SDK7.20 sample configurations:

-basic_ble_oad_onchip_LP_EM_CC2340R5_freertos_ticlang,

-basic_persistent_LP_EM_CC2340R5_ freertos_ticlang,

-mcuboot_LP_EM_CC2340R5_nortos_ticlang,

The address of flash_map_backend.h has been changed as follows.

UniFlash

So when I start the OAD onchip app and then start the update with SimpleLinkConnect, I get an error saying "OAD Reset Service Failed" and the update fails.

Then when I reset it, it connects to the Persistent app and when I start the update, it succeeds.

I don't understand why the first update fails.

Also, are there any expected configuration setting for this configuration?

**environment

Android version 11
SimpleLink Connect version 1.2.2

Regards,

Masaki

  • Hello Masaki,

    Thanks for reaching out to us.

    Please help me first with a couple of things:

    1. Look for the public address value. To do this, please connect your board, go to Uniflash - Memory and search for the 6-byte long value stored in a special register with address: 0x4E000058. Let me know what the value is.                                                                                
    2. Can you try changing the default Address Mode both in persistent and basic_ble_oad projects to RPA with Public ID and try again?

    Best regards,

    David.

  • Hi David,

    Thank you for your reply. I was just on vacation, so my reply was delayed.

    1. I checked the public address at the time the problem occurred. It was 0xF1AED70C 0x0000A434.

    2. When I tried it 10 times in an RPA with Public ID environment, "OAD Reset Service Failed" occurred all 10 times.
         Also, when I tried 10 times in the Public Address environment, "OAD Reset Service Failed" occurred 6 times.

    It seems to always fail when using RPA with Public ID environment.

    Regards,

    Masaki

  • Hello Masaki,

    Could you please help me with the following:

    1. If possible share with me the hex and bin files to try to reproduce the issue.
    2. Try again without modifying flash_map_backend.h and let me know if you see the same problem.

    Best regards,

    David.

  • Hi David,

    thank you for your reply.

    1. it's okay. When sharing, should I paste the binary and hex on this forum?

    2. If I don't change flash_map_backend.h, I can start Persistent_app in basic_persistent_LP_EM_CC2340R5_freertos_ticlang,

        but I don't know how to start Basic Ble Project in basic_ble_oad_onchip_LP_EM_CC2340R5_freertos_ticlang.

        If you know, please tell me how to start onchip's Basic Ble Project without changing flash_map_backend.h.

    Regards,

    Masaki

  • Hello Masaki,

    So without chaining the flash_map_backend.h it boots in basic_ble.

    I am using the following files out from the SDK after building the respective projects.

    oad.zip

    Could you please try as well to erase your flash before flashing again the files using Uniflash?

    Regards,

    David.

  • Hi David,

    I confirmed the issue with the oad.zip

    The results are as follows.

    Android 11 + SimpleLinkConnect 1.2.2 :

    Succeeded 5 out of 10 times with Basic_ble_project and Succeeded 5 out of 5 times with Persistent app


    also, I had Android 8 on hand so checked it out.

    Android 8 + SimpleLinkConnect 1.2.2 :

    Succeeded 5 out of 10 times with Basic_ble_project and Succeeded 5 out of 5 times with Persistent app

    I wanted to reproduce the oad.zip environment. Differences will appear in mcuboot_LP_EM_CC2340R5_nortos_ticlang.hex.

    This difference seems to be in flash_map_backed.h, and

    the expected values of oad.zip are primary 0x00032000 0x4A000, secondary 0x00006000, 0x2C000,

    but it was not possible to create the same file. However, either way, an error occurred in Basic_ble_project. 

    Attach the oad file with modified flash_map_backend.h. Please confirm,

    oad with changed flash_map_backend.zip

    Regards,

    Masaki

  • Hello Masaki,

    I can successfully implement the OAD with the files you shared with me.

    So, in my case I did not modify the flash_map_backend.h.

    What errors do you get in Basic_ble_project? The "OAD Reset Service Failed" message? Is this happening again only for the first OAD or after several attempts as well?

    Thanks for the information about the different android versions, I will have a look into that.

    BR,

    David.

  • Hi David,

    Is it possible for you to share flash_map_backend.h? I think the values are different from each other even if we haven't changed them.

    This is my flash_map_backend.h.

    flash_map_backend.zip

    yes. The "OAD Reset Service Failed" message is displayed whenever Basic_ble_project fails.
    Also, this happens only with the first OAD, and does not occur with subsequent OADs (which are Persistent_App at that time), and the update succeeds.

    Regards,

    Masaki

  • Hello Masaki,

    This is the flash_map_backend.h I am using. It comes from <SDK>\examples\nortos\LP_EM_CC2340R5\mcuboot.

    Could be the Android version as well. Do you have one with a more recent version (12 maybe)?

    I have tried both on IOS and Android 13.

    flash_map_backend.h

    Regards,

    David.

  • aHi, David

    I'm sorry for the delay in replying.

    Thank you for providing flash_map_backend.h.

    In my SDK environment, there was no flash_map_backend.h in <SDK>\examples\nortos\LP_EM_CC2340R5\mcuboot.

    I did grep but flash_map_backend.h is only found in <SDK>\source\third_party\mcuboot\boot\ti\source\mcuboot_app.

    In David's environment, are there two or more flash_map_backend.h files directly under <SDK>\?

    I'm checking to see if customers can provide me with Android 12. So the results will probably come a little later.

    also, the issue has also been occurred on iPhone8 Plus/iOS 16.

    I think there is a problem with my method of operation. Is there a difference?

    1.  Build and create hex and binary

     basic_ble_oad_onchip_LP_EM_CC2340R5_freertos_ticlang,

     basic_persistent_LP_EM_CC2340R5_ freertos_ticlang,

     mcuboot_LP_EM_CC2340R5_nortos_ticlang,

    2. Save basic_ble_oad_onchip_LP_EM_CC2340R5_freertos_ticlang_v2.bin to firebase storage.

    3. Set Firebase URL to SimpleLink's FW Update URL ( I have also tried Git sample binaries. )

    4. Erase CC2340R5 with UniFlash.

    5. Flash hex and binaries with Uniflash.

     

    6. Pairing  with Basic Ble Project with SimpleLink Connect.

    7. Select the bin registered in FireBase and start the update.

    8. Success or "OAD Reset Service Failed"

    9. Start over from step 4.

    Regards,

    Masaki

  • Hello Masaki,

    1. Regarding the flash_map_backend.h, you can load the project (<SDK>\examples\nortos\LP_EM_CC2340R5\mcuboot\mcuboot\ticlang) into CCS. I think this is the one you referred to several days ago. Could you try again without modifying it, do you still boot directly to persistent app?

    2. Have you tried using the default basic_ble_oad_onchip_LP_EM_CC2340R5_freertos_ticlang_v2.bin option from the app? Do you get the same result?                                                                                                                                                                                                                                                
    3. It would be a good idea to try with a more recent Android version.

    Best regards,

    David.

  • Hi David,

    Thank you always for your support. 

    1.I had the wrong understanding about this.

    I also had flash_map_backend.h taken from <SDK>\examples\nortos\LP_EM_CC2340R5\mcuboot.

    In addition, I uninstalled the SDK and cleared the CCS workspace once, but the persistent app still starts first.

    2. Yes. It succeeds once, but if I erase and try again, it will reappear.

    I apologize for the inconvenience, but is it possible to collect the dump file using the following procedure?

    Since Persistent App starts, I think there will be a difference at least in that area, and there may be other reasons why "OAD Reset Service Failed" occurs.

    dump.txt

    ① Erase with Uniflash and Flash the following

    mcuboot_LP_EM_CC2340R5_nortos_ticlang.hex

    basic_persistent_LP_EM_CC2340R5_freertos_ticlang.bin

    basic_ble_oad_onchip_LP_EM_CC2340R5_freertos_ticlang_v1.bin

    ②  Activate mcuboot_LP_EM_CC2340R5_nortos_ticlang project, and press Launch Selected Configuration from TargetConfigurations.

    ③ Press Connect Target in Run

    ④ Press MemoryBrowser in View

    ⑤ Right-click MemoryBrowser and press Save Memory

    ⑥ Set File Type to TI-TXT file and proceed to next

    ⑦ Select Add Range and set Start Address to 0x00000000 and Length to 0x0007FFFF.

    ⑧ Finish and generate dump file

    Regards,

    Masaki

  • Hello Masaki,

    Thanks for the detailed info. Just in case, you can also use Uniflash to export the memory dump faster and from the same UI.

    Regarding the results, I have almost the same values, except from the last 5 memory lines before the 0xFFFF.

    Just to make sure we are both on the right track again:

    1. The issue remains: first OAD with SimpleLinkConnect, shows error saying "OAD Reset Service Failed" and the update fails. Then, the application boots to persistent app and the next updates are successful?
    2. In the previous thread you mention: "Yes. It succeeds once, but if I erase and try again, it will reappear." You mean that the first OAD now works fine (no OAD Reset Service Failed) but after you disconnect and connect again the persistent app will show now?

    exported-image.txt

    BR,

    David.

  • Hi David,

    I had never tried Uniflash's Dump. Thank you for providing information.

    Yeah, I also compared the Dump and I don't think there is any particular problem.

    Also, other members built mcubood and received hex, but the hex was the same as the one built in my environment

    In addition, I tried updating on iPhone 13 mini with IOS 16.6.1 and Pixel 5 with Android 12, but the issue is reproduced.

    _

    1. yes. After the "OAD Reset Service Failed" error occurs, the Persistent app start and the next update  be successful.

    2. "OAD Reset Service Failed" tends to occur when starting the update on the second attempt after the update was successful on the first attempt.

     However, this is not always the case. Sometimes I have consecutive failures and consecutive successes.

    -1. First attempt: Update successful

    -2. Erase and second attempt: Persistent app starts with "OAD Reset Service Failed" error. And updates from Persistent app are successful.

    -3. Erase and third try: Update successful

    -4. Fourth attempt after erasing: Persistent app starts with "OAD Reset Service Failed" error. And updates from Persistent app are successful.

    -5 Repeat 1~4

    I have a question, David, what SDK are you using? I'm using simplelink_lowpower_f3_sdk_7_20_00_29.

    Also, the default URL version of Git is 7.10, which is the same as David, right?

    Regards,

    Masaki

  • Hello Masaki,

    Thanks for the information.

    I am using the same SDK simplelink_lowpower_f3_sdk_7_20_00_29 and image version 7.10.00.23_1.0

    Does this also happens when trying to update with version oad_onchip_v1?

    I think the next step here is to search for what is causing the "OAD Reset Service Failed" by debugging the code.

    To do this I would suggest to go into debug mode and Connect Target, this thread provides a good detail about how to do it.

    I will also work on it on my end.

    Please let me know if you have any other suggestion to speed up this process.

    BR,

    David.

  • Hi David

    yes. The issue occurs with oad_onchip_v1 as often as v2.

    Understood. I will check it.

    Regards,

    Masaki

  • Hello Masaki,

    Got it. I am working to have an answer for tomorrow. 

    BR,

    David.

  • Hi David

    Sorry for the late reply.

    I was stuck doing other tasks. I'll check it out now.

    Regards,

    Masaki

  • Hi David,

    I checked the issue with Debug.

    I've discovered a few things so I'll let you know.

    It seems that the Persistent app is in the System ROM when "OAD Reset Service Failed" occurs.

    In other words, I think the Persistent app is failing to boot.

    ① ble_onchip program counter (After flashing with Uniflash). This is booting and sleeping in Standby mode.

    ② ble_persistent program counter ( When updating is running while communicating with SimpleLinkConnect). This is booting and sleeping in Standby mode.

    ③ ble_persistent  program counter ( When "OAD Reset Service Failed"), It looks like in System ROM.

    Also, when I debugged ③ and replaced PC, SP, SCB > VTOR with the value of Persistent app, it became ②.

    So I think the error ③ occurs only when starting the persistent app after resetting with oad-onchip.

    I'll do some more research on system rom.

    Regards,

    Masaki

  • Hello Masaki,

    Thanks for the detailed information and patience debugging this.

    The main difficulty that I have is that I cannot reproduce the "OAD Reset Service Failed", so I am looking for something that could lead to it. However after several OADs I have seen that occasionally the loading process gets stuck, but no OAD Reset.

    I think the issue here is related to the mcuboot, which will explain why the persistent app is failing to boot. I will share this again with my team to further review it. I hope to have an answer about it for this week.

    Best regards,

    David.

  • Hi David,

    I understood. Thank you for your continued support.

    Also, the BOOTSTA value at the time of the error was 0xBA. This seems to be transitioning to Serial ROM bootloader.

    Regards,

    Masaki

  • Hello Masaki,

    To rule out the SimpleLink app, do you think you could try using BTool instead?

    To do this you will need to:

    1. Flash another CC2340R5 with host_test project.
    2. Open BTOOl (<SDK>\tools\ble5stack\btool)
    3. Go to Over the Air Download and load oad image.                                                                                 

    Thanks

    BR,

    David.

  • Hi David,

    I had never tried BTool.

    I will check it.

    Regards,

    Masaki

  • Hi David,

    The issue could not be reproduced with BTool.

    So, the latest version of SimpleLinkConnect, 1.3.2, was released last week, but when I checked there, the issue did not occur.

    "OAD Reset Service Failed" is a resolved recognition,

    ・SDK simplelink_lowpower_f3_sdk_7_20_00_29
    -basic_ble_oad_onchip_LP_EM_CC2340R5_freertos_ticlang
    -basic_persistent_LP_EM_CC2340R5_freertos_ticlang
    -mcuboot_LP_EM_CC2340R5_nortos_ticlang
    ・SimpleLinkConnect1.3.2 (tested on IOS16)
    ・Uniflash 8.4.0.4458

    So, regarding the previous flash_map_backend.h, can you think of any reasons why there may be differences depending on the environment?

    Even after uninstalling the SDK and rebuilding it, I was not able to obtain the same address.

    Regards

    Masaki

  • Hi Masaki,

    I am handling this thread while David is out of the office.

    The issue could not be reproduced with BTool.

    So, the latest version of SimpleLinkConnect, 1.3.2, was released last week, but when I checked there, the issue did not occur.

    Is it correct understanding that OAD works properly when using BTool or SimpleLinkConnect v1.3.2?  If yes, then it sounds like the issue was in the mobile app.

    Regards,

  • Hi, Clément

    yes. The problem did not occur with Btool and SimpleLinkConnect, 1.3.2.

    There are still some questions regarding flash_map_backend.h, but it can be started by making some modifications, and since it deviates from the content of

    the inquiry, I would like to mark it as resolved.

    thank you. David and Clément

    Masaki