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.

Universal Boot Loader for the CC2540DK Problem

Other Parts Discussed in Thread: CC2540

We have been attempted to implement the UBL on the Dongle that came with the CC2540DK using the HostTestApp demo application.  

We have following all the instructions found in "Universal Boot Loader for SOC-8051 by USB-MSD Developer's Guide.pdf" that came with the BLE-CC254x-1.2.1 stack.  100ms after osal_start_system() function is called, we call the function ublAppForceBoot(); From here it just doesn't do anything. 

We have also attempted to follow the Wiki instuctions below that indicate a manual copy and paste of the the UBL gex had to be performed.  This also did not work.

http://processors.wiki.ti.com/index.php/CC253x_Serial_Boot_Loader

Are the instructions documented in the UBL developers guide correct and if so, why would the UBL not function?

Ryan

  • Hi Ryan,

    Thanks for posting. I wanted to confirm that you have run the UBL example unmodified on your eval board. I want to try to rule out the hardware and setup as part of the problem.

    Thanks,

    Clinton

  • No Clinton,

    We have not reverted back to the UBL base example yet.  We have a slightly modified project that is based on the HostTestApp, but we are using the same hardware and setup as described in the documentation.

    Has your team successfully implemented the UBL on the eval board following the provided instructions?

    Ryan

  • Hi,

    1) If you flash the dongle with ONLY the UBL ubl_cc2540-dk.hex image it should show up as a mass storage device.

    2) If you copy a .bin file, for example one made with HostTestApp in the CC2540USB-UBL configuration over to the MSD using windows, it will "instantly" reboot into this image.

    3) If you hold in switch S1 (near bottom) when reinserting the dongle, it will go back to being a MSD. You can then delete the .bin and upload a new one.

    4) If you comment out osal_start_system in HostTest_Main.c and insert ublAppForceBoot(); below here, compile this to a .bin and copy it to the MSD with windows, the dongle will
    -  Copy the image to flash
    - UBL will reboot, realize it has a valid image, and set the program counter to the start of this image. All interrupts will be redirected to the interrupt table in this image.
    - Eventually run ublAppForceBoot which will invalidate the running image and reset into UBL, whereupon it resumes being a MSD.

    I feel what you may have done wrong is to program the HostTestApp directly from IAR, which given the settings in  Project->Options->Debugger->Texas Instruments->Erase flash will erase the UBL image residing at the start of the flash, so interrupts will not be redirected, the MSD functionality will be removed and the program counter will simply increment until it hits a valid instruction. In your case this seems to finally be ublAppForceBoot, which doesn't have anything to reboot into.

    If you wish to make a superpositioned hex image of UBL and HostTestApp you can a) try to append the .hex files in a hex editor or b) program UBL, copy over the .bin file and then read the resulting flash image back to a file on your computer using Flash Programmer.

    Best regards,
    Aslak 

  • Aslak,

    We have made good progress and have the Dongle running the bootloader.  There are a few outstanding items that would could use some help with.

    1. The "post-build command line" in the project options is set to :"$PROJ_DIR$\BLE_CC254x_v1.2.1\common\cc254x_sim2bin.exe".  When  we build, we get a message that the post-build action was executed, but we cannot find the *.bin file it creates.  We can run the same executable from a command prompt and it creates the *.bin file.  Do you know why this is not working?

    2. After calling the ublAppForceBoot (the hook into the boot loader  if we do nothing- i.e. just unplug the dongle and plug it back in - We cannot get our code to run without deleting the .bin from the MSD and copy a new one back in.  Is this the expected behavior?

    3. When our code is built on its own. (i.e. withou the ubl), the bluetooth doesn't pair up with the widget.  In order to get working code, we must build it, create the bin file, and copy to the MSD.  We haven't been able to determine the root cause of this issue, because it appears that the remainder of the code otherwise seems to be executing.

    Thanks for your help,

    Ryan

  • Aslak,

    Do you have any advice concerning the last 3 questions that Ryan has?

    Thanks!

    Walter

  • I believe I am all set for the time being and think I have solutions for my own questions.

    1. I was able to direct my post build instruction to project to cc254x_ubl_pp.bat file with a few path modifications to get the post build operation working.

    2. The application does seem to run after we force it into bootload mode, uplug it and plug it back in.  I'm not sure if we changed anything but it seems to be working now. As long as the *.bin file is still located on the MSD, it will run

    3. I created a new workspace with in the project that uses the standard linker and set the debugger back to run to main and it seems to run without the bootloader code.

    Thanks for your help

    Ryan

  • Ryan,

    Sounds good!  I'm glad your issues are resolved.  Feel free to utilize E2E if you run in to any other issues.

    Regards,

    Walter

  • Hi, Walter

    Use HostTestRelease--CC2540USB-UBL as my guide, I have been attempted to make UBL_bin_image with SimpleBLECentral on the USB_Dongle that came with the CC2540DK. I Successfully creates SimpleBLECentral_UBL_bin_image and load the image over the USB port, but the UBL's USB-MSD again at once, it cann't jump to SimpleBLECentral_UBL_bin_image like HostTestRelease_CC2540USB-UBL_image. Process of build the Project as below:
    1. Open project SimpleBLECentral

    2. New configuration CC2540USB base on CC2540EM

    3. Change CC2540 optictions:
     1) C/C++ Comiler->Preprocessor defined symbols add
     OAD_KEEP_NV_PAGES
     FEATURE_UBL_MSD

     2) Build Actions->Post-build command line
     "$PROJ_DIR$\..\..\common\cc2540\cc254x_ubl_pp.bat" "$PROJ_DIR$" "ProdUBL"   
     "$PROJ_DIR$\CC2540USB\Exe\SimpleBLECentralubl"

     3) Linker->Extra Output
     Override default: SimpleBLECentralubl.sim
     Output format: simple-code

     4)Linker->Config
     linker configuration file:
     $PROJ_DIR$\..\..\common\cc2540\cc254x_f256_ubl_msd.xcl

    Can you help me To solve this problem ?

    Best regards
    Ye

  • Hi Zuqin

      I'm trying to do this exact same thing at the moment but can't manage to run the code properly once downloaded in  the MSD.

    Did you have any luck finding a solution ?