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.

CC2640: OAD Production Application problem

Part Number: CC2640
Other Parts Discussed in Thread: BLE-STACK, CC2650,

Hello!

I'm developing a custom board with a CC2640F128 (5x5) MCU. Everything about hardware seems fine, but I'm facing a few problems getting it to work with OAD (using IAR and BLE-Stack 2.2.2).

With the documentation and several researches in the Forum, I was able to flash both BIM and OAD_Target (Image A) projects to my board, and update it to the Simple_Peripheral (Image B) using BTool and a CC2640R2-Launchpad. I'm working with the "cc2650lp" examples, with the correct board files.

For my application, I need the board to start running 'Image B' when flashed - so I tried to create a "production image", as described in the User Guide. I copied all 4 hex files (bim, oad_target_app, oad_target_stack and simple_peripheral_app) to a folder in my computer, along with the oad_image_tool script. But when i try to run the suggested command line "<python> <oad_image_tool.py> <BIM hexfile> <Image A hexfile> <Stack hexfile> <Image B hexfile> -o <Output hexfile> -i production –t onchip", I get the following error.

"Fatal Error: -- The provided metadata location (0x00000000) is not empty. Exiting."

Since I was not facing any problems when 'Image A' was running at the start, I copied the the "-m 0x600" parameter from IAR post-build step for OAD_Target. With this parameter, I was able to merge the files, but when I flash the merged file to my board, "OAD Target Image A" is advertising.

What am I missing?

  • Hi Joao,

    Can you please re-try with the whole tool-chain from the same version of the BLE-Stack?
    - OAD target: CC2640F128 using BLE-Stack 2.2.2
    - OAD distributor: CC2640F128 or CC2650 Launchapd running Host test from BLE-Stack 2.2.2.
    - Create production image by following the steps in the BLE-Stack 2.2.2 (CC2640 BLE OAD User's Guide)
    - Use OAD Image Tool from BLE-Stack 2.2.2
    - Use IDE version recomended in BLE-Stack 2.2.2 (CCS v. 7.4.0 / IAR v. 7.80.4)
  • Marie,

    Thanks for the fast reply! I'll comment the steps individually.

    - OAD target: CC2640F128 using BLE-Stack 2.2.2
    * I'm already on this Stack version. I'm using both the OAD_Target and Simple_Peripheral examples, from the cc2650lp folder. In IAR, I'm changing the processor in "Options/General Options" and changing CC26500_LAUNCHPAD to CC2650DK_5XD in "Options/C C++ Compiler/Preprocessor";

    - OAD distributor: CC2640F128 or CC2650 Launchapd running Host test from BLE-Stack 2.2.2.
    * I do not have a CC2650 Launchpad, just the CC2640R2 one - which I'm flashing with the host_test hex file from CC2640R2 SDK 2.30.00.28. I do have a few custom board with the CC2640F128, but they are very simple (only for reading ADC values and advertise them); since I was able to perform OAD, I don't think the distributor is a problem. Do you think it's a huge difference?

    - Use OAD Image Tool from BLE-Stack 2.2.2
    * This is the version I'm using, along with the command line from the User Guide.

    - Use IDE version recomended in BLE-Stack 2.2.2 (CCS v. 7.4.0 / IAR v. 7.80.4).
    * I was using the newer version of IAR. I couldn't find any download link for the '.4' release, but I downloaded the '7.80.3' one. Still have the same problem (I will try to explain in better below).


    - Create production image by following the steps in the BLE-Stack 2.2.2 (CC2640 BLE OAD User's Guide).
    * I followed all the steps from the BLE-Stack 2.2.2 OAD User Guide. I'm building all the 4 projects, getting the '.hex' files and trying to merge them with the recommended command line. I am able to perform the OAD flawlessly if I flash the 'oad_target_cc2650lp_app_oad_onchip_production.bin' from the OAD_Target folder to my board, and update it after using BTool along the 'simple_peripheral_cc2650lp_app_oad.bin' file from the Simple_Peripheral folder.

    My problem is: when I do it, the Image A starts advertising in my board. Since I'm flashing several boards, I won't be able to update all of them using OAD. I'm looking for a way to already flash and run the Image B from the start, and use OAD only if I eventually need to update the firmware.

  • More information:

    The command line from the tutorial is:

    <python> <oad_image_tool.py> <BIM hexfile> <Image A hexfile> <Stack hexfile> <Image B hexfile> -o <Output hexfile> -i production –t onchip

    The command line from OAD_Target app project is:

    "$TOOLS_BLE$\oad\oad_image_tool.exe" "$PROJ_DIR$\FlashROM\Exe\oad_target_cc2650lp_app.hex" "$PROJ_DIR$\..\stack\FlashROM\Exe\oad_target_cc2650lp_stack.hex" "$PROJ_DIR$\..\..\..\..\util\bim\cc2640\iar\FlashOnly\Exe\bim.hex" -t onchip -i production -v 0 --usrId AAAA  -ob "$PROJ_DIR$\FlashROM\Exe\oad_target_cc2650lp_app_oad_onchip_production.bin" -m 0x0600

    The command line from Simple_Peripheral is:

    "$TOOLS_BLE$\oad\oad_image_tool.exe" "$PROJ_DIR$\FlashOnly_OAD_ImgB\Exe\simple_peripheral_cc2650lp_app.hex" -t onchip -i app --imgVer 0 --usrId BBBB -ob "$PROJ_DIR$\FlashOnly_OAD_ImgB\Exe\simple_peripheral_cc2650lp_app_oad.bin" -m 0x9000 --r 0x9000

     

    The latter ones are under "Options/Build Actions/Post-build command line" for each project, and generate de '.bin' files which I can perform OAD with. The first one (from the User Guide) does not have the '-v', 'usrId', '-m' or '--r' parameters. Aren't they necessary?

    Also, the latter ones generate a '.bin' file, and the User Guide one generate a '.hex' file. I tried adding '-ob' instead of '-o' in the command line, but I still get the metadata location error.

     

    Edit: I just realized I haven't mentioned before: for my application, since I don't have an external flash memory in my custom board, I need to perform ON Chip OAD.

  • Marie,

    Are you still working on this issue? Development is stuck until I get this to work, and alone I'm not getting any progress.
  • Hi Joao,

    Likely the image A is being selected because BIM see the image B as having a bad CRC. You can verify this by loading the BIM symbols to your application and debugging from the BIM to see why it doesn't jump to image B.

    In order to solve this I would load in the image B binary file starting at address 0x9000, I would expect the device to start.
    You can merge these files using srecord or a similar tool for production

    We have some suggestions here for the CC2640R2 device, which is a bit different but some of the concepts should apply:
    dev.ti.com/.../

    See the enhanced OAD lab.
  • Sean,

    I don't think Image B has a bad CRC, since I can upload it to my board using OAD flawlessly. I'm having problems specifically when I try to merge the files. I've tried both oad_image_tool.py and srecord, but they fail due to ovelapping.

    I'm attaching my hex and bin files - can you please try to merge them and see if you also have the problem?

    Files:  oad.zip

  • hi Joao,

    Please follow the steps listed on the simplelink academy above for debugging from BIM, and perform the following tests:

    1. Load BIM, image A, B, and stack symbols all into CCS.
    2. Start debugging from BIM breakpoint in bim_main
    3. Determine via single step why image A is selected instead of image B

    Do this with a freshly image. Report back.