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 build error

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

CC2640 4x4 custom board, ble_sdk_2_02_01_18, CCS6.2

In trying to build with OAD on the custom board, I am getting a build error

screen shot attached.

Please confirm if the following parameters are set correctly:

1. The custom board has a 2MB external flash. I changed the following parameter

in ext_flash_layout.h

#define EFL_FLASH_SIZE              0x100000

2. I set the EFL_ADDR_META to the following value.

// Image information (meta-data)
#define EFL_ADDR_META               0x1F000

3. In cc26xx_app_oad.cmd file, I doubled the flash length parameter.

#define FLASH_LEN               0x40000

What other parameters should I be changing?

Thanks,

Priya

  • Hi Priya,

    I think the problem is that you are changing FLASH_LEN. That parameter refers to the internal flash.
  • I went back to using the default FLASH_LEN in cc26xx_app_oad.cmd.

    #define FLASH_LEN               0x20000

    Nothing has changed in the error message.

    Some other parameter must be set incorrectly. Are there methods to troubleshoot this?

    Priya

  • Hi Priya,

    It's possible you are out of memory. I would recommend you look at the map file that is generated from the build and see how much flash is remaining.
  • I have attached a screenshot of the map file for your interpretation and pointers.

    Thanks,

    Priya

  • Hi Priya,

    The linker is trying to find a ~3k opening and you have less than that available. Other than the changes to the external flash, did you add anything to the project? Did you make any other changes to project settings?
  • Are you asking about the preprocessor symbols? I added a custom board and the OAD feature to the app project. I am using everything else as default. No new predefined symbols were used in the stack project. Are there any ideas to free up this needed space?
    Thanks,
    Priya
  • In looking at the build_config.opt file, the one feature the application does not use

    is the gap bond manager. After turning this feature off, the build error disappeared

    from the app. I am however not able to perform a successful OAD download.

    Here is a screenshot of the BTool window. What does the OAD flash error mean?

    The custom board uses the XDS200 debugger.

    Thanks,

    Priya

  • Hi Priya,

    OAD_FLASH_ERR means that the application could not open the external flash. This is likely because you have not setup the pins correctly for this.

    To see how to change the pins for extFlash OAD, please refer to the OAD section of the Software Developer's Guide within the CC2640R2 SDK. Even though this is for CC2640R2/BLE-Stack 3.0, the section about changing the pins of external flash should also apply to BLE-Stack 2.2.1 which you are using.
  • Without OAD, the application is communicating fine with the external flash and the other SPI slave on the custom board. I updated the custom board pins already inside bsp.h. Not sure why after the OAD hooks were added there is difficulty communicating with the external flash?
    Thanks,
    Priya
  • Hi Priya,

    Unfortunately there are two places that need to be updated:

    - bsp.h: this affects how BIM_extFlash interfaces to the external flash
    - Your board file. This affects how your high level application interfaces to the external flash

    Ideally both files will match wrt the pinout of the external flash. Please verify this.

    Another thing, the ExtFlash middleware module (ExtFlash.c,h) uses the PIN driver and the SPI driver, if either of their respective open calls fail the ExtFlash module will return a failure code which will result in OAD_FLASH_ERR. Do you know if it is the call to PIN or SPI that is causing the failure?

    In general drivers fail to open for two reasons:

    - The peripheral is already in use (i.e. PIN_open has already been called with that PIN)
    - Another peripheral is using that pin. (i.e. PIN_open is called on a PIN that is being used by SPI).

  • The same custom board pin (IOID_1) is being used as the flash chip select in
    all the needed files. I made the name for this pin as BSP_IOID_FLASH_CS in all
    the files-- middleware, board etc.

    Previously, in the driver middleware directory,
    C:\ti\tirtos_cc13xx_cc26xx_2_20_01_08\products\tidrivers_cc13xx_cc26xx_2_20_01_10\packages\ti\mw\extflash\ExtFlash.c
    this pin was called Board_SPI_FLASH_CS

    whereas inside C:\ti\simplelink\ble_sdk_2_02_00_31\src\examples\util\bim_extflash\cc2640\board\ext_flash.c
    the same pin was called BSP_IOID_FLASH_CS.

    Let me know if making this pin name the same in both places is a problem.

    The application does not call PIN_open. During the OAD download, I can't use the CCS debugger.
    Is there another way to tell if the OAD_FLASH_ERR is happening during PIN_open or SPI_open?

    Thanks,
    Priya
  • In discussing this error more -- the custom board is running the application which uses the SPI to make measurements. The application needs to know when an OAD is about to happen so it disables use of the SPI until OAD is complete. Are there API's for this purpose? Please refer me to the BLE SDG section.
    Thanks,
    Priya
  • Priya,

    Yes, assuming that you are following a similar method to how simple_peripheral implements OAD you will get a callback to your application from the OAD profile:

    For example SimpleBLEPeripheral_processOadWriteCB() with event OAD_WRITE_IDENTIFY_REQ

    Once your application receives the OAD_WRITE_IDENTIFY_REQ event, it should close the SPI peripheral which will allow the external flash module to use it during OAD.

  •  I tried eliminating the application's use of the SPI driver if there is any event in the OAD queue

    by setting an OAD flag. If there is an OAD flag, the sensor does not use the SPI driver  

    during end of advertising and connection events. Is something other than a simple flag

    needed here?

    The OAD flash error went away, but now the sensor is not requesting the first block write at all

    (OAD waiting for first block request).

    The sniffer capture is showing the OAD initiation but there is no notification from the sensor.

    Thanks,

    Priya

  • I commented out all of the applications use of the SPI driver. I made the OAD version number 0. This started the OAD download. I can see the notify on the BLE sniffer, though the sniffer crashes soon after this. BTool writes all the OAD blocks and ends with a OAD buffer overflow error. What causes this error?

    Thanks,

    Priya

  • Problem final resolved-- OAD is now working on the custom board!
    e2e.ti.com/.../569718
    Thanks,
    Priya