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.

CC2640R2F: Programming BIM, stack and app via Flash Programmer 2

Part Number: CC2640R2F
Other Parts Discussed in Thread: UNIFLASH

Hello,

I am attempting to program a CC2640R2F chip in my product with the BIM, stack and app all in one step through the Flash Programmer tool. Up until this point, the BIM/Stack has been programmed using the Flash Programmer tool and the app .bin has been programmed using OAD tools. This has work without issue. I had a desire to remove the OAD step and make the programming faster, but when I try to download the app .bin using the Flash Programmer, my unit never jumps to the application code and only remains in the BIM code. I assume I have a fundamental knowledge disconnect. Should there be any reason by a .bin programs successful using OAD, but wouldn't when using flash programming tools? I have included a screen shot of Flash Programmer 2 page from my programming attempt for reference. 

Thank you.

  • Hello KM,

    I'm a little confused here. It looks like you're performing an on-chip OAD. When doing so, usually the stack, BIM, and persistent application are flashed, along with the initial application image. Then, using an OAD tool (like Btool for example), the new version of the application (and/or stack) can be updated.

    In your screenshot, I see that you're flashing two copies of the application. Why is that?

    There's some more information regarding the OAD process here in our User's Guide: dev.ti.com/.../setting-up-environment.html .
  • Hello Ammar,

    As you reference, I am trying to flash the BIM, stack and initial application image. I make the assumption that I can now run my application image on my device. However, when I recycle power, the application image never runs; the unit stays in the bootloader. I can take the same application image and program the unit using Btool and the unit will run the application as expected. I don't understand why the function changes depending on if I flash vs. OAD the application image.

    I see now that my original screen shot has confusing naming convention -- the first line .bin is my BIM, the second line .bin is my stack and the third line .bin is my application image.

    Based upon what I am reading in the link you reference, I believe I might be missing a valid CRC on my application image, since I took the .bin directly from my IAR project output. This would explain why it doesn't run on a power cycle. Does that sound like a valid analysis? I should send my .bin through the oad_image_tool to get a .bin with CRC?

    Thank you.
  • The oad_image_tool runs as a post build step. All you need to do is select the correct binary to flash (_oad).

    Let me know if that works! I'll try to reproduce your setup on my end in the meantime.
  • Hello Ammar,

    Just getting back to this issue - I went through the code base and found that we have implemented the oad_image_tool in our post command as follows

    ""$TOOLS_BLE$\oad\oad_image_tool.exe" "$PROJ_DIR$\FlashOnly_OAD_ImgB\Exe\simple_peripheral_cc2640r2lp_app.hex" -t onchip -i app --imgVer 0 --usrId BBBB -ob "$PROJ_DIR$\FlashOnly_OAD_ImgB\Exe\project_app_oad_00.03.2a.bin" -m 0x7000 --r 0x7000"

    Which means the binary file I am trying to program should already have the CRC and any other necessary features for flash programming, correct?

    I am still unable to get our project to work after flash programming the application image using the Flash Programmer 2 tool.

    Any other suggestions or comments you may be able to offer?

    Thanks.
  • I tried programming the application image starting at address location 0x7000, based upon the post command I found. This caused the Flash Programmer 2 tool to forcibly close before the programming was finished. It does this every time I try to program using 0x7000 as the programming address for the application image.
  • Hello,

    I'm sorry for the delay. I have tested using UniFlash v4 and was able to program the persistent app, bim, application and stack in one go using the sdk v2.3.

    Here's what I did:

    1. Go to Settings & Utilities, under Erase, change to "Necessary Sectors Only (Retain untouched content within sector).
    2. While we're here, might as well run a mass erase by clicking "Erase Entire Flash" (this step may not be needed).
    3. Go back to Program. Add the images as shown in the screenshot below. The Load Addresses for the application and stack binaries were taken from the .map file. This may be different if you've made any changes to the example code.
    4. Load the image, and then disconnect the board. Upon reconnect, you should see the SBP OAD APP v0001 advertising.

    Let me know if this works on your end.

  • Hello Ammar,

    I am going to give this a try this morning; I will let you know how it works for me. 

    Just one clarification question, when you reference "Add the images as shown in the screenshot below", is that the same order that I added the images in my original post? I don't see a screenshot added to your comment; I want to make sure I am making the same actions as you.

    Thanks.

  • I'm sorry, I forgot to attach the screenshot! Here it is.

  • Hello Ammar,

    Are you able to try this using Flash Programmer 2. I am struggling with Uniflash - I read on the wiki page that the v4 has issues installing the XDS100 drivers. I tried to follow the e2e suggested work around, but I don't have the correct permissions on my computer to install the bat file they recommend. I think because of this, I cannot get Uniflash to recognize my board. It throws an error "Cannot read property 'DS' of undefined" when I try to do anything with my chip.

    I cannot follow your example using Flash Programmer 2 because it doesn't allow programming of multiple file types (hex, bin) in one programming session.

    What do you suggest I try next?

    Thanks.
  • In Flash Programmer 2, make sure "Pages in image" is selected in the Erase column. Then you should be able to flash the application/stack binaries simultaneously. Then in a separate run, flash the persistent app and the bim projects.

    Unfortunately there's no way to make this a one click solution in Flash Programmer 2.
  • Just a note. In Flash Programmer, if you're programming multiple binary images, make sure the binary file starting at address 0x0 is lower in the list.

    An easier recommendation may be to create a single combined hex file with all 4 projects in them to make this process quicker. We have not tested this case, but you may find it useful to implement if you're not making any core changes to the persistent app or the BIM project.