CC2340R5 to CC2340R22 Porting Guide

This section will describe, in general terms, how to migrate a project developed for the CC2340R5 device to a CC2340R22 device running the SimpleLink Low Power F3 SDK. However, it is important to first assess the differences between both devices to make sure that the project migration is possible (See Platform Devices Comparison).

Evaluate the CC2340R22 device when only having CC2340R5 devices

To evaluate the CC2340R22 when only having a CC2340R5, you can modify the Flash size as described bellow:

  • Open the Linker command file .cmd and modify the Flash size to 256 kB.

    Listing 169. cc23x0_app_freertos.cmd - Replace FLASH_SIZE value.
    1#define FLASH_SIZE   0x40000
    

Note

The two devices are API compatible, a project for CC2340R22 developed on CC2340R5 can be migrated (via the migration guide below) with very few modifications to be built and flashed on CC2340R22.

Migration Guide

The recommended migration path is to start with a CC2340R5 based example project from the SimpleLink Low Power F3 SDK and follow the next steps:

  1. Import the project into Code Composer Studio or you IDE of preference.

  2. Open SysConfig, go to Device View and click on SWITCH.

../../_images/DeviceView_Switch.png

Figure 195. SysConfig - Switch Device.

  1. Once the Switch Board or Device window is opened, select the CC2340R22 board, or CC2340R22 device and click on CONFIRM. Make sure to save the project changes so that the migration takes place.

../../_images/Select_R22device.png

Figure 196. SysConfig - Select CC2340R22 device.

  1. Build the project.

Additional Steps for Off-Chip OAD and MCUBoot examples

Note

The CC2340R22 device does not support On-Chip and Dual Image OAD due to reduced Flash size.

  1. Right click on the project file and select Properties. Modify the post build steps so that the slot sizes match the ones of the CC2340R22 device.

../../_images/modify_post_build_offchip.png

Figure 197. Project Properties - Modify post build steps.

  1. Import MCUBoot project, modify the flash_map_backend.h adding the following lines of code. In addition, add DeviceFamily_CC23X0R22 as part of the Predefined Symbols of the project (right click on Properties → Predefined Symbols).

    Listing 170. flash_map_backend.h - Replace BOOT_PRIMARY_1_SIZE and BOOT_SECONDARY_1_SIZE values.
    1    #elif defined DeviceFamily_CC23X0R22
    2        #define BOOTLOADER_BASE_ADDRESS                 0x00000000
    3        #define BOOT_BOOTLOADER_SIZE                    0x00006000
    4
    5        #define BOOT_PRIMARY_1_BASE_ADDRESS             0x00006000
    6        #define BOOT_PRIMARY_1_SIZE                     0x00036000
    7
    8        #define BOOT_SECONDARY_1_BASE_ADDRESS           0x00023000
    9        #define BOOT_SECONDARY_1_SIZE                   0x00036000
    
  2. To finish with the MCUBoot project, go inside mcuboot_config and do the following:

    • Uncomment the following two lines:
      Listing 171. mcuboot_config.h - Uncomment to enable external flash configuration and enable the overwrite-only code path.
      1    #define TI_BOOT_USE_EXTERNAL_FLASH
      2    #define MCUBOOT_OVERWRITE_ONLY
      
    • Comment out the following line:
      Listing 172. mcuboot_config.h - Comment to disable the direct-xip code path.
      1    //#define MCUBOOT_DIRECT_XIP
      
  3. Build both projects.