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.

Instructions and tips how to create a custom boot loader for CC2640

Other Parts Discussed in Thread: CC2640, SYSBIOS, CC2640R2F, CC1350

I'm trying to create a custom bootloader for my CC2640 chip.

This is my wanted settup in flash.

*********************************************

-------------- 0x0000 --------------------

Bootloader

-------------- 0x4000 --------------------

App

-------- ICALL_STACK0_ADDR --------

Stack

**********************************************


When I configure my binarys to be placed like this I noticed that the linker still placed some drivercode in spaces 0x0100-0x0600

And I found this file confirming that. cc26xx_rtos_rom.icf

place at address mem:0x00000538 {readonly section .const_xdc_runtime_IModule_Interface__BASE__C};
place at address mem:0x0000058c {readonly section .const_xdc_runtime_Error_policy__C};....

.......

...place at address mem:0x20000100 {readwrite section .data_ti_sysbios_knl_Task_Module__state__V};
place at address mem:0x20000200 {readwrite section .data_xdc_runtime_Memory_Module__state__V};
place at address mem:0x200001f8 {readwrite section .data_xdc_runtime_System_Module__state__V};
place at address mem:0x20000144 {readwrite section .data_ti_sysbios_family_arm_m3_Hwi_Module__state__V};
place at address mem:0x200001e4 {readwrite section .data_ti_sysbios_family_arm_cc26xx_Timer_Module__state__V};

I guess that these driver-things must be placed there because of things in ROM must know where things are.

Am I right? or could these things be moved?

If they can't be moved should my custom boot be placed at end of Flash? Or how could my problem be solved?

If it should be placed at end. Is there any suggestions how to make chip start execute boot at startup?

Is there any documents describing anything about custom boots, static area in flash for drivers used by ROM, how to solve issues like this and create a custom boot?

  • Hi Harsmar,

    Have you seen our example of serial bootloader for the cc26xx? It's a part of our extra ble examples ( github.com/.../ble_examples ).

    There is also a chapter in the Technical reference manual ( www.ti.com/.../swcu117f.pdf ) on Bootloaders (Chapter 8).
  • Thanks alot!

    This was the thing I was looking for.

    https://github.com/ti-simplelink/ble_examples

    Too bad I have to stop using code form ROM. That make my already slimmed solution demanding to be even more slimmed. (if that is possible)

    This could be a showstopper for us. Might start looking for another manufacturer. I heard a rumor that you are about to create a BLE chip with twice the amount of flash. Do you know when it should be available?

  • Hi Harsmar,

    Please contact your local TI sales representative with your question.
  • Thanks.


    I have now been in contact with a sales representative. He didn't have answers on all my tecnical questions so I will try to get the answers here.

    So some summary of what I know about creating an own boot, please correct me if I'm wrong:

    • If I want to create an own boot which should be placed from addr 0x0000 in flash. Nothing in ROM can be used. = I will get a bigger application in flash
    • I cannot use last page of Flash even thow I create my own boot and doesn't want to use the one in ROM. = this makes us only have 124K for applications not 128K... Tried to use last page in flash for application but that resulted in a bricked HW.

    Right now I might could squeeze in Boot + APP + Stack + the thing we cant use in ROM on 124K but it will be tough. 

    This summary have raised some more questions. 

    I'm I correct in my assumptions or have I missed some vitally part of creating an own BOOT?
    Please correct me or give me more tips on how I can create my Boot and uses the flash area in a good way

  • Hi harsmar 

    Did you ever get to the end of your problem? I am trying to write a custom bootloader application and want to access the Flash api in ROM.

    Cheers

    Aquib

  • We solved it by build the BIOS in flash and not using it in ROM.

    When using BIOS from ROM it demands that certain code lays at fix addresses in FLASH on first flash page. (Which is the same page that we want our boot to lay in. )

    So we still have this setup in memory

    *********************************************

    -------------- 0x0000 --------------------

    Bootloader

    -------------- 0x4000 --------------------

    App

    -------- ICALL_STACK0_ADDR --------

    Stack

    **********************************************

    But we are, as told, building the BIOS in Flash instead of using it in ROM. By doing this we can use the first page to our custom boot loader.

    To build the BIOS in flash comment out this segment in "cc2640_r2_csdk.cfg"


    This is our code where we comment out and makes compiler to build BIOS in Flash:

    /* ================ ROM configuration ================ */
    /*
     * To use BIOS in flash, comment out the code block below.
     */
    /*
     * 2017-01-26 Commented out in order to be able to have a Boot in 0x0-0x4000 address range.
     * This means that we can not use the TI BIOS in ROM, but have to include it in our Application's Flash.
     * So we have to do what the comment above says; comment the block out.
    if (typeof NO_ROM == 'undefined' || (typeof NO_ROM != 'undefined' && NO_ROM == 0))
    {
      var ROM = xdc.useModule('ti.sysbios.rom.ROM');
      if (Program.cpu.deviceName.match(/CC26/)) {
          ROM.romName = ROM.CC2640R2F;
      }
      else if (Program.cpu.deviceName.match(/CC13/)) {
          ROM.romName = ROM.CC1350;
      }
    }
    */


    Hope I  answered your question. 

    Good luck!

  • Hi, Hasmar:
    Very glad to see that you have already create customized bootloader for CC26xx by yourself.
    My customer just have exactly the same demand as your description.
    Could you help send me the .icf(IAR) or .cmd(CCS) for reference? For we have some issue when configure the file.
    You also could contact me by my email Vivian.zhang @ti.com.
    It's quite urgency for my customer, thanks for your help!

    Vivian